Update Contact Variables
Merge variables into a contact’s and/or its account’s variables.
Upsert semantics: provided keys are written, other keys are kept. If the contact’s company is not yet linked to your organization, the account is created so the account variables can be stored.
Each scope holds at most 200 variables. A null value clears the variable but keeps the key counting toward the limit; use the DELETE endpoint to remove a key and free its slot.
Account variables can also be managed directly through
/v1/accounts/{account_id}/variables.
Requires the contacts:write scope on the API key.
PATCH
/
v1
/
contacts
/
{contact_id}
/
variables
Update Contact Variables
curl --request PATCH \
--url https://api.topo.io/v1/contacts/{contact_id}/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_variables": {},
"account_variables": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_variables: {}, account_variables: {}})
};
fetch('https://api.topo.io/v1/contacts/{contact_id}/variables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.topo.io/v1/contacts/{contact_id}/variables"
payload = {
"contact_variables": {},
"account_variables": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"contact_variables": {},
"account_variables": {}
}Authorizations
Bearer API key issued from Settings → Developers.
Path Parameters
ID of the contact.
Body
application/json
Update Contact Variables payload
Response
200 - application/json
Successful Response
Was this page helpful?
⌘I
Update Contact Variables
curl --request PATCH \
--url https://api.topo.io/v1/contacts/{contact_id}/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_variables": {},
"account_variables": {}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_variables: {}, account_variables: {}})
};
fetch('https://api.topo.io/v1/contacts/{contact_id}/variables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.topo.io/v1/contacts/{contact_id}/variables"
payload = {
"contact_variables": {},
"account_variables": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"contact_variables": {},
"account_variables": {}
}