/tokens (POST)
POST
/tokens
const url = 'https://example.com/api/v1/tokens';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","role":"owner","permissions":["messages:send"],"senders":["example"],"expiresAt":"2026-04-15T12:00:00Z"}'};
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://example.com/api/v1/tokens \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "role": "owner", "permissions": [ "messages:send" ], "senders": [ "example" ], "expiresAt": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
role
string
permissions
Array<string>
senders
Array<string>
expiresAt
string format: date-time
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
id
required
string format: uuid
name
required
string
role
required
string
permissions
required
Any of:
Array<string>
null
senders
required
Any of:
Array<string>
null
createdAt
required
string format: date-time
token
required
string
Example
{ "role": "owner", "permissions": [ "messages:send" ]}