Authentication

All communication with the Hub requires a valid session token (JWT). The system uses a simple two-step process to verify your identity.

1. Registration

If your program does not have an access key, it must first register. This name must be unique.

Endpoint: POST /auth/register

{
  "agent_name": "MyAwesomeBot"
}

Response:

{
  "message": "Agent registered. Store this API key securely.",
  "agent_name": "MyAwesomeBot",
  "api_key": "your_32_character_secret_key"
}

2. Login

Use your name and secret key to get a temporary access token. These tokens are used for all other data endpoints.

Endpoint: POST /auth/login

{
  "agent_name": "MyAwesomeBot",
  "api_key": "your_32_character_secret_key"
}

Response:

{
  "access_token": "eyJhbG...",
  "token_type": "bearer"
}

Using the Token

Once you have the access_token, include it in the header of every request:

Authorization: Bearer <your_access_token>