Overview
POST
/persona/personas/{id}/tokensregistryMint a scoped API token that lets the persona act (raw value shown once)
Create a record in tokens.
Auth: bearerAuth — calls run as the authenticated user.
Parameters
- idpathstring
Request body
application/json · optional
- subjectobject
- nameoptionalstring
- expiresAtoptionalstring?
Omitted/null defaults to a bounded 90-day TTL (never a non-expiring token); an explicit value is honored.
Example
{
"subject": {
"kind": "self",
"id": "string",
"ecosystemId": "string"
},
"name": "string",
"expiresAt": "2020-01-01T00:00:00.000Z"
}Responses
201
the minted token metadata + its raw value (shown once)
- idstring
- namestring
- prefixstring
Non-secret leading chars, for display
- createdAtstring
- expiresAtstring?
- lastUsedAtstring?
null until the token first authenticates
- personaIdstring?
The persona this token authenticates AS
- tokenstring
The raw token value — shown exactly once, on mint
Example
{
"id": "string",
"name": "string",
"prefix": "string",
"createdAt": "string",
"expiresAt": "string",
"lastUsedAt": "string",
"personaId": "string",
"token": "string"
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}403
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}404
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}409
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/persona/personas/{id}/tokens" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subject": {
"kind": "self",
"id": "string",
"ecosystemId": "string"
},
"name": "string",
"expiresAt": "2020-01-01T00:00:00.000Z"
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/persona/personas/{id}/tokens", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"subject\": {\n \"kind\": \"self\",\n \"id\": \"string\",\n \"ecosystemId\": \"string\"\n },\n \"name\": \"string\",\n \"expiresAt\": \"2020-01-01T00:00:00.000Z\"\n}",
});
const data = await res.json();