Bulk-upsert preference cells for a user
PUT
/v1/preferences/users/{externalUserId}
const url = 'https://your-notavia-host/v1/preferences/users/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"preferences":[{"category_key":"example","channel":"email","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 PUT \ --url https://your-notavia-host/v1/preferences/users/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "preferences": [ { "category_key": "example", "channel": "email", "opted_in": true } ] }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” externalUserId
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
preferences
required
Array<object>
object
category_key
required
string
channel
required
Notification channel identifier.
string
opted_in
required
boolean
Responses
Section titled “ Responses ”Updated preferences.
Media type application/json
object
data
Array<object>
object
category_key
string
channel
Notification channel identifier.
string
opted_in
boolean
Example
{ "data": [ { "channel": "email" } ]}Validation or request error.
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" }}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" }}