/v2/contacts/create

POST

Create a new contact and attach to a sub-account. On success, returns the new contact entity.

The API responses shown below are static. If you want to try out the API please login, or register for an API key

API parameters

Required
NameInTypeDescriptionEnum
X-Auth-Token header string Authentication token.
account_id formData string Account UUID.
first_name formData string Contact first name.
last_name formData string Contact last name.
email_address formData string Email address.
phone_number formData string Phone number.
Optional
NameInTypeDescriptionEnum
your_reference formData string User-generated reference code.
mobile_phone_number formData string Mobile phone number.
login_id formData string Currencycloud login ID.
status formData string Contact status. enabled
not_enabled
locale formData string Locale code ("en", "en-US", "fr-FR").
timezone formData string Timezone ("Europe/London", "America/New_York").
date_of_birth formData string Date of birth. ISO 8601 format YYYY-MM-DD.
curl -X POST  --header "X-Auth-Token: XXXX-XXXXX-XXXX"  https://devapi.currencycloud.com/v2/contacts/create

Response

{
    "login_id": "[email protected]",
    "id": "70dac628-d284-4bdc-b1f3-22bfa6c20851",
    "first_name": "Test Contact Name",
    "last_name": "Test Contact Lastname",
    "account_id": "72970a7c-7921-431c-b95f-3438724ba16f",
    "account_name": "Currency Cloud Dev Centre",
    "status": "not_enabled",
    "locale": "en",
    "timezone": "Europe\/London",
    "email_address": "[email protected]",
    "mobile_phone_number": null,
    "phone_number": " 44 222 333444",
    "your_reference": null,
    "date_of_birth": null,
    "created_at": "2018-10-17T11:00:18+00:00",
    "updated_at": "2018-10-17T11:00:18+00:00"
}
Error Codes
HTTP Status Code Description Params
400 account_id_is_in_invalid_format account_id is in invalid format
first_name_is_too_short first_name can not be shorter than 1 character(s) { "minlength" => 1 }
first_name_is_too_long first_name can not be longer than 100 character(s) { "maxlength" => 100 }
last_name_is_too_short last_name can not be shorter than 1 character(s) { "minlength" => 1 }
last_name_is_too_long last_name can not be longer than 100 character(s) { "maxlength" => 100 }
email_address_is_too_short email_address can not be shorter than 1 character(s) { "minlength" => 1 }
email_address_is_too_long email_address can not be longer than 255 character(s) { "maxlength" => 255 }
email_address_is_in_invalid_format email_address is in invalid format
phone_number_is_too_short phone_number can not be shorter than 1 character(s) { "minlength" => 1 }
phone_number_is_too_long phone_number can not be longer than 100 character(s) { "maxlength" => 100 }
mobile_phone_number_is_too_short mobile_phone_number can not be shorter than 1 character(s) { "minlength" => 1 }
mobile_phone_number_is_too_long mobile_phone_number can not be longer than 100 character(s) { "maxlength" => 100 }
login_id_is_too_short login_id can not be shorter than 1 character(s) { "minlength" => 1 }
login_id_in_use login_id already in use
login_id_is_too_long login_id can not be longer than 50 character(s) { "maxlength" => 50 }
locale_is_too_short locale can not be shorter than 2 character(s) { "minlength" => 2 }
locale_is_too_long locale can not be longer than 5 character(s) { "maxlength" => 5 }
timezone_is_too_short timezone can not be shorter than 2 character(s) { "minlength" => 2 }
timezone_is_too_long timezone can not be longer than 5 character(s) { "maxlength" => 5 }
status_not_in_range status should be in range: enabled, not_enabled
date_of_birth_type_is_wrong date_of_birth should be of date type { "type" => "date" }
date_of_birth_is_required Date of Birth is a required field. Please provide date of birth (YYYY-MM-DD)
401 invalid_supplied_credentials Authentication failed with the supplied credentials
429 too_many_requests Too many requests have been made to the api. Please refer to the Developer Center for more information
500 internal_server_error Internal server error
503 service_unavailable Service is temporary unavailable
Was this page helpful?
Yes
No