Set a single preference cell for a user
PATCH
/v1/preferences/users/{externalUserId}/{categoryKey}/{channel}
const url = 'https://your-notavia-host/v1/preferences/users/example/example/email';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"opted_in":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://your-notavia-host/v1/preferences/users/example/example/email \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "opted_in": true }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” externalUserId
required
string
categoryKey
required
string
channel
required
Kebab-case channel identifier used in URL path segments and template body keys.
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
opted_in
required
boolean
Example generated
{ "opted_in": true}Responses
Section titled “ Responses ”Updated preference cell.
Missing or invalid credentials.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Resource not found.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Conflict (e.g. duplicate key, idempotency collision).
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}