Consumer Mandates
Generated HTTP reference for the 2 operations the published OpenAPI document describes under consumer-mandates.
Consumer Mandates
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
The {id} here is a consumer mandate id (the rows GET /v1/mandates lists). These two operations read and remove the card binding of a mandate: a card minted for an agent spends under the same caps, allowlist and expiry the mandate carries. Binding a card (POST on the same path) exists in the code and is not in this document; see the concept page, Mandates, receipts and approvals, for where each operation is exposed today and the Wallets reference for spending under a mandate by id.
Every operation, from the spec
Generated from the published OpenAPI document, so it never drifts from what the API actually serves. The section above is written by hand and carries what a schema cannot: the object model, field rules, and the order to call things in.
GET /v1/consumers/mandates/{id}/card
https://api.codespar.dev/v1/consumers/mandates/{id}/cardThe card bound to a mandate, and its recent authorizations
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The mandate id. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Authorizations to return. Default 20, clamped to the range 1 to 100. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | No such mandate for this organization. A mandate another organization holds answers the same way. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
authorizations | array of object | yes | Newest first. Empty when no card is bound. |
card | object,null | yes | Null when the mandate exists and has no active card binding. |
mandate_id | string | yes | — |
curl -X GET https://api.codespar.dev/v1/consumers/mandates/{id}/card \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/mandates/{id}/card", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.get("/v1/consumers/mandates/{id}/card", {
path: {
id: "mandate_0000000000000000"
}
});{
"mandate_id": "mandate_0000000000000000",
"card": {
"card_id": "card_0000000000000000",
"consumer_id": "csm_0000000000000000",
"status": "string",
"bound_at": "2026-01-15T12:00:00.000Z"
},
"authorizations": [
{
"transaction_id": "transaction_0000000000000000",
"amount_minor": "1000",
"currency": "BRL",
"decision": "string",
"at": "2026-01-15T12:00:00.000Z"
}
]
}DELETE /v1/consumers/mandates/{id}/card
https://api.codespar.dev/v1/consumers/mandates/{id}/cardUnbind the card from a mandate
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The mandate id. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | mandate_not_found: no such mandate for this organization, which is also the answer for another organization's mandate. no_active_card: the mandate exists and has no active card binding to revoke. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
card_id | string | yes | — |
mandate_id | string | yes | — |
revoked | true | yes | — |
curl -X DELETE https://api.codespar.dev/v1/consumers/mandates/{id}/card \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/mandates/{id}/card", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.delete("/v1/consumers/mandates/{id}/card", {
path: {
id: "mandate_0000000000000000"
}
});{
"mandate_id": "mandate_0000000000000000",
"card_id": "card_0000000000000000",
"revoked": true
}