Skip to main content
POST
/
api
/
v1
/
web-integrations
/
{integrationId}
/
tokens
Generate a new API token for web integration access
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: '<string>', expiresAt: '2023-11-07T05:31:56Z'})
};

fetch('https://blackbox.dasha.ai/api/v1/web-integrations/{integrationId}/tokens', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "tokenId": "<string>",
  "token": "<string>",
  "name": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Path Parameters

integrationId
string
required

UUID of the integration to add the token to

Body

Token creation parameters including name and optional expiration

name
string
required
Minimum string length: 1
expiresAt
string<date-time> | null

Response

Returns the created token details

tokenId
string
required
Minimum string length: 1
token
string
required
Minimum string length: 1
name
string
required
Minimum string length: 1
createdAt
string<date-time>
required
expiresAt
string<date-time> | null