Create Workspace API Token
curl --request POST \
--url http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": []
}
'import requests
url = "http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens"
payload = {
"name": "<string>",
"scopes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: []})
};
fetch('http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"apiToken": {
"id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"tokenPrefix": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"workspace:read"
],
"token": "<string>"
}
}Workspace API Tokens
Create API Token
Create a workspace API token.
POST
/
v3
/
workspaces
/
{workspaceId}
/
api-tokens
Create Workspace API Token
curl --request POST \
--url http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": []
}
'import requests
url = "http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens"
payload = {
"name": "<string>",
"scopes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: []})
};
fetch('http://127.0.0.1:3333/v3/workspaces/{workspaceId}/api-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"apiToken": {
"id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"tokenPrefix": "<string>",
"lastUsedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"scopes": [
"workspace:read"
],
"token": "<string>"
}
}Authorizations
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Required string length:
1 - 255Required array length:
1 - 20 elementsAvailable options:
workspace:read, bots:read, bots:write, sessions:read, sessions:write, results:read, results:write, webhooks:read, webhooks:write, billing:read, integrations:read, integrations:write Required range:
1 <= x <= 365Response
201 - application/json
Default Response
Show child attributes
Show child attributes