Customers
Use these methods to create new customer records, update existing customer data, and retrieve customer information by various identifiers.
POST /customers – add or update customer
This method creates new customer records or updates existing customer data.
Endpoint
The endpoint (server address) for this request is https://api.ecdp.app/customers
Request parameters
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
|---|---|---|---|---|---|
| x-api-key | header | string | yes | API key for authentication | Available in Settings > API |
| Content-Type | header | string | yes | Request content type | application/json |
| mode | body | string | yes | Operation mode | Add, Update, AddOrUpdate |
| matchBy | body | string | yes | Customer identification field | Email, PhoneNumber, CrmId, GUID, visitorId. Must match Settings > Customers > Default matching mode |
| data | body | array | yes | Array of customer objects | See Customer data structure below |
Customer data
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
|---|---|---|---|---|---|
| body | string | conditional | Customer email address | Required if matchBy=Email. Max 320 characters | |
| phone | body | string | conditional | Customer phone number | Required if matchBy=PhoneNumber. Max 20 characters, no spaces |
| crmId | body | string | conditional | Customer CRM identifier | Required if matchBy=CrmId. Max 128 characters |
| visitorId | body | string | no | Website visitor tracking ID | Max 38 characters |
| firstName | body | string | no | Customer first name | Max 256 characters |
| lastName | body | string | no | Customer last name | Max 256 characters |
| dateOfBirth | body | string | no | Date of birth | ISO-8601 format: YYYY-MM-DDT HH:mm:ss.sssZ |
| gender | body | string | no | Customer gender | Male, Female, NotSpecified |
| customAttributes | body | array | no | Custom attribute values | See Custom attribute values structure |
| consentsData | body | object | no | Consent information | See Consent data structure |
Custom attribute values
Information about single custom attribute
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
|---|---|---|---|---|---|
| name | body | string | yes | Attribute name | Min 1, max 256 characters |
| value | body | string | no | Attribute value | Data type must match attribute definition |
Consent data
Information about consent array and additional settings for ‘AwaitingConformation’ status.
| Parameter | Located in | Type | Required | Description | Allowed values / Notes |
|---|---|---|---|---|---|
| consents | body | array | no | Array of consent data | See Consent value |
| force | body | boolean | no | Resend confirmation for AwaitingConfirmation consents | Default: false |
| confirmationMessageId | body | integer | no | Confirmation message ID | Must be valid message ID |
Consent value
Information about single consent.
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
|---|---|---|---|---|---|
| id | body | integer | yes | Consent ID | Must exist in Settings > Consents |
| value | body | string | yes | Consent status | False, AwaitingConfirmation, True |
Example requests
Add a new customer
POST /customers
{
"mode": "Add",
"matchBy": "Email",
"data": [
{
"email": "john.smith@example.com",
"firstName": "John",
"lastName": "Smith",
"phone": "48123456789",
"gender": "Male",
"dateOfBirth": "1985-03-15T00:00:00.000Z"
}
]
}AddOrUpdate with custom attributes and consents
POST /customers
{
"mode": "AddOrUpdate",
"matchBy": "Email",
"data": [
{
"email": "jane.doe@example.com",
"firstName": "Jane",
"lastName": "Doe",
"phone": "48987654321",
"gender": "Female",
"customAttributes": [
{
"name": "preferred language",
"value": "en"
},
{
"name": "loyalty tier",
"value": "Gold"
}
],
"consentsData": {
"consents": [
{
"id": 1,
"value": "True"
},
{
"id": 2,
"value": "AwaitingConfirmation"
}
],
"force": false,
"confirmationMessageId": 101
}
}
]
}Response codes
| Code | Status | Description |
| 201 | Created | Customer record created or updated successfully |
| 400 | Bad request | Invalid parameters, missing required fields, or validation error |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for this operation |
| 500 | Internal server error | Server-side error. Retry with exponential backoff |
The response includes statistics, custom attributes, and consent status.
GET /customers/{identifier} – receive information about customers
The GET method retrieves complete customer profile data using one of four identifier types: internal ID, email address, phone number, or CRM ID.
Endpoints
ID: https://api.ecdp.app/customers/id/{id}
Email: https://api.ecdp.app/customers/email/{email}
Phone: https://api.ecdp.app/customers/phone/{phone}
CRM ID: https://api.ecdp.app/customers/crmId/{crmId}
Request parameters
| Parameter | Location | Type | Required | Description | Allowed values / notes |
|---|---|---|---|---|---|
| x-api-key | header | string | yes | API key for authentication | Available in Settings > API |
| id | path | string | conditional | Internal customer ID | Required for /customers/id/{id} |
| path | string | conditional | Customer email address | Required for /customers/email/{email} | |
| phone | path | string | conditional | Customer phone number | Required for /customers/phone/{phone}. No spaces |
| crmId | path | string | conditional | Customer CRM identifier | Required for /customers/crmId/{crmId} |
Example requests and responses
Get customer by ID
Request:
GET /customers/id/12345
Response:
{
"status": 200,
"data": {
"email": "john.smith@example.com",
"phone": "48123456789",
"crmId": "CRM-001234",
"firstName": "John",
"lastName": "Smith",
"dateOfBirth": "1985-03-15T00:00:00.000Z",
"gender": "Male",
"rfmSegment": "Champions",
"totalSpent": 2450.00,
"totalOrders": 12,
"totalOrderReturns": 1,
"avgOrder": 204.17,
"avgPricePoint": 68.06,
"lastOrder": "2024-01-15T14:30:00.000Z",
"avgTimeBetweenOrdersInDays": 28,
"currencySymbol": "PLN",
"customAttributes": [
{
"name": "preferred language",
"value": "en"
}
],
"consentsData": {
"consents": [
{
"id": 1,
"value": "True"
}
]
}
}
}Get customer by email
Request:
GET /customers/email/jane.doe@example.com
Response:
{
"status": 200,
"data": {
"email": "john.smith@example.com",
"phone": "48123456789",
"crmId": "CRM-001234",
"firstName": "John",
"lastName": "Smith",
"dateOfBirth": "1985-03-15T00:00:00.000Z",
"gender": "Male",
"rfmSegment": "Champions",
"totalSpent": 2450.00,
"totalOrders": 12,
"totalOrderReturns": 1,
"avgOrder": 204.17,
"avgPricePoint": 68.06,
"lastOrder": "2024-01-15T14:30:00.000Z",
"avgTimeBetweenOrdersInDays": 28,
"currencySymbol": "PLN",
"customAttributes": [
{
"name": "preferred language",
"value": "en"
}
],
"consentsData": {
"consents": [
{
"id": 1,
"value": "True"
}
]
}
}
}Response codes
| Code | Status | Description |
| 200 | OK | Customer found and returned |
| 400 | Bad Request | Invalid identifier format |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for this operation |
| 404 | Not Found | Customer with specified identifier does not exist |
| 500 | Internal Server Error | Server-side error; retry with exponential backoff |
DELETE /customers/{identifier} – delete customer
Permanently deletes a customer profile from ExpertSender CDP using one of four identifier types: internal ID, email address, phone number, or CRM ID. Optionally anonymizes customer data for GDPR compliance.
Endpoints
ID: https://api.ecdp.app/customers/id/{id}
Email: https://api.ecdp.app/customers/email/{email}
Phone: https://api.ecdp.app/customers/phone/{phone}
CRM ID: https://api.ecdp.app/customers/crmId/{crmId}
Request parameters
| Parameter | Location | Type | Required | Description | Allowed values / Notes |
| x-api-key | header | string | Yes | API key for authentication | Available in Settings > API |
| withAnonymization | query | boolean | No | Anonymize customer data in addition to deletion | true, false. Use for GDPR right-to-erasure compliance |
| id | path | string | Conditional | Internal customer ID | Required for /customers/id/{id} endpoint |
| path | string | Conditional | Customer email address | Required for /customers/email/{email} endpoint | |
| phone | path | string | Conditional | Customer phone number | Required for /customers/phone/{phone} endpoint. Digits only, no spaces |
| crmId | path | string | Conditional | Customer CRM identifier | Required for /customers/crmId/{crmId} endpoint |
Example requests and responses
Delete customer by ID
DELETE /customers/id/12345
Response: 200 OK
{
"status": 200
}Delete customer by email with anonimization
DELETE /customers/email/john.smith@example.com?withAnonymization=true
Response: 200 OK
{
"status": 200
}Error response structure
When an error occurs (401, 404), the response includes diagnostic information:
{
"type": "string",
"title": "string",
"status": 0,
"substatus": "CanNotGetSegmentWithId",
"detail": "string",
"instance": "string"
}| Field | Type | Description |
| type | string | Error type URL |
| title | string | Short error title |
| status | integer | HTTP status code |
| substatus | string | Specific error code (74 possible values) |
| detail | string | Detailed error description |
| instance | string | Request instance identifier |
Response codes
| Code | Status | Description |
| 200 | OK | Customer deleted successfully |
| 400 | Bad Request | Invalid identifier format or parameter value |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for this operation |
| 404 | Not Found | Customer with specified identifier does not exist |
| 500 | Internal Server Error | Server-side error; retry with exponential backoff |
Validation and behavior rules
- It is possible to add or update a single customer or multiple customers with one request.
- The mode parameter must be exactly one of: Add, Update, AddOrUpdate.
- The matchBy parameter must match the default identification field configured in Settings > Customers.
- For mode=Update, the customer must already exist; otherwise returns 404 Not Found.
- When consentsData.consents[].value is AwaitingConfirmation, a confirmation email is sent automatically.
Reference documentation
Swagger – Customers