API ReferenceDemo

Sign spending rules

POST
/api/mandates

With only text, the rules reader (the configured model, or the offline reader) turns the sentence into a policy and Mandate signs it. With policy, the rules the user reviewed are validated and signed. Rate limited when the model is called.

Request Body

application/json

text*string

The rules in plain English

Lengthlength <= 2000
policy?

The signed rules. Money is in minor units (cents).

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/mandates" \  -H "Content-Type: application/json" \  -d '{    "text": "Household basics, up to $80 a month, nothing over $25, never more than 10% above market price, verified sellers only"  }'
{  "id": "string",  "userId": "string",  "status": "active",  "rawText": "string",  "createdAt": "2019-08-24T14:15:22Z",  "policy": {    "categories": [      "string"    ],    "currency": "string",    "maxItemMinor": 0,    "budget": {      "amountMinor": 0,      "period": "week"    },    "sellers": {      "verifiedOnly": true,      "blocked": [        "string"      ]    },    "overLimit": "ask",    "maxPremiumPct": 0,    "marketUnavailable": "ask",    "expires": "2019-08-24"  }}