Skip to main content
Exchange your email and password for a short-lived access token and a long-lived refresh token. Use the access token to authenticate subsequent API requests. Endpoint: POST https://api.agentity.to/auth/token

Request

Authorization
string
required
Basic Auth credentials encoded as Basic base64(email:password).

Response

A successful request returns 200 OK with both tokens.
accessToken
string
required
A short-lived JWT. Include this in the Authorization header as Bearer <accessToken> for all authenticated requests.
refreshToken
string
required
A long-lived token. Use it with the Refresh Token endpoint to obtain a new access token when the current one expires.
Pass the accessToken as Authorization: Bearer <accessToken> on all subsequent requests that require authentication.

Errors

StatusDescription
401Invalid email or password.
curl -X POST https://api.agentity.to/auth/token \
  -H "Authorization: Basic $(echo -n 'you@example.com:yourpassword' | base64)"
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."
}