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
{
"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
}
}
GET /api/wallet/:did/consents to list consent records and POST /api/wallet/:did/consents/:consent_id/revoke to revoke access.