Create an API token (the secret is shown once).
POST
/api/tokens
const url = 'https://app.agentic.figentra.com/api/tokens';const options = { method: 'POST', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"name":"example","permissions":["project.read"],"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://app.agentic.figentra.com/api/tokens \ --header 'Content-Type: application/json' \ --cookie session=<session> \ --data '{ "name": "example", "permissions": [ "project.read" ], "expiresAt": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
permissions
required
Array<string>
expiresAt
string format: date-time
Responses
Section titled “Responses”OK
Media typeapplication/json
object
token
required
object
id
required
string
organisationId
required
string
name
required
string
permissions
required
Array<string>
prefix
required
string
createdBy
required
string
createdAt
required
string format: date-time
secret
required
string
Example
{ "token": { "permissions": [ "project.read" ] }}default
Section titled “default”Error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "details": { "additionalProperty": "example" } }}