Skip to content

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

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
x-api-keyheaderstringyesAPI key for authenticationAvailable in Settings > API
Content-TypeheaderstringyesRequest content typeapplication/json
modebodystringyesOperation modeAdd, Update, AddOrUpdate
matchBybodystringyesCustomer identification fieldEmail, PhoneNumber, CrmId, GUID, visitorId. Must match Settings > Customers > Default matching mode
databodyarrayyesArray of customer objectsSee Customer data structure below

Customer data

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
emailbodystringconditionalCustomer email addressRequired if matchBy=Email. Max 320 characters
phonebodystringconditionalCustomer phone numberRequired if matchBy=PhoneNumber. Max 20 characters, no spaces
crmIdbodystringconditionalCustomer CRM identifierRequired if matchBy=CrmId. Max 128 characters
visitorIdbodystringnoWebsite visitor tracking IDMax 38 characters
firstNamebodystringnoCustomer first nameMax 256 characters
lastNamebodystringnoCustomer last nameMax 256 characters
dateOfBirthbodystringnoDate of birthISO-8601 format: YYYY-MM-DDT HH:mm:ss.sssZ
genderbodystringnoCustomer genderMale, Female, NotSpecified
customAttributesbodyarraynoCustom attribute valuesSee Custom attribute values structure
consentsDatabodyobjectnoConsent informationSee Consent data structure

Custom attribute values

Information about single custom attribute

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
namebodystringyesAttribute nameMin 1, max 256 characters
valuebodystringnoAttribute valueData type must match attribute definition

Information about consent array and additional settings for ‘AwaitingConformation’ status.

ParameterLocated inTypeRequiredDescriptionAllowed values / Notes
consentsbodyarraynoArray of consent dataSee Consent value
forcebodybooleannoResend confirmation for AwaitingConfirmation consentsDefault: false
confirmationMessageIdbodyintegernoConfirmation message IDMust be valid message ID

Information about single consent.

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
idbodyintegeryesConsent IDMust exist in Settings > Consents
valuebodystringyesConsent statusFalse, 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

CodeStatusDescription
201CreatedCustomer record created or updated successfully
400Bad requestInvalid parameters, missing required fields, or validation error
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for this operation
500Internal server errorServer-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

ParameterLocationTypeRequiredDescriptionAllowed values / notes
x-api-keyheaderstringyesAPI key for authenticationAvailable in Settings > API
idpathstringconditionalInternal customer IDRequired for /customers/id/{id}
emailpathstringconditionalCustomer email addressRequired for /customers/email/{email}
phonepathstringconditionalCustomer phone numberRequired for /customers/phone/{phone}. No spaces
crmIdpathstringconditionalCustomer CRM identifierRequired 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

CodeStatusDescription
200OKCustomer found and returned
400Bad RequestInvalid identifier format
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for this operation
404Not FoundCustomer with specified identifier does not exist
500Internal Server ErrorServer-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

ParameterLocationTypeRequiredDescriptionAllowed values / Notes
x-api-keyheaderstringYesAPI key for authenticationAvailable in Settings > API
withAnonymizationquerybooleanNoAnonymize customer data in addition to deletiontrue, false. Use for GDPR right-to-erasure compliance
idpathstringConditionalInternal customer IDRequired for /customers/id/{id} endpoint
emailpathstringConditionalCustomer email addressRequired for /customers/email/{email} endpoint
phonepathstringConditionalCustomer phone numberRequired for /customers/phone/{phone} endpoint. Digits only, no spaces
crmIdpathstringConditionalCustomer CRM identifierRequired 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"
}
FieldTypeDescription
typestringError type URL
titlestringShort error title
statusintegerHTTP status code
substatusstringSpecific error code (74 possible values)
detailstringDetailed error description
instancestringRequest instance identifier

Response codes

CodeStatusDescription
200OKCustomer deleted successfully
400Bad RequestInvalid identifier format or parameter value
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions for this operation
404Not FoundCustomer with specified identifier does not exist
500Internal Server ErrorServer-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

https://api.ecdp.app/swagger/index.html