Create a PAT — the token is shown ONCE in this response
POST
/api/v1/me/tokens
const url = 'https://example.com/api/v1/me/tokens';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","workspace_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","scope":"read","allow_run_button":true,"agent_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","resource_scope":{"space_ids":[],"database_ids":[]}}'};
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/me/tokens \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scope": "read", "allow_run_button": true, "agent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "resource_scope": { "space_ids": [], "database_ids": [] } }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
workspace_id
required
string format: uuid
scope
string
allow_run_button
boolean
agent_id
string format: uuid
resource_scope
object
space_ids
Array<string>
database_ids
Array<string>