https://voice-api.relationsai.com/v1 with a rai_test_ key, which never places a real call. It works once the API is enabled for your workspace (private preview: support@relationsai.com). Your key stays in this tab's memory; live keys are refused.Contacts
People you call, with consent and custom fields that become call variables.
List contacts
Lists contacts, newest first. Filter by exact phone number, consent or do-not-call status.
GET /v1/contacts · Operation ID: listContacts
query Parameters
limitMaximum number of objects to return, from 1 to 100. Defaults to 25.
cursorThe next_cursor of the previous page. Send it with exactly the same filters as the request that returned it; a changed filter set is 400 invalid_cursor.
created_afterOnly objects created at or after this time (RFC 3339, UTC).
created_beforeOnly objects created before this time (RFC 3339, UTC).
phone_numberOnly the contact with this number (E.164). Matches the same way the do-not-call check does.
consent_grantedOnly contacts with (true) or without (false) recorded consent.
do_not_callOnly contacts on (true) or off (false) the do-not-call list.
List contacts › Responses
A page of contacts.
objectAlways list.
has_moreTrue when more objects exist after this page.
next_cursorPass as cursor (with the same filters) to fetch the next page. Null on the last page.
Contacts on this page.
Create a contact
Creates a contact. Phone numbers are unique within a workspace and mode; creating a second contact
with the same number is 409 contact_already_exists (use the upsert to create-or-update).
Setting consent_granted: true records that the person consented to be called, with the time and
the API as its source. Only set it when they really did: when the workspace requires consent, it
is what allows calls to this contact.
POST /v1/contacts · Operation ID: createContact
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Create a contact › Request Body
phone_numberThe contact's number in E.164 format.
nameDisplay name.
languagePreferred language.
country_codeCountry code, for example IN.
consent_grantedSet to true only when the person has consented to be called. Recorded with the time and the API as its source.
Custom field values by field name. Each key must be a custom field defined in the console; an unknown name is 422 custom_field_not_found. Values are strings up to 500 characters. On update, a null value clears that field and omitted fields are left unchanged.
Create a contact › Responses
The contact was created.
id^ct_[A-Za-z0-9_-]{1,… · requiredContact id (ct_...).
objectAlways contact.
livemodetrue for a live contact, false for a test-mode contact.
phone_numberThe contact's number. E.164 for contacts created through this API; contacts created earlier in the console may hold the number in the format it was entered.
nameDisplay name.
languagePreferred language, as free text or a language code.
country_codeCountry code as entered, for example IN.
consent_grantedWhether the contact has consented to be called. When the workspace requires consent (a console compliance setting), calls to a contact without consent are refused. Setting this through the API records that consent was given; only set it when it really was. Consent is never recorded on a contact that is on the do-not-call list: it stays false there, and removing the entry does not restore it.
do_not_callTrue when the contact's number is on the do-not-call list. Read-only here: manage it with the do-not-call endpoints. Adding a number to the list also withdraws the contact's consent.
Values of the workspace's custom fields for this contact, by field name. Fields are defined in the console.
created_atWhen the contact was created. Null for some contacts created before this was recorded.
Create or update a contact by phone number
Creates the contact with this phone number, or updates it if one exists, in one request. The
number is matched the same way the do-not-call check matches numbers, so a contact entered
without the + and country code in the console is found too. Fields you omit are left unchanged
on an existing contact. The response is 201 when a contact was created and 200 when one was
updated. This is the recommended way to sync contacts from your CRM.
POST /v1/contacts/upsert · Operation ID: upsertContact
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Create or update a contact by phone number › Request Body
phone_numberThe contact's number in E.164 format. Identifies the contact.
nameDisplay name. Null clears it.
languagePreferred language. Null clears it.
country_codeCountry code. Null clears it.
consent_grantedSet to true only when the person has consented to be called; false records withdrawal. Omit to leave unchanged.
Custom field values by field name. Each key must be a custom field defined in the console; an unknown name is 422 custom_field_not_found. Values are strings up to 500 characters. On update, a null value clears that field and omitted fields are left unchanged.
Create or update a contact by phone number › Responses
An existing contact was updated.
id^ct_[A-Za-z0-9_-]{1,… · requiredContact id (ct_...).
objectAlways contact.
livemodetrue for a live contact, false for a test-mode contact.
phone_numberThe contact's number. E.164 for contacts created through this API; contacts created earlier in the console may hold the number in the format it was entered.
nameDisplay name.
languagePreferred language, as free text or a language code.
country_codeCountry code as entered, for example IN.
consent_grantedWhether the contact has consented to be called. When the workspace requires consent (a console compliance setting), calls to a contact without consent are refused. Setting this through the API records that consent was given; only set it when it really was. Consent is never recorded on a contact that is on the do-not-call list: it stays false there, and removing the entry does not restore it.
do_not_callTrue when the contact's number is on the do-not-call list. Read-only here: manage it with the do-not-call endpoints. Adding a number to the list also withdraws the contact's consent.
Values of the workspace's custom fields for this contact, by field name. Fields are defined in the console.
created_atWhen the contact was created. Null for some contacts created before this was recorded.
Retrieve a contact
Returns one contact, with its consent, do-not-call status and custom field values. The ETag header is the version to send as If-Match when you update it.
GET /v1/contacts/{contact_id} · Operation ID: getContact
path Parameters
contact_id^ct_[A-Za-z0-9_-]{1,… · requiredThe contact id (ct_...).
Retrieve a contact › Responses
The contact.
id^ct_[A-Za-z0-9_-]{1,… · requiredContact id (ct_...).
objectAlways contact.
livemodetrue for a live contact, false for a test-mode contact.
phone_numberThe contact's number. E.164 for contacts created through this API; contacts created earlier in the console may hold the number in the format it was entered.
nameDisplay name.
languagePreferred language, as free text or a language code.
country_codeCountry code as entered, for example IN.
consent_grantedWhether the contact has consented to be called. When the workspace requires consent (a console compliance setting), calls to a contact without consent are refused. Setting this through the API records that consent was given; only set it when it really was. Consent is never recorded on a contact that is on the do-not-call list: it stays false there, and removing the entry does not restore it.
do_not_callTrue when the contact's number is on the do-not-call list. Read-only here: manage it with the do-not-call endpoints. Adding a number to the list also withdraws the contact's consent.
Values of the workspace's custom fields for this contact, by field name. Fields are defined in the console.
created_atWhen the contact was created. Null for some contacts created before this was recorded.
Delete a contact
Permanently deletes a contact, its custom field values and its consent history, and removes it
from every campaign's recipient list (a campaign that has already started keeps calling the
recipients its run began with). Calls to the contact remain in the call list. A contact on
the do-not-call list cannot be deleted (409 contact_on_dnc_list), so a deletion never removes a
do-not-call protection.
DELETE /v1/contacts/{contact_id} · Operation ID: deleteContact
path Parameters
contact_id^ct_[A-Za-z0-9_-]{1,… · requiredThe contact id (ct_...).
Headers
Idempotency-Key^[\x21-\x7E]+$Optional. A unique key for this operation, 1 to 255 printable ASCII characters with no spaces (a UUID v4 is ideal). With it, a retry of the same request (same key, same body) returns the stored answer and never runs the action twice; reuse the same key for every retry, it is kept for 24 hours. Without it, every request runs: a retry after a timeout can repeat the action, so check the state with a GET before retrying.
Delete a contact › Responses
The contact was deleted.
idId of the deleted object.
objectType of the deleted object, for example contact.
livemodetrue for live mode, false for test mode.
deletedAlways true.
Update a contact
Changes the fields you send. custom_fields merges: listed fields are set, a null value clears a
field, omitted fields are kept. consent_granted records consent (true) or its withdrawal (false)
with the time and the API as source. The do-not-call status cannot be changed here; use the
do-not-call endpoints. Requires If-Match with the contact's current ETag.
PATCH /v1/contacts/{contact_id} · Operation ID: updateContact
path Parameters
contact_id^ct_[A-Za-z0-9_-]{1,… · requiredThe contact id (ct_...).
Headers
If-MatchThe ETag from your most recent read of this resource. The update is refused if the resource has changed since. * matches any current version: the update is applied without the concurrency check.
Update a contact › Request Body
phone_numberNew number in E.164 format. Must not belong to another contact.
nameDisplay name. Null clears it.
languagePreferred language. Null clears it.
country_codeCountry code. Null clears it.
consent_grantedTrue records that consent was given; false records that it was withdrawn.
Custom field values by field name. Each key must be a custom field defined in the console; an unknown name is 422 custom_field_not_found. Values are strings up to 500 characters. On update, a null value clears that field and omitted fields are left unchanged.
Update a contact › Responses
The updated contact, with its new ETag.
id^ct_[A-Za-z0-9_-]{1,… · requiredContact id (ct_...).
objectAlways contact.
livemodetrue for a live contact, false for a test-mode contact.
phone_numberThe contact's number. E.164 for contacts created through this API; contacts created earlier in the console may hold the number in the format it was entered.
nameDisplay name.
languagePreferred language, as free text or a language code.
country_codeCountry code as entered, for example IN.
consent_grantedWhether the contact has consented to be called. When the workspace requires consent (a console compliance setting), calls to a contact without consent are refused. Setting this through the API records that consent was given; only set it when it really was. Consent is never recorded on a contact that is on the do-not-call list: it stays false there, and removing the entry does not restore it.
do_not_callTrue when the contact's number is on the do-not-call list. Read-only here: manage it with the do-not-call endpoints. Adding a number to the list also withdraws the contact's consent.
Values of the workspace's custom fields for this contact, by field name. Fields are defined in the console.
created_atWhen the contact was created. Null for some contacts created before this was recorded.