> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transparencyhubnetwork.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How to authenticate with the Transparency Hub Network API.

## JWT Authentication

All API requests require a valid JWT token in the `Authorization` header:

```bash theme={null}
Authorization: Bearer <your-jwt-token>
```

## Obtaining a Token

```bash theme={null}
POST /auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "your-password",
  "otp": "123456"
}
```

**Response:**

```json theme={null}
{
  "status": "success",
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIs...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIs...",
    "expires_in": 3600
  }
}
```

## Token Refresh

```bash theme={null}
POST /auth/refresh
Content-Type: application/json

{
  "refresh_token": "eyJhbGciOiJIUzI1NiIs..."
}
```

## Token Expiry

* **Access tokens** expire after 1 hour
* **Refresh tokens** expire after 7 days

<Warning>
  Never expose your tokens in client-side code or public repositories. Store them securely.
</Warning>
