Create a notification category
POST
/v1/preferences/categories
const url = 'https://your-notavia-host/v1/preferences/categories';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example","name":"example","description":"example","is_critical":false,"default_channels":["email"],"default_opt_in":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-notavia-host/v1/preferences/categories \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "name": "example", "description": "example", "is_critical": false, "default_channels": [ "email" ], "default_opt_in": true }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
key
required
string
name
required
string
description
string
is_critical
boolean
default_channels
required
Array<string>
default_opt_in
boolean
Responses
Section titled “ Responses ”Category created.
Media type application/json
object
id
string format: uuid
key
string
name
string
description
string
is_critical
boolean
default_channels
Array<string>
default_opt_in
boolean
is_archived
boolean
Example
{ "default_channels": [ "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" }}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" }}