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

# POST /api/auth/login

> Login with a DID challenge signature

```http theme={null}
POST /api/auth/login HTTP/1.1
Content-Type: application/json

{
  "did": "did:alyra:z6Mkf...",
  "challenge": "nonce-from-challenge-endpoint",
  "signature": "base64EncodedEd25519Signature"
}
```

## Body

| Field       | Type   | Required | Description                                       |
| ----------- | ------ | -------- | ------------------------------------------------- |
| `did`       | string | Yes      | DID being authenticated.                          |
| `challenge` | string | Yes      | Challenge returned by `POST /api/auth/challenge`. |
| `signature` | string | Yes      | Signature over the challenge using the DID key.   |

## Response

`200 OK`

```json theme={null}
{
  "success": true,
  "message": "Login successful",
  "user": {
    "did": "did:alyra:z6Mkf...",
    "public_key": "base64-or-multibase-public-key",
    "name": "Alice",
    "email": "alice@example.com"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

Use the returned token as `Authorization: Bearer <token>` for subsequent calls.
