Raad Guides

Authentication

3 endpoints

Overview

The Raad API uses JWT (JSON Web Tokens) for authentication. Obtain a token by signing in with your email and password, then include the token as a Bearer token in the Authorization header of subsequent requests. Tokens expire after 24 hours.

POST /api/v1/auth/sign_in

Authenticate and obtain a JWT token.

Request Body

JSON
{
  "email": "user@example.com",
  "password": "your_password"
}

Responses

200 Authentication successful
Response
{
  "token": "eyJhbGciOiJIUzI1NiJ9...",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "user@example.com",
    "name": "Jane Smith"
  },
  "profiles": {
    "client": [{ "id": "...", "name": "Acme Corp", "role": "client" }]
  },
  "expires_at": 1709683200
}
401 Invalid email or password

DELETE /api/v1/auth/sign_out Requires Auth

Sign out and invalidate the current token.

Responses

200 Successfully signed out
Response
{
  "message": "Signed out successfully"
}
401 Unauthorized

GET /api/v1/auth/user Requires Auth

Returns the currently authenticated user.

Responses

200 Current user information
Response
{
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "user@example.com",
    "name": "Jane Smith"
  }
}
401 Unauthorized