Documentation/API reference/Endpoints/
POST /v1/customer-events
Record something the customer did that is not a payment
Records one customer event: a sign-in, a failed sign-in, a new device, a changed password, two-step sign-in, e-mail, phone, address or limit, an added or changed payee, an added card, or a card payment the customer confirmed in your app (CARD_PAYMENT_CONFIRMATION: a 3-D Secure challenge or an approval in the app, with the session and device data your app saw; a card event itself carries none). Nothing is decided and no rule runs on an event: it keeps the customer's device ledger and is shown on the customer's Digital activity tab (see the Customer events guide).
The customer must already be yours (customer_ref): an event never creates a customer. An event is identified by source_system + external_event_id: sending it again answers the first answer with duplicate: true and stores nothing more, so no Idempotency-Key is needed. A repeat must be the same event: one whose customer_ref or event_type differs from the first is refused 409 and nothing is stored. event_time may be up to 400 days in the past, so you can send your customers' past sign-ins at go-live; it may not be later than the time it is sent.
The session and device fields are read as on a payment: a malformed one is not stored and the answer carries warnings (it never refuses the event), a field left out says nothing. An external_event_id or customer_ref beginning EXAMPLE- is refused. The events take their own back-pressure, separate from payments and card events: a burst of sign-ins never takes the decisions' capacity.
Request body
A JSON object, at most 64 000 characters.
Example: A sign-in from the customer's phone (example references are refused)
{
"external_event_id": "EXAMPLE-EVENT-0001",
"source_system": "MOBILE-APP",
"customer_ref": "EXAMPLE-CUST-0001",
"event_type": "LOGIN_SUCCESS",
"event_time": "2026-09-02T18:01:07Z",
"ip_address": "203.0.113.10",
"device_id": "EXAMPLE-DEVICE-7F3A9C21",
"device_timezone": "Europe/Vilnius",
"session_id": "EXAMPLE-SESSION-0001",
"initiation_channel": "MOBILE_APP",
"device_os": "IOS",
"data_classification": "TEST"
}
Example: A card payment the customer approved in the app (3-D Secure challenge)
{
"external_event_id": "EXAMPLE-EVENT-0002",
"customer_ref": "EXAMPLE-CUST-0001",
"event_type": "CARD_PAYMENT_CONFIRMATION",
"outcome": "APPROVED",
"confirmation_method": "THREE_DS_CHALLENGE",
"card_token": "EXAMPLE-CARD-0001",
"merchant_country": "DE",
"ip_address": "203.0.113.10",
"device_id": "EXAMPLE-DEVICE-7F3A9C21",
"data_classification": "TEST"
}
Request sample
curl -X POST "$UNDERLAYER_BASE_URL/v1/customer-events" \
-H "X-API-Key: $UNDERLAYER_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"external_event_id": "EXAMPLE-EVENT-0001",
"source_system": "MOBILE-APP",
"customer_ref": "EXAMPLE-CUST-0001",
"event_type": "LOGIN_SUCCESS",
"event_time": "2026-09-02T18:01:07Z",
"ip_address": "203.0.113.10",
"device_id": "EXAMPLE-DEVICE-7F3A9C21",
"device_timezone": "Europe/Vilnius",
"session_id": "EXAMPLE-SESSION-0001",
"initiation_channel": "MOBILE_APP",
"device_os": "IOS",
"data_classification": "TEST"
}
JSONimport os
import requests
response = requests.post(
os.environ["UNDERLAYER_BASE_URL"] + "/v1/customer-events",
headers={"X-API-Key": os.environ["UNDERLAYER_API_KEY"]},
json={
"external_event_id": "EXAMPLE-EVENT-0001",
"source_system": "MOBILE-APP",
"customer_ref": "EXAMPLE-CUST-0001",
"event_type": "LOGIN_SUCCESS",
"event_time": "2026-09-02T18:01:07Z",
"ip_address": "203.0.113.10",
"device_id": "EXAMPLE-DEVICE-7F3A9C21",
"device_timezone": "Europe/Vilnius",
"session_id": "EXAMPLE-SESSION-0001",
"initiation_channel": "MOBILE_APP",
"device_os": "IOS",
"data_classification": "TEST"
},
)
print(response.status_code, response.json())const response = await fetch(process.env.UNDERLAYER_BASE_URL + "/v1/customer-events", {
method: "POST",
headers: {
"X-API-Key": process.env.UNDERLAYER_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"external_event_id": "EXAMPLE-EVENT-0001",
"source_system": "MOBILE-APP",
"customer_ref": "EXAMPLE-CUST-0001",
"event_type": "LOGIN_SUCCESS",
"event_time": "2026-09-02T18:01:07Z",
"ip_address": "203.0.113.10",
"device_id": "EXAMPLE-DEVICE-7F3A9C21",
"device_timezone": "Europe/Vilnius",
"session_id": "EXAMPLE-SESSION-0001",
"initiation_channel": "MOBILE_APP",
"device_os": "IOS",
"data_classification": "TEST"
}),
});
console.log(response.status, await response.json());Written from the example on this page. UNDERLAYER_BASE_URL is https://api.underlayer.eu; UNDERLAYER_API_KEY is yours, given at onboarding.
Responses
| Status | Body | Description |
|---|---|---|
200 | CustomerEventResult | A repeat of a recorded event ( |
202 | CustomerEventResult | The event was recorded. Nothing is decided; |
400 | ErrorBody | The body is not a JSON object, or the database refused the event with a
Correct the request; do not send it again unchanged. |
401 | ErrorBody | The key is missing, malformed (not |
403 | ErrorBody | The key is limited to allowed addresses and the request came from another one, the institution is not active, or this key may not send this data classification. |
409 | ErrorBody | The request repeats an earlier event's |
413 | ErrorBody | The body is larger than the limit (64 000 bytes for payments, card events and customer events, 2 000 000 for a CDD import); a larger Content-Length is refused before the body is read and before the key is checked. Split it. |
429 | ErrorBody | Rate limited. Wait the seconds in |
500 | ErrorBody | The database refused the event with something other than a validation message, a fault on our side; |
503 | ErrorBody | The service cannot take the customer event or the card registration now; nothing was stored and your key was not judged. |
Examples of 202
Example: recorded
{
"duplicate": false,
"event_id": "00000000-0000-4000-8000-000000000041",
"event_ref": "CEV-2026-000123",
"event_type": "LOGIN_SUCCESS",
"received_at": "2026-09-02T18:01:08.204719+00:00"
}
Examples of 400
Example: notJson
{
"error": "Body must be valid JSON",
"error_code": "BODY_NOT_JSON"
}
Example: notObject
{
"error": "Body must be a JSON object",
"error_code": "BODY_NOT_OBJECT"
}
Example: unknownCustomer
{
"error": "unknown customer_ref C-0042",
"error_code": "UNKNOWN_CUSTOMER"
}
Example: An EXAMPLE- reference, as in the request examples above
{
"error": "references beginning EXAMPLE- come from the documentation and are refused: send your own references",
"error_code": "EXAMPLE_ROW"
}
Examples of 401
Example: missing
{
"error": "Missing or malformed API key",
"error_code": "API_KEY_MISSING"
}
Example: invalid
{
"error": "Invalid or revoked API key",
"error_code": "API_KEY_INVALID"
}
Examples of 403
Example: addressNotAllowed
{
"error": "API key not allowed from this address",
"error_code": "API_KEY_ADDRESS_NOT_ALLOWED"
}
Example: institutionInactive
{
"error": "Institution is not active",
"error_code": "INSTITUTION_NOT_ACTIVE"
}
Example: classification
{
"error": "This API key may not submit TEST events",
"error_code": "CLASSIFICATION_NOT_ALLOWED_FOR_KEY"
}
Examples of 409
Example: differentBody
{
"error": "this source_system and external_event_id were already used for a customer event with a different event_type: retry with the same body, or send a new event with a new external_event_id",
"error_code": "IDEMPOTENCY_CONFLICT"
}
Examples of 413
Example: tooLarge
{
"error": "Request body too large",
"error_code": "BODY_TOO_LARGE"
}
Examples of 429
Example: failedAuthentications
{
"error": "Too many failed authentication attempts from this address; retry after the number of seconds in Retry-After",
"error_code": "TOO_MANY_FAILED_AUTHENTICATIONS"
}
Example: perKey
{
"error": "Too many requests for this API key; retry after the number of seconds in Retry-After",
"error_code": "RATE_LIMITED_KEY"
}
Example: perAddress
{
"error": "Too many requests from this address; retry after the number of seconds in Retry-After",
"error_code": "RATE_LIMITED_ADDRESS"
}
Examples of 500
Example: engine
{
"error": "Customer event engine error",
"error_code": "ENGINE_ERROR",
"code": "P0001"
}
Examples of 503
Example: busy
{
"error": "Service busy",
"error_code": "SERVICE_BUSY"
}
Example: keyCheck
{
"error": "Service unavailable",
"error_code": "SERVICE_UNAVAILABLE"
}
Example: settings
{
"error": "Service temporarily unavailable",
"error_code": "SERVICE_SETTINGS_UNUSABLE"
}
© 2026 Underlayer, Lithuania. info@underlayer.eu System status Privacy notice