> ## 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/verify-challenge

> Verify a DID challenge and issue a JWT

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

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

## Challenge Flow

1. Call `POST /api/auth/challenge` with `{ "did": "did:alyra:..." }`.
2. Sign the returned `challenge` with the local wallet key.
3. Submit `did`, `challenge`, and `signature` to this endpoint.
4. Store the returned JWT for authenticated API calls.

## Response

`200 OK`

```json theme={null}
{
  "success": true,
  "message": "Challenge verified successfully",
  "user": {
    "did": "did:alyra:z6Mkf...",
    "public_key": "base64-or-multibase-public-key"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

## Related Endpoint

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

{
  "did": "did:alyra:z6Mkf..."
}
```

Returns:

```json theme={null}
{
  "success": true,
  "challenge": "nonce-from-server",
  "expires_at": "2026-06-27T00:05:00Z"
}
```
