Data Format
When data is sent to the API with a format that doesn’t match the expected pattern, the API returns a FORMAT_MISMATCH error, typically with a 422 status code. The error response provides details about the field and suggestions for correction.
Below are examples for common format validation errors.
Datetime Format (ISO 8601)
Expected format: YYYY-MM-DDTHH:mm:ss.
Applies to:
event_data.trips[].departure_arrivalevent_data.trips[].departure_timeevent_data.trips[].return_arrivalevent_data.trips[].return_time
Incorrect Value Sent:
{ ... "event_data": { ... "trips": [ { ... "departure_arrival": "2025/05/04T04:10:00", ... } ], ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "departure_arrival", "message": "Invalid date format for field departure_arrival.", "suggestion": "Ensure that the departure_arrival field is in string (ISO 8601 date format)." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ ... "event_data": { ... "trips": [ { ... "departure_arrival": "2025-05-04T04:10:00", ... } ], ... }}Product Format
Expected values: web, web-mobile, ios, android, ticket-office, travel-agency, call-center.
Applies to:
event_data.productproduct(root level for Identify endpoint)
Incorrect Value Sent:
{ ... "event_data": { ... "product": "web desktop", ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "product", "message": "Invalid product format.", "suggestion": "Ensure that the product field is valid. Accepted values: web, web-mobile, ios, android, ticket-office, travel-agency, call-center." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ ... "event_data": { ... "product": "web", ... }}Email Format
Expected format: Standard email address format.
Applies to:
event_data.emailprofile_params.email
Incorrect Value Sent:
{ ... "event_data": { ... "email": "john.doe@example", ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "email", "message": "Invalid email format.", "suggestion": "Ensure that the email field is valid." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ ... "event_data": { ... "email": "john.doe@example.com", ... }}Phone Format (E.164)
Expected format: E.164 standard (e.g., + followed by country code and number, no spaces or dashes).
Applies to:
event_data.phoneprofile_params.phone
Incorrect Value Sent:
{ ... "event_data": { ... "phone": "121-545-678-90", ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "phone", "message": "Invalid phone format.", "suggestion": "Ensure that the phone field is valid and follows E.164 format." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ ... "event_data": { ... "phone": "+12154567890", ... }}Date Format (ISO 8601)
Expected format: YYYY-MM-DD.
Applies to:
profile_params.birthdate
Incorrect Value Sent:
{ "profile_params": { ... "birthdate": "1990/09/10", ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "birthdate", "message": "Invalid date format for field birthdate.", "suggestion": "Ensure that the birthdate field is in string (ISO 8601 date format)." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ "profile_params": { ... "birthdate": "1990-09-10", ... }}Gender Format
Expected values: male or female.
Applies to:
profile_params.gender
Incorrect Value Sent:
{ "profile_params": { ... "gender": "woman", ... }}Error Response Snippet:
{ "errors": [ { "error_type": "TYPE_MISMATCH", "field": "gender", "message": "Invalid gender format.", "suggestion": "Ensure that the gender field is valid. Accepted values: male, female." } ], "message": "Validation failed. See details for more information.", "status": "error"}Correct Format:
{ "profile_params": { ... "gender": "female", ... }}