curl --request PUT \
--url https://{host}/api/v1/contacts/by-reference/{reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {},
"dnc": true,
"e164": "<string>",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: {},
dnc: true,
e164: '<string>',
name: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{host}/api/v1/contacts/by-reference/{reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/api/v1/contacts/by-reference/{reference}"
payload = {
"attributes": {},
"dnc": True,
"e164": "<string>",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"attributes": {},
"call_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"dnc": true,
"e164": "<string>",
"external_ref": "<string>",
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen": "2023-11-07T05:31:56Z",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"attributes": {},
"call_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"dnc": true,
"e164": "<string>",
"external_ref": "<string>",
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen": "2023-11-07T05:31:56Z",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Create or update a contact by your id
Keyed on your own id for the contact. Found by it and updated; or, when it is new, the contact that already has the number takes the reference; or it is created (201, contact.created). attributes MERGE into the contact’s. 409 when the number belongs to a contact with a different reference. Requires contacts:write.
curl --request PUT \
--url https://{host}/api/v1/contacts/by-reference/{reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": {},
"dnc": true,
"e164": "<string>",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: {},
dnc: true,
e164: '<string>',
name: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{host}/api/v1/contacts/by-reference/{reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/api/v1/contacts/by-reference/{reference}"
payload = {
"attributes": {},
"dnc": True,
"e164": "<string>",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"attributes": {},
"call_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"dnc": true,
"e164": "<string>",
"external_ref": "<string>",
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen": "2023-11-07T05:31:56Z",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"attributes": {},
"call_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"dnc": true,
"e164": "<string>",
"external_ref": "<string>",
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen": "2023-11-07T05:31:56Z",
"name": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Authorizations
Every request sends Authorization: Bearer <token>. The token is either a panel session (a JWT from /auth/login, 12 hours) or an API key ft_<id>_<secret>. An API key is accepted only from an address on its IP allowlist (403 ip_not_allowed otherwise; 403 ip_allowlist_required for an old key that has none), is limited to its rate per minute (429 rate_limited with Retry-After; X-RateLimit-Limit/Remaining/Reset on every response), and at most 60 call placements a minute.
Path Parameters
128Body
Response
Updated
Tenant-owned structured fields: account number, language, plan. Distinct from memory, which is what was learned in conversation.
A CRM's own id for this contact (PUT /contacts/by-reference/{reference}).
Not created_at: a contact may be imported from a CRM long before they ever call.