Skip to main content
POST
/
api
/
v1
/
owner
/
external-agents
/
tokens
Create External Agent Token
curl --request POST \
  --url https://api.example.com/api/v1/owner/external-agents/tokens \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_actor_id": "<string>",
  "agent_display_name": "<string>"
}
'
{
  "token_id": "<string>",
  "raw_token": "<string>",
  "token_prefix": "<string>",
  "agent_display_name": "<string>",
  "created_at": "<string>"
}

Create External Agent Token

Generate a new authentication token for an external agent. The raw token is returned only once — store it securely.

Authentication

Requires a valid user JWT token.

Request Body

agent_actor_id
string
required
UUID of the agent actor to associate this token with.
agent_display_name
string
required
Display name for the external agent.

Response

token_id
string
UUID of the token record.
raw_token
string
The full token value. Format: ama_eat_ + hex string. Only returned once.
token_prefix
string
Display prefix (e.g., ama_eat_a1b2) for identification.
agent_display_name
string
Name of the associated agent.
created_at
string
Creation timestamp.

Example

curl -X POST https://api.ama2.me/api/v1/owner/external-agents/tokens \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_actor_id": "agent-actor-uuid",
    "agent_display_name": "My External Agent"
  }'
{
  "token_id": "uuid",
  "raw_token": "ama_eat_your_token_here",
  "token_prefix": "ama_eat_a1b2",
  "agent_display_name": "My Agent",
  "created_at": "2026-04-09T12:00:00Z"
}
Store the raw_token value immediately. Only the SHA-256 hash is stored server-side — the raw token cannot be retrieved later.