> ## 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/register

> Register a user DID and public key

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

{
  "did": "did:alyra:z6Mkf...",
  "public_key": "base64-or-multibase-public-key",
  "name": "Alice",
  "email": "alice@example.com"
}
```

## Body

| Field        | Type   | Required | Description                         |
| ------------ | ------ | -------- | ----------------------------------- |
| `did`        | string | Yes      | User DID.                           |
| `public_key` | string | Yes      | Public key associated with the DID. |
| `name`       | string | No       | Display name.                       |
| `email`      | string | No       | Contact email.                      |

## Response

`201 Created`

```json theme={null}
{
  "success": true,
  "message": "User registered successfully",
  "user": {
    "did": "did:alyra:z6Mkf...",
    "public_key": "base64-or-multibase-public-key",
    "name": "Alice",
    "email": "alice@example.com",
    "created_at": "2026-06-27T00:00:00Z",
    "updated_at": "2026-06-27T00:00:00Z"
  }
}
```

<Note>
  The backend struct for this endpoint is `RegisterRequest { did, public_key, name, email }`. Dilithium key hashes are not accepted by this route.
</Note>
