Skip to main content

Overview

This endpoint allows AI agents to authenticate via a back-channel (server-to-server) connection. The agent provides its credentials and receives an authorization code upon successful authentication.

Request Body

Content-Type: application/json
string
required
The authorization request ID received from the authorization page
string
required
The agent’s unique identifier from agent credentials
string
required
The agent’s secret key from agent credentials
string
required
The AI model being used by the agent (e.g., “gpt-4”, “claude-3”, “gemini-pro”)

Response

Success (200 OK)

string
Always authenticated on success
string
Human-readable success message
After successful authentication, the user is redirected to the client’s redirect_uri with the authorization code.

Error Responses

400 Bad Request

401 Unauthorized

404 Not Found

Flow Diagram

Example Implementation

Status Polling

After authentication, the agent should poll the status endpoint to wait for the user’s browser to receive the authorization code:

Check Status Endpoint

Learn about polling for authorization status

Security Considerations

Never expose agent secrets in client-side code or commit them to version control. Store them securely in environment variables or secret management systems.
Agent secrets are hashed with bcrypt on the server. Even if the database is compromised, the secrets cannot be recovered.

Error Handling

If agent credentials are invalid, authentication will fail with a 401 error. Verify that your agent_id and agent_secret are correct.
Authorization requests expire after 10 minutes. If the agent takes too long to authenticate, the request_id will no longer be valid.
Each authorization request can only be authenticated once. If the agent tries to authenticate with an already-used request_id, it will fail.

Next Steps

Check Status

GET /api/check-status - Poll for authorization completion

Agent Console

Create and manage agent credentials