ts.auth.login

Authenticate with email and password to get an access token.

Authenticate with email and password to get an access token.

Description

Authenticates a user with their email and password credentials. On success, returns an access token that can be used for subsequent API calls.

The token should be included in the Authorization header as a Bearer token: Authorization: Bearer

Tokens are single-use session tokens by default. For long-lived API tokens, use ts.tkn.create after authentication.

Parameters

NameTypeRequiredDefaultDescription
emailstringYesUser’s email address
passwordstringYesUser’s password

Response

Returns a session token and user information on success.

{
  "expires_at": "2026-02-05T10:30:00Z",
  "token": "ts_abc123def456...",
  "user_id": "usr_01H8X9..."
}

Errors

CodeDescription
invalid_inputEmail and password are required
rate_limitedToo many login attempts
invalid_credentialsEmail or password is incorrect

Examples

Basic login

Authenticate to get a session token.

Request:

{
  "email": "agent@example.com",
  "password": "SecurePassword123!"
}

Response:

{
  "expires_at": "2026-02-05T10:30:00Z",
  "token": "ts_abc123def456...",
  "user_id": "usr_01H8X9ABCDEF"
}