Register

Create a new account.
POST /auth/register

Request Body

email
string
required
Valid email address
password
string
required
Password (minimum 8 characters)
organization_name
string
required
Name for your organization

Example Request

curl -X POST https://api.agentwarden.io/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword123",
    "organization_name": "My Company"
  }'

Response

Status: 200 OK
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "user": {
    "id": "user_123",
    "email": "user@example.com",
    "organization_id": "org_456"
  }
}

Errors

400 Bad Request - Email already exists
{
  "detail": "Email already registered"
}

Login

Authenticate and get access token.
POST /auth/login

Request Body

email
string
required
Your email address
password
string
required
Your password

Example Request

curl -X POST https://api.agentwarden.io/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword123"
  }'

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "user": {
    "id": "user_123",
    "email": "user@example.com",
    "organization_id": "org_456"
  }
}
Token Expiration: 7 days

Using the Token

Include in Authorization header for all authenticated requests:
curl https://api.agentwarden.io/api/agents \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Errors

401 Unauthorized - Invalid credentials
{
  "detail": "Invalid email or password"
}

Get Current User

Get information about the authenticated user.
GET /auth/me

Authentication

Authorization
string
required
Bearer token from login

Response

{
  "id": "user_123",
  "email": "user@example.com",
  "organization_id": "org_456",
  "created_at": "2024-01-15T10:00:00Z"
}