---
title: "Create / revoke / spend a mandate"
method: POST
path: "/api/mandates"
---

# Create / revoke / spend a mandate

`POST /api/mandates`

## Request

- Base URL: `https://marketnow.site`
- URL: `https://marketnow.site/api/mandates`
- Auth: none declared

Three actions selected by the 'action' field in the body:
- (no action): create a new mandate
- action=revoke: revoke a mandate by id
- action=spend: record a spend against a mandate (called internally by /api/agent-purchase after a successful on-chain payment)

## Request body

- object
  - `action` 'revoke' | 'spend'
  - `owner` string: wallet address (create only)
  - `agentId` string: create only
  - `agentName` string: create only, optional
  - `spendingLimitUsd` number: create only
  - `perPurchaseCapUsd` number: create only, optional
  - `categories` string[]: create only, optional (defaults to ['*'])
  - `expiresAt` string, date-time: create only, optional
  - `signature` string: EIP-191 signature over mandate hash, optional but recommended
  - `id` string: required for revoke / spend
  - `amount` number: required for spend
  - `txHash` string: optional for spend, on-chain tx reference

## Response `200`

Action completed

## Other responses

- `201`: Mandate created
- `400`: Validation error
- `404`: Mandate not found
- `409`: Mandate revoked / expired / insufficient remaining

---

[API](https://skmtc.dev/marketnow/apis/marketnow-skills-api.md) · [All operations](https://skmtc.dev/marketnow/apis/marketnow-skills-api/llms.txt) · [OpenAPI document](https://skmtc.dev/marketnow/apis/marketnow-skills-api/revisions/deedc7ba7beb?raw)
