> ## 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/wallet/:did/consents

> Grant consent for verifier access

```http theme={null}
POST /api/wallet/did:alyra:z6Mkf.../consents HTTP/1.1
Authorization: Bearer <jwt>
X-User-DID: did:alyra:z6Mkf...
Content-Type: application/json

{
  "verifier_did": "did:alyra:verifier...",
  "purpose": "employment_verification",
  "data_categories": ["full_name", "employment_status"],
  "access_level": "read_only",
  "expiration_policy": "fixed_date",
  "expires_at": "2026-12-31T23:59:59Z"
}
```

## Body

| Field               | Type      | Required | Description                                                                                          |
| ------------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `verifier_did`      | string    | Yes      | DID of the verifier receiving access.                                                                |
| `purpose`           | string    | Yes      | Purpose shown to the holder and stored with the consent record.                                      |
| `data_categories`   | string\[] | No       | Attributes or categories covered by the consent. Defaults to an empty list.                          |
| `access_level`      | enum      | No       | `read_only`, `read_write`, `full_access`, `one_time`, `write`, or `delete`. Defaults to `read_only`. |
| `expiration_policy` | enum      | No       | `fixed_date`, `one_time_use`, or `indefinite`. Defaults to `indefinite`.                             |
| `expires_at`        | string    | No       | ISO 8601 timestamp. Required when the selected policy uses a fixed date.                             |

## Response

`201 Created`

```json theme={null}
{
  "success": true,
  "consent": {
    "id": "consent-uuid",
    "holder_did": "did:alyra:z6Mkf...",
    "verifier_did": "did:alyra:verifier...",
    "purpose": "employment_verification",
    "data_categories": ["full_name", "employment_status"],
    "revoked": false,
    "expired": false,
    "on_chain": true
  }
}
```

Use `GET /api/wallet/:did/consents` to list consent records and `POST /api/wallet/:did/consents/:consent_id/revoke` to revoke access.
