Update preferences
curl --request PUT \
--url https://api.sortx.co.uk/contacts/{id}/preferences \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"preferredChannel": "<string>",
"doNotContact": {
"set": true,
"reason": "<string>",
"source": "<string>"
},
"permissions": [
{
"channel": "<string>",
"purpose": "<string>",
"status": "<string>",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
preferredChannel: '<string>',
doNotContact: {set: true, reason: '<string>', source: '<string>'},
permissions: [
{
channel: '<string>',
purpose: '<string>',
status: '<string>',
source: '<string>',
evidence: '<string>',
givenAt: '<string>'
}
]
})
};
fetch('https://api.sortx.co.uk/contacts/{id}/preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/contacts/{id}/preferences"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"preferredChannel": "<string>",
"doNotContact": {
"set": True,
"reason": "<string>",
"source": "<string>"
},
"permissions": [
{
"channel": "<string>",
"purpose": "<string>",
"status": "<string>",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"contactId": "<string>",
"preferredChannel": "email",
"doNotContact": true,
"doNotContactReason": "<string>",
"doNotContactSource": "<string>",
"doNotContactAt": "<string>",
"doNotContactBy": {
"kind": "user",
"userId": "<string>"
},
"permissions": [
{
"channel": "email",
"purpose": "service",
"status": "unknown",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>",
"recordedAt": "<string>",
"recordedBy": {
"kind": "user",
"userId": "<string>"
}
}
],
"revision": 123,
"updatedAt": "<string>"
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}contacts
Update preferences
Record consent, refusal, do-not-contact or a preferred channel at the revision read
PUT
/
contacts
/
{id}
/
preferences
Update preferences
curl --request PUT \
--url https://api.sortx.co.uk/contacts/{id}/preferences \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"requestId": "<string>",
"expectedRevision": 123,
"preferredChannel": "<string>",
"doNotContact": {
"set": true,
"reason": "<string>",
"source": "<string>"
},
"permissions": [
{
"channel": "<string>",
"purpose": "<string>",
"status": "<string>",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
expectedRevision: 123,
preferredChannel: '<string>',
doNotContact: {set: true, reason: '<string>', source: '<string>'},
permissions: [
{
channel: '<string>',
purpose: '<string>',
status: '<string>',
source: '<string>',
evidence: '<string>',
givenAt: '<string>'
}
]
})
};
fetch('https://api.sortx.co.uk/contacts/{id}/preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/contacts/{id}/preferences"
payload = {
"requestId": "<string>",
"expectedRevision": 123,
"preferredChannel": "<string>",
"doNotContact": {
"set": True,
"reason": "<string>",
"source": "<string>"
},
"permissions": [
{
"channel": "<string>",
"purpose": "<string>",
"status": "<string>",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"contactId": "<string>",
"preferredChannel": "email",
"doNotContact": true,
"doNotContactReason": "<string>",
"doNotContactSource": "<string>",
"doNotContactAt": "<string>",
"doNotContactBy": {
"kind": "user",
"userId": "<string>"
},
"permissions": [
{
"channel": "email",
"purpose": "service",
"status": "unknown",
"source": "<string>",
"evidence": "<string>",
"givenAt": "<string>",
"recordedAt": "<string>",
"recordedBy": {
"kind": "user",
"userId": "<string>"
}
}
],
"revision": 123,
"updatedAt": "<string>"
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}Authorizations
A workspace API key (Settings → API keys), scoped to <group>:read / <group>:write.
Path Parameters
Body
application/json
Response
Success
Available options:
email, sms, whatsapp, phone, post - Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes