Mandates API
Signed human instructions a payment must fit, such as flights to SF under $600 by Friday.
Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.
Create a mandate#
/v2/mandatesRecord a signed human instruction. Payments for this agent must fit it or they are held.
- agent_idIdrequired
- instructionstringrequired
- constraintsobjectrequired
7 fields
- counterparty_patternstring
- counterparty_namesstring[]
- categoriesstring[]
- minMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumberrequired
- assetAssetCoderequired
"USD""USDC""EUR""GBP"
- maxMoneyrequired
An amount: integer minor units + asset.
Money: 2 fields
- amountnumberrequired
- assetAssetCoderequired
"USD""USDC""EUR""GBP"
- railsRail[]
"card""network_token""checkout_token""stablecoin""bank""ai""cloud" - recurrencestring enum
"none""weekly""monthly"
- expires_atTimestamp | null
- max_usesnumber | null
- standingboolean
- passkey_assertionstring
The signer's passkey assertion (WebAuthn). Required to create; the demo accepts any non-empty string.
- idId
- object"mandate"
- org_idId
- created_atTimestamp
- updated_atTimestampoptional
- test_modebooleanoptional
True for test-mode objects (simulations, sandbox).
- agentRef
Small reference used for denormalized names in lists (no N+1 lookups in tables).
Ref: 2 fields
- idId
- namestring
- created_byRef
Small reference used for denormalized names in lists (no N+1 lookups in tables).
Ref: 2 fields
- idId
- namestring
- instructionstring
The human's words, as typed.
- constraintsobject
7 fields
- counterparty_patternstringoptional
- counterparty_namesstring[]optional
- categoriesstring[]optional
- minMoneyoptional
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- maxMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- railsRail[]optional
"card""network_token""checkout_token""stablecoin""bank""ai""cloud" - recurrencestring enumoptional
"none""weekly""monthly"
- valid_fromTimestamp
- expires_atTimestamp | null
- max_usesnumber | null
- usesnumber
- statusMandateStatus
"active""draft""revoked""expired""used" - signatureobject | null
4 fields
- kidstring
- algstring enum
"ES256""ed25519" - signed_atTimestamp
- assurancestring enum
"passkey""device"
- standingboolean
Standing instructions recur with no human present.
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/mandates" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
"instruction": "Flights to SF under $600, by Friday",
"constraints": {
"counterparty_pattern": "airline",
"categories": [
"Airlines"
],
"max": {
"amount": 60000,
"asset": "USD"
},
"min": {
"amount": 0,
"asset": "USD"
}
},
"max_uses": 1,
"passkey_assertion": "passkey_assertion_from_webauthn"
}'{
"id": "mdt_01M82XPRNBG55W6BEABHD2BNR6",
"object": "mandate",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-23T00:43:13.451Z",
"agent": {
"id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
"name": "Cloud cost guard"
},
"created_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "You"
},
"instruction": "Flights to SF under $600, by Friday",
"constraints": {
"counterparty_pattern": "airline",
"categories": [
"Airlines"
],
"max": {
"amount": 60000,
"asset": "USD"
},
"min": {
"amount": 0,
"asset": "USD"
}
},
"valid_from": "2026-11-23T00:43:13.451Z",
"expires_at": null,
"max_uses": 1,
"uses": 0,
"status": "active",
"signature": {
"kid": "passkey-c4619047",
"alg": "ES256",
"signed_at": "2026-11-23T00:43:13.451Z",
"assurance": "passkey"
},
"standing": false
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
List mandates#
/v2/mandates- agent_idId
- statusstring enum
"active""draft""revoked""expired""used" - standingboolean
- cursorstring
- limitnumber
1–200, default 50.
- qstring
Free-text search over names, ids and descriptors.
- sortstring
Sort field, prefix "-" for descending ("-created_at" is the default).
- created_gteTimestamp
created_at >= (ISO).
- created_lteTimestamp
created_at <= (ISO).
Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:
The same Mandate object as Create a mandate.
- 400invalid_request
A query parameter is invalid.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/mandates?limit=2" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"object": "list",
"data": [
{
"id": "mdt_01M80B9ZMEBPQ8FNPXAENWXAXV",
"object": "mandate",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-22T00:43:11.374Z",
"agent": {
"id": "agt_01KR356VCEP0FG7CVSJRS0QD2V",
"name": "Data buyer"
},
"created_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"instruction": "Buy the Q3 retail foot-traffic dataset, up to $1,500.",
"constraints": {
"counterparty_names": [
"Corpus Labs",
"OpenData Exchange"
],
"categories": [
"Datasets"
],
"max": {
"amount": 150000,
"asset": "USD"
},
"rails": [
"checkout_token",
"stablecoin"
],
"recurrence": "none"
},
"valid_from": "2026-11-22T00:43:11.374Z",
"expires_at": "2026-12-12T00:43:11.374Z",
"max_uses": 3,
"uses": 1,
"status": "active",
"signature": {
"kid": "passkey-c4619047",
"alg": "ES256",
"signed_at": "2026-11-22T00:45:11.374Z",
"assurance": "passkey"
},
"standing": false
},
{
"id": "mdt_01M80B9ZMEQZ43ER3M2JD5J1ZM",
"object": "mandate",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-22T00:43:11.374Z",
"agent": {
"id": "agt_01KTGQE08EZ4VT9QRAZH131H64",
"name": "Hotel booker"
},
"created_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"instruction": "Hotel near Moscone for 2 nights, under $450 a night.",
"constraints": {
"counterparty_names": [
"Marriott",
"Hilton"
],
"categories": [
"Hotels"
],
"max": {
"amount": 90000,
"asset": "USD"
},
"rails": [
"network_token",
"card"
],
"recurrence": "none"
},
"valid_from": "2026-11-22T00:43:11.374Z",
"expires_at": "2026-12-01T00:43:11.374Z",
"max_uses": 1,
"uses": 0,
"status": "active",
"signature": {
"kid": "passkey-c4619047",
"alg": "ES256",
"signed_at": "2026-11-22T00:45:11.374Z",
"assurance": "passkey"
},
"standing": false
}
],
"has_more": true,
"next_cursor": "Mg==",
"total": 21
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Retrieve a mandate#
/v2/mandates/{id}- idIdrequired
A prefixed ID from this org.
The same Mandate object as Create a mandate.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/mandates/mdt_01M80B9ZMEBPQ8FNPXAENWXAXV" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"id": "mdt_01M80B9ZMEBPQ8FNPXAENWXAXV",
"object": "mandate",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-22T00:43:11.374Z",
"agent": {
"id": "agt_01KR356VCEP0FG7CVSJRS0QD2V",
"name": "Data buyer"
},
"created_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"instruction": "Buy the Q3 retail foot-traffic dataset, up to $1,500.",
"constraints": {
"counterparty_names": [
"Corpus Labs",
"OpenData Exchange"
],
"categories": [
"Datasets"
],
"max": {
"amount": 150000,
"asset": "USD"
},
"rails": [
"checkout_token",
"stablecoin"
],
"recurrence": "none"
},
"valid_from": "2026-11-22T00:43:11.374Z",
"expires_at": "2026-12-12T00:43:11.374Z",
"max_uses": 3,
"uses": 1,
"status": "active",
"signature": {
"kid": "passkey-c4619047",
"alg": "ES256",
"signed_at": "2026-11-22T00:45:11.374Z",
"assurance": "passkey"
},
"standing": false
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Revoke a mandate#
/v2/mandates/{id}/revoke- idIdrequired
A prefixed ID from this org.
- reasonstring
The same Mandate object as Create a mandate.
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/mandates/mdt_01M82XPRNBG55W6BEABHD2BNR6/revoke" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "mdt_01M82XPRNBG55W6BEABHD2BNR6",
"object": "mandate",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-23T00:43:13.451Z",
"agent": {
"id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
"name": "Cloud cost guard"
},
"created_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "You"
},
"instruction": "Flights to SF under $600, by Friday",
"constraints": {
"counterparty_pattern": "airline",
"categories": [
"Airlines"
],
"max": {
"amount": 60000,
"asset": "USD"
},
"min": {
"amount": 0,
"asset": "USD"
}
},
"valid_from": "2026-11-23T00:43:13.451Z",
"expires_at": null,
"max_uses": 1,
"uses": 0,
"status": "revoked",
"signature": {
"kid": "passkey-c4619047",
"alg": "ES256",
"signed_at": "2026-11-23T00:43:13.451Z",
"assurance": "passkey"
},
"standing": false,
"updated_at": "2026-11-23T00:43:13.542Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Draft a mandate from an instruction#
/v2/mandates/parseTurn a plain-language instruction into a draft mandate for a person to review and sign.
- agent_idIdrequired
- instructionstringrequired
- agent_idId
- instructionstring
- constraintsobject
7 fields
- counterparty_patternstringoptional
- counterparty_namesstring[]optional
- categoriesstring[]optional
- minMoneyoptional
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- maxMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- railsRail[]optional
"card""network_token""checkout_token""stablecoin""bank""ai""cloud" - recurrencestring enumoptional
"none""weekly""monthly"
- expires_atTimestamp | nulloptional
- max_usesnumber | nulloptional
- standingbooleanoptional
- passkey_assertionstringoptional
The signer's passkey assertion (WebAuthn). Required to create; the demo accepts any non-empty string.
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/mandates/parse" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
"instruction": "Book flights to SF under $600 by Friday"
}'{
"agent_id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
"instruction": "Book flights to SF under $600 by Friday",
"constraints": {
"categories": [
"Airlines"
],
"max": {
"amount": 60000,
"asset": "USD"
},
"rails": [
"network_token",
"card"
],
"recurrence": "none"
},
"expires_at": "2026-11-27T23:59:00.000Z",
"max_uses": 1,
"standing": false
}Runs against the in-browser mock with a test key. Nothing leaves your browser.