Customer upload
Import customer data into Customerscore via the Customers API endpoint.
For interactive API documentation, see the Swagger reference (opens in a new tab).
Endpoint
| Method | URL |
|---|---|
| POST | https://api.customerscore.io/api/v1/customers |
Request Body
The customers field is mandatory in the JSON body. Each customer object within the customers array must include the following attributes:
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | Yes | Identifier for the customer, max 255 characters |
name | string | Yes | Name of the customer, max 255 characters |
owner_email | string | No | Owner's email address, max 255 characters |
attributes | object | No | Customer attributes object |
metrics | array | No | Array of metric objects (up to 200 items) |
Example Request
curl -X POST "https://api.customerscore.io/api/v1/customers" \
-H "Content-Type: application/json" \
-H "customerscore-key: your-generated-key" \
-d '{
"customers": [
{
"external_id": "12345",
"name": "Knapp-Cruz Inc.",
"owner_email": "owner@example.com",
"attributes": {
"crm_link": "https://your-crm.com/12345",
"contact_email": "contact@example.com",
"renewal_date": "2025-05-25"
},
"metrics": [
{
"date": "2024-04-29",
"resolved_tickets": 39
}
]
}
]
}'Full Request Body Example
{
"customers": [
{
"external_id": "12345",
"name": "Knapp-Cruz Inc.",
"owner_email": "owner@example.com",
"attributes": {
"crm_link": "https://example.com",
"contact_email": "example@example.com",
"renewal_date": "2024-05-25",
"country_name": "Czech Republic",
"customers_count": 99,
"has_avatar": true
},
"metrics": [
{
"date": "2024-04-29",
"country": "Czechia",
"has_picture": true,
"resolved_tickets": 39,
"created_at": "2024-08-15"
}
]
}
]
}Owner Email Field
If owner_email is provided, the customer will be automatically linked to the user in your account (if such a user exists).
Attributes Field
The attributes field is an object that contains useful information about a given customer. You can add:
- System attributes:
crm_link,contact_email,renewal_date - Custom attributes: Configured in the Customerscore.io application under Attributes (opens in a new tab)
Example Attributes Object
{
"crm_link": "https://your-crm-link.com/12345",
"contact_email": "example@example.com",
"renewal_date": "2025-05-25",
"country_name": "Czech Republic",
"customers_count": 99,
"has_avatar": true
}Supported Value Types
| Type | Example |
|---|---|
| String | "abcd" |
| Number | 1234 |
| Boolean | true or false |
| Date | "2024-08-14" |
Each key must precisely match the codename of the attribute configured in Customerscore. Keys are case-sensitive. Only matching keys will be stored and used for score calculation.
Metrics Field
The metrics field contains product-usage data that feeds into the health score calculation. It can hold up to 200 items.
| Field | Type | Required | Description |
|---|---|---|---|
date | string | Yes | Date for the metric, must be unique in the array |
Example Metrics Array
[
{
"date": "2024-04-29",
"country": "Czechia",
"has_picture": true,
"resolved_tickets": 39,
"created_at": "2024-08-15"
}
]Each key must precisely match the codename of the metric configured in Metrics (opens in a new tab). Keys are case-sensitive.
Processing
Upon successful data import, internal processing will occur, including a scoring process that may take up to 30 minutes. After processing is complete, all users in the account will receive a notification regarding the newly imported customer data.
Response Codes
| Code | Description |
|---|---|
| 200 | Customer data has been successfully received and forwarded for processing |
| 400 | Bad request |
| 401 | Unauthorized - Missing customerscore-key in the header |
| 403 | Forbidden - Invalid key |
| 405 | Method Not Allowed - Only POST method is allowed |
| 406 | Not Acceptable |
| 429 | Too Many Requests |
| 490 | Unconfigured scoring |