curl --location --request POST 'https://api.travtus.com/persons/multiple/' \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer <token>' \
--data-raw '{
"persons": [
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"group_ids": "['group-1', 'group-2']"
},
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"group_ids": "['group-1']"
},
{
"first_name": "Test insuficient info",
"groups_external_refs": "['group-external-ref-1']"
}
]
}'
{
"persons": [
{
"identifier": "internal-id-1",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"success": true,
"failure_reason": ""
},
{
"identifier": "internal-id-2",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"success": true,
"failure_reason": ""
},
{
"first_name": "Test insuficient info",
"groups": "['group-1']",
"success": false,
"failure_reason": "Insufficient information to create a new person record. Please provide either an external reference or a combination of phone number OR email address AND first name OR last name."
}
]
}
This endpoint creates or updates multiple person records passed as a list in the request’s body.
curl --location --request POST 'https://api.travtus.com/persons/multiple/' \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer <token>' \
--data-raw '{
"persons": [
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"group_ids": "['group-1', 'group-2']"
},
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"group_ids": "['group-1']"
},
{
"first_name": "Test insuficient info",
"groups_external_refs": "['group-external-ref-1']"
}
]
}'
{
"persons": [
{
"identifier": "internal-id-1",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"success": true,
"failure_reason": ""
},
{
"identifier": "internal-id-2",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"success": true,
"failure_reason": ""
},
{
"first_name": "Test insuficient info",
"groups": "['group-1']",
"success": false,
"failure_reason": "Insufficient information to create a new person record. Please provide either an external reference or a combination of phone number OR email address AND first name OR last name."
}
]
}
group_id parameter or a group external reference via the group_external_ref attribute.
If both are provided for any of the person records in ther request body, the request will not be successful.
Matching of the person records is done in the following order:
external_ref in the request body is an exact match.email_address) or phone number (phone_number).external_ref) or any combination of phone number (phone_number) or email address (email_address) AND first name (first_name) or (last_name).
For example:
curl --location --request POST 'https://api.travtus.com/integration/persons/' \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer <token>'
--data-raw '{
"email_address": "[email protected]",
"first_name": "Test"
}'
curl --location --request POST 'https://api.travtus.com/integration/persons/' \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer <token>'
--data-raw '{
"email_address": "[email protected]",
"phone_number": "01234567890"
}'
Show properties
Show properties
{
"error": {
"type": "missing_authorization",
"message": "Your request does not include an 'Authorization' header with a bearer token for your account."
}
}
{
"error": {
"type": "expired_token",
"message": "The bearer token you have provided in the 'Authorization' header has expired. Please obtain a new one."
}
}
{
"error": {
"type": "invalid_authorization",
"message": "The bearer token you have provided in the 'Authorization' header is invalid."
}
}
{
"error": {
"type": "both_group_identifiers_provided",
"message": "You have provided both group ids and group external references for a person in your request body. Please only provide one of the two."
}
}
curl --location --request POST 'https://api.travtus.com/persons/multiple/' \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer <token>' \
--data-raw '{
"persons": [
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"group_ids": "['group-1', 'group-2']"
},
{
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"group_ids": "['group-1']"
},
{
"first_name": "Test insuficient info",
"groups_external_refs": "['group-external-ref-1']"
}
]
}'
{
"persons": [
{
"identifier": "internal-id-1",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 1",
"external_ref": "id-1",
"phone_number": "01234567890",
"success": true,
"failure_reason": ""
},
{
"identifier": "internal-id-2",
"email_address": "[email protected]",
"first_name": "Test",
"last_name": "Person 2",
"external_ref": "id-2",
"phone_number": "01234567891",
"success": true,
"failure_reason": ""
},
{
"first_name": "Test insuficient info",
"groups": "['group-1']",
"success": false,
"failure_reason": "Insufficient information to create a new person record. Please provide either an external reference or a combination of phone number OR email address AND first name OR last name."
}
]
}