# Counter-offers

Counter-offers between agents: a subagent records what it was asked to get (a brief), posts what an outside agent offered instead, and Provenance computes the differences and decides each option: accept within the grant's tolerances, ask the person who asked, or refuse.

Related guide: [Counter-offers](https://provenanceauth.com/docs/mandate/guides/counter-offers.md)

## Endpoints

- `GET /v1/authorize/briefs/{id}`: [Retrieve a brief](#get-v1-authorize-briefs-id)
- `GET /v1/authorize/counter_offers/{id}`: [Retrieve a counter-offer](#get-v1-authorize-counter-offers-id)
- `GET /v1/authorize/settings/counter_offers`: [Read the counter-offer settings](#get-v1-authorize-settings-counter-offers)
- `POST /v1/authorize/authority_proofs`: [Get an authority proof for an offer](#post-v1-authorize-authority-proofs)
- `GET /v1/authorize/offer_rules`: [Read the offer rules](#get-v1-authorize-offer-rules)
- `GET /v1/authorize/offer_rules/{agent_id}`: [Read an agent's offer rules](#get-v1-authorize-offer-rules-agent-id)
- `PUT /v1/authorize/settings/counter_offers`: [Change the counter-offer settings](#put-v1-authorize-settings-counter-offers)
- `PUT /v1/authorize/offer_rules`: [Set the account's offer rules](#put-v1-authorize-offer-rules)
- `PUT /v1/authorize/offer_rules/{agent_id}`: [Set an agent's offer rules](#put-v1-authorize-offer-rules-agent-id)
- `GET /v1/authorize/briefs`: [List briefs](#get-v1-authorize-briefs)
- `GET /v1/authorize/counter_offers`: [List counter-offers](#get-v1-authorize-counter-offers)
- `DELETE /v1/authorize/offer_rules/{agent_id}`: [Remove an agent's offer rules](#delete-v1-authorize-offer-rules-agent-id)
- `POST /v1/authorize/briefs`: [Record a brief](#post-v1-authorize-briefs)
- `POST /v1/authorize/briefs/{id}/close`: [Close a brief](#post-v1-authorize-briefs-id-close)
- `POST /v1/authorize/counter_offers`: [Post a counter-offer](#post-v1-authorize-counter-offers)
- `POST /v1/authorize/counter_offers/{id}/accept_option`: [Accept a counter-offer option](#post-v1-authorize-counter-offers-id-accept-option)
- `POST /v1/authorize/counter_offers/{id}/withdraw`: [Withdraw a counter-offer](#post-v1-authorize-counter-offers-id-withdraw)
- `POST /v1/authorize/counter_offers/{id}/decline`: [Decline a counter-offer](#post-v1-authorize-counter-offers-id-decline)
- `POST /v1/authorize/counter_offers/{id}/sign_check`: [Check which options may be signed](#post-v1-authorize-counter-offers-id-sign-check)
- `GET /v1/public/authority_proofs/{jti}/status`: [Check an authority proof's status](#get-v1-public-authority-proofs-jti-status)

## The counter offer object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | `cof_` + ULID. |
| `object` | enum | yes | The type of object. One of `counter_offer`. |
| `side` | enum | yes | The side. One of `asking`, `offering`. |
| `status` | enum | yes | The state. `not_chosen`: it waited in the collect window or the queue and the person accepted another offer for the brief. One of `open`, `asking`, `accepted`, `declined`, `expired`, `stopped`, `withdrawn`, `not_chosen`. |
| `brief_id` | string | yes | The brief. |
| `grant_id` | string \| null | yes | The grant. |
| `run_id` | string \| null | yes | The agent-team run, when there is one. |
| `channel` | enum | yes | Where the offer came from. One of `a2a`, `mcp`, `ucp`, `acp`, `ap2`, `web`, `voice`, `chat`, `email`. |
| `counterparty` | object | yes | The outside agent and the best proof it gave. |
| `counterparty.agent_id` | string | no | The agent's registered id. |
| `counterparty.kid` | string | no | The key id the outside agent signed with. |
| `counterparty.origin` | string | no | The outside agent's origin. |
| `counterparty.name` | string | no | The name, as given. |
| `counterparty.card_url` | string | no | The outside agent's Agent Card URL. |
| `counterparty.call_id` | string | no | The registered call the offer came on (voice). |
| `counterparty.verification` | enum | no | The best proof the outside agent gave. `registered`: an offer signed by a key registered to a Provenance selling agent. `signed_directory`: an option signed by a key in its origin's RFC 9421 key directory. `signed_card`: an A2A Agent Card on its origin whose signature verifies against a key on that origin. `declared`: a name and origin only (also when its keys or card couldn't be fetched). One of `registered`, `signed_directory`, `signed_card`, `declared`. |
| `counterparty.key_thumbprint` | string | no | The key id (registered) or RFC 7638 thumbprint (directory) of the key that signed an option. |
| `counterparty.proven_origin` | string | no | The origin whose key directory or signed Agent Card proved the level. |
| `counterparty.card_key_thumbprint` | string | no | The thumbprint of the key that signed the Agent Card (`signed_card`). |
| `counterparty.proof_problem` | enum | no | Why a proof that was offered didn't count, when the level is `declared`. One of `keys_unavailable`, `card_unavailable`, `card_signature_invalid`. |
| `counterparty.trusted` | object | no | A trusted agent on the person's or the company's list it matched, by its proven agent id or key. It counts as verified. |
| `counterparty.trusted.id` | string | no | The trusted agent entry. |
| `counterparty.trusted.owner` | enum | no | Whose list. One of `account`, `person`. |
| `options` | array of objects | yes | The options offered (one to five). |
| `options.index` | integer | no | The option's position (0 first). |
| `options.label` | string | no | A short label for the option. |
| `options.source` | enum | no | The source. One of `signed`, `reported_by_agent`. |
| `options.signed_by` | enum | no | How a signed option was checked: a seller's `offer+jwt` against its registered key, or a JWS against the origin's key directory. One of `registered`, `signed_directory`. |
| `options.signature_status` | enum | no | A signed option whose keys couldn't be fetched, kept as reported. One of `keys_unavailable`. |
| `options.offer` | object | no | What one option offers. For a signed option these are the signed fields; fields sent beside a signed offer are ignored. |
| `options.offer.items` | array of objects | yes | The lines. |
| `options.offer.items.name` | string | yes | The name, as given. |
| `options.offer.items.sku` | string | no | The seller's item code. |
| `options.offer.items.category` | string | no | The item's category. |
| `options.offer.items.quantity` | number | yes | How many. |
| `options.offer.items.unit` | string | no | The unit the quantity is in. |
| `options.offer.items.unit_price` | number | no | The price of one unit, in the offer's currency. |
| `options.offer.total` | number | yes | The offer's total, in its currency (major units). |
| `options.offer.currency` | string | yes | ISO 4217 currency code. |
| `options.offer.dates` | object | no | The dates of what is offered. |
| `options.offer.dates.start` | timestamp | no | When it starts. |
| `options.offer.dates.end` | timestamp | no | When it ends. |
| `options.offer.terms` | object | no | The offer's terms. |
| `options.offer.terms.refundable` | boolean | no | Whether it can be refunded. |
| `options.offer.terms.cancellation_before` | timestamp | no | The last time it can be cancelled. |
| `options.offer.terms.change_fee` | number | no | The fee to change it, in the currency. |
| `options.offer.delivery` | object | no | When it is delivered. |
| `options.offer.delivery.by` | timestamp | no | The delivery date. |
| `options.offer.seller` | string | no | The seller's id or origin. |
| `options.offer.expires_at` | timestamp | yes | When the offer ends. |
| `options.offer.coverage` | enum | no | Whether the offer covers the whole brief (`full`) or part of it (`partial`). One of `full`, `partial`. |
| `options.offer.lines` | array of objects | no | For a partial offer: how much of each brief line it covers. |
| `options.offer.lines.brief_line` | integer | no | The brief line's index. |
| `options.offer.lines.quantity_offered` | number | no | How much of that line is offered. |
| `options.offer.tax_and_fees` | number | no | Tax and fees on top of the total, when declared. |
| `options.offer_hash` | string | no | The signed offer's hash, or sha256 over the reported fields. What an acceptance binds to. |
| `options.differences` | array of objects | no | What the option changes against the brief, computed by Provenance. |
| `options.differences.field` | enum | no | What differs. One of `price`, `dates`, `item`, `quantity`, `terms`, `seller`, `currency`, `delivery`. |
| `options.differences.part` | string | no | Which part of the field (a line's name, `end`, `refundable`). |
| `options.differences.from` | string \| null | no | The brief's value. |
| `options.differences.to` | string \| null | no | The offer's value. |
| `options.differences.delta` | number | no | Price in the currency, dates and delivery in minutes, quantity in units. |
| `options.differences.delta_pct` | number | no | The price change as a percentage of the brief's price line. |
| `options.differences.direction` | enum | no | `better`, `worse` or `different`. One of `better`, `worse`, `different`. |
| `options.differences.category` | enum | no | The item's category. One of `same`, `different`, `unknown`. |
| `options.result` | enum | no | The result. One of `within_authority`, `ask`, `refused`. |
| `options.reason` | string \| null | no | Why it asks or was refused (a reason code). |
| `options.matched_rule_id` | string | no | The matched rule id. |
| `options.note` | string | no | The outside agent's own words, plain text, labelled as theirs. |
| `options.external_ref` | string | no | The outside agent's own reference for the option. |
| `options.action_hash` | string | no | the payload hash an intent bought for this option must carry (sha256 hex). |
| `options.changed_after_acceptance` | array of objects | no | on a revision (`revises`) of an accepted counter-offer, what changed against the accepted version, in the shape of `differences`. Worse in any way: the person decides it again. |
| `options.cleared_by` | enum | no | Offering side: who cleared the option for signing (the offer rules, a staff member, or the rules' timeout setting). Only cleared options may be signed (`sign_check`). One of `rules`, `staff`, `timeout`. |
| `options.offer_payload` | object | no | Offering side: the signed-offer payload your agent signs once the option is cleared. |
| `options.request_differences` | array of objects | no | Offering side: what the option changes against the buyer's request (`differences` are against your standard offer: a lower price there is a concession). |
| `options.credit_instead_of_refund` | number | no | Offering side: store credit offered instead of a refund, in major units. |
| `options.from` | object | no | an option that joined this ask from another counter-offer in the collect window. |
| `options.from.counter_offer_id` | string | no | The counter-offer it came from. |
| `options.from.index` | integer | no | Its index there. |
| `options.status` | enum | no | The state. One of `open`, `accepted`, `not_chosen`. |
| `retry` | enum | yes | What the agent should do next: `accept` one within authority, `wait_for_person` while the ask is open, `find_another` (refused, Keep looking or a timeout), `revise` (the person asked for a change: take their words back to the outside agent and post its new offer with `revises`), or nothing (accepted, or the person declined this one and the brief stays open). One of `accept`, `wait_for_person`, `find_another`, `revise`. |
| `exchange_id` | string | no | The shared exchange record this counter-offer is written to (`xch_…`), on a read of one counter-offer, when there is one. |
| `approval_id` | string \| null | yes | The ask's approval (an ordinary approval row, `matched_rule_id` `counter_offer`), when a person was asked. |
| `ask` | object \| null | no | The ask that went to a person, when one did. |
| `ask.to` | enum | no | Who was asked: the person behind the top grant, a member, an approver link, or the account's approval routes. One of `root_person`, `member`, `approver_link`, `routes`. |
| `ask.expires_at` | timestamp | no | When the ask ends (30 seconds before the offer, the ask limit, or the brief's deadline). |
| `ask.on_timeout` | enum | no | What silence does. `accept_within_tolerances` only when the person chose it for the grant. One of `decline`, `accept_within_tolerances`. |
| `ask.options` | array of integers | no | The options asked about. |
| `decision` | object \| null | no | How the ask ended. |
| `decision.kind` | enum | no | The person's answer, a timeout, or a check at the time that refused the option. One of `accept`, `decline`, `keep_looking`, `request_changes`, `timeout`, `no_longer_allowed`. |
| `decision.option` | integer | no | The option accepted. |
| `decision.note` | string \| null | no | The person's note to the agent (theirs, plain text). |
| `decision.requested_changes` | array of objects | no | What the person asked to change (the change form: field, label, from, to). On the offering side, Edit proposal sends a price: `{ field: price, label: Price, from: 598, to: 610 }` (`price:<index>` when the ask held several proposals). It is a request to the agent, never an instruction the platform carries out. |
| `decision.reason` | string \| null | no | Why, when nobody chose it. |
| `decision.by` | enum | no | Who ended it (`agent`: the requesting agent declined it). One of `person`, `timeout`, `system`, `agent`. |
| `decision.by_name` | string | no | With `person`: who answered, by name, on the account's own reads: a console person's email or an outside approver's display name. Absent for the person behind a grant, a server, a timeout and the system. |
| `decision.method` | string \| null | no | How the person answered: `passkey`, `link`, `console` or `api_key`. |
| `decision.at` | timestamp | no | When. |
| `approval_link_token` | string | no | Sandbox only, on create: the ask's link token, so a test can answer as the person. Never on live. |
| `acceptance` | object \| null | yes | The acceptance a purchase must match (one per counter-offer). |
| `acceptance.option` | integer | no | The option's index. |
| `acceptance.offer_hash` | string | no | The offer's hash; what the acceptance binds to. |
| `acceptance.amount` | number | no | The accepted amount. |
| `acceptance.currency` | string | no | ISO 4217 currency code. |
| `acceptance.expires_at` | timestamp | no | The offer's expiry, at most 24 hours. |
| `acceptance.accepted_by` | object | no | `authority` with the tolerance that allowed it (or `no_worse`); `person` with the `approval_id` and `method`; or `timeout` with the tolerance that let silence accept it. |
| `acceptance.accepted_at` | timestamp | no | When it was accepted. |
| `acceptance.consumed_at` | timestamp \| null | no | When a purchase used it (null until then). |
| `acceptance.consumed_by` | object \| null | no | the purchase that used it (one each): a `deal`, a `verify` of a token, or a store's `checkout` assessment. |
| `acceptance.consumed_by.kind` | enum | no | What used it. One of `deal`, `verify`, `checkout`. |
| `acceptance.consumed_by.id` | string | no | The deal, the token's jti or the checkout assessment. |
| `held` | object \| null | no | the ask waits. `collecting` (until the collect window ends, then one ask goes out with the joined options), `merged` (its options joined `into` that counter-offer's ask; the acceptance lives there) or `queued` (behind another ask on the brief that is out). |
| `held.kind` | enum | no | How it waits. One of `collecting`, `merged`, `queued`. |
| `held.until` | timestamp | no | When the collect window ends. |
| `held.into` | string | no | The counter-offer whose ask it joined. |
| `held.behind` | string | no | The counter-offer whose ask it waits behind. |
| `revises` | string \| null | yes | The counter-offer this one replaces. |
| `call_id` | string \| null | yes | The registered call the offer came on (voice). |
| `stopped_by` | object \| null | yes | The stopped by. |
| `created_by` | object | yes | The created by. |
| `created_by.via` | enum | no | How it was created: `holder` (the agent's own proof), `account_key` or `console`. One of `holder`, `account_key`, `console`. |
| `created_by.agent_id` | string \| null | no | The agent's registered id. |
| `created_at` | timestamp | yes | The created at. |
| `updated_at` | timestamp | yes | The updated at. |

### Example

```json
{
  "id": "cof_01M8F9N80Q5D7W4S53G1744HDE",
  "object": "counter_offer",
  "side": "asking",
  "status": "asking",
  "brief_id": "brf_01M8F9N80B1BY758DGSKQZHH59",
  "grant_id": "grt_01M8F9N801BZ5DYQV0MEDYTW6B",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "origin": "https://air.example",
    "name": "The airline's booking agent",
    "verification": "declared"
  },
  "options": [
    {
      "index": 0,
      "label": "12:40",
      "source": "reported_by_agent",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-1240",
            "category": "flight",
            "quantity": 1
          }
        ],
        "total": 648,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T12:40:00Z"
        },
        "terms": {
          "refundable": true
        },
        "expires_at": "2027-03-01T00:00:00Z"
      },
      "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
      "differences": [
        {
          "field": "item",
          "part": "Seat LIS-JFK",
          "from": "Seat LIS-JFK",
          "to": "Seat LIS-JFK",
          "direction": "different",
          "category": "same"
        },
        {
          "field": "price",
          "from": 612,
          "to": 648,
          "delta": 36,
          "delta_pct": 5.9,
          "direction": "worse"
        },
        {
          "field": "dates",
          "from": "2027-03-12T09:05:00Z",
          "to": "2027-03-12T12:40:00Z",
          "delta": 215,
          "direction": "worse"
        }
      ],
      "result": "ask",
      "reason": "item_changed",
      "note": "The 9:05 is full",
      "status": "open"
    }
  ],
  "retry": "wait_for_person",
  "approval_id": "appr_01M8F9N80WH06X7T67MZVGFXRW",
  "ask": {
    "to": "root_person",
    "expires_at": "2026-11-27T20:17:59.735Z",
    "on_timeout": "decline",
    "options": [
      0
    ]
  },
  "decision": null,
  "acceptance": null,
  "revises": null,
  "held": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T20:02:59.733Z",
  "updated_at": "2026-11-27T20:02:59.742Z"
}
```

## Events

Sent to your [webhook endpoints](https://provenanceauth.com/docs/integrate/webhooks.md) when they subscribe:

- `authorize.brief.recorded`
- `authorize.brief.closed`
- `authorize.counter_offer.received`
- `authorize.counter_offer.accepted`
- `authorize.counter_offer.asked`
- `authorize.counter_offer.decided`
- `authorize.counter_offer.expired`
- `authorize.counter_offer.stopped`

## Retrieve a brief

`GET /v1/authorize/briefs/{id}`

One of the account's briefs.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The brief (`brf_…`). |

### Returns

The brief.

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-3" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/authorize/briefs/$BRIEF_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-3" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs/${briefId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-3"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
data = httpx.get(f"{api}/v1/authorize/briefs/{brief_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "brf_01M8DAEPKZB238VHVC2CK03023",
  "object": "brief",
  "side": "asking",
  "status": "open",
  "grant_id": "grt_01M8DAEPKXPJX84KJMPS39TPZ4",
  "agent_id": null,
  "run_id": null,
  "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
  "asked_by": {
    "kind": "root_person"
  },
  "wants": {
    "items": [
      {
        "name": "Seat LIS-JFK",
        "sku": "TP209-0905",
        "category": "flight",
        "quantity": 1
      }
    ],
    "max_total": 612,
    "currency": "USD",
    "dates": {
      "start": "2027-03-12T09:05:00Z"
    },
    "terms": {
      "refundable": true
    }
  },
  "remaining": [
    {
      "name": "Seat LIS-JFK",
      "sku": "TP209-0905",
      "category": "flight",
      "quantity": 1
    }
  ],
  "brief_hash": "94f177c5dae9fea4a82ed2c69f6580e7dc953956f340a341344687b6c4af5048",
  "deadline": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T01:38:25.023Z",
  "updated_at": "2026-11-27T01:38:25.023Z"
}
```

## Retrieve a counter-offer

`GET /v1/authorize/counter_offers/{id}`

One of the account's counter-offers, with each option's differences and result. An ask the person answered (on any surface) or that ran out is brought up to date first, so `status`, `decision`, `acceptance` and `retry` are current.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The counter-offer (`cof_…`). |
| `wait` | query | integer | no | Seconds to hold the read while an ask is open; it answers as soon as the ask ends. |

### Returns

The counter-offer. See [the counter offer object](#object).

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-7" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"counterparty\": {
      \"origin\": \"https://air.example\"
    },
    \"options\": [
      {
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-1240\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 648,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T12:40:00Z\"
          },
          \"terms\": {
            \"refundable\": true
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-7" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "counterparty": {
      "origin": "https://air.example"
    },
    "options": [
      {
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-1240",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 648,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T12:40:00Z"
          },
          "terms": {
            "refundable": true
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-7"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "counterparty": {
        "origin": "https://air.example"
    },
    "options": [
        {
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-1240",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 648,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T12:40:00Z"
                },
                "terms": {
                    "refundable": True
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
data = httpx.get(f"{api}/v1/authorize/counter_offers/{counter_offer_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "cof_01M8F9N81HP0WNGPSZCRKFJ2BM",
  "object": "counter_offer",
  "side": "asking",
  "status": "asking",
  "brief_id": "brf_01M8F9N81E1YCA70CGE39H7KE9",
  "grant_id": "grt_01M8F9N81BCXSW3T13DYG6XZCA",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "origin": "https://air.example",
    "verification": "declared"
  },
  "options": [
    {
      "index": 0,
      "source": "reported_by_agent",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-1240",
            "category": "flight",
            "quantity": 1
          }
        ],
        "total": 648,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T12:40:00Z"
        },
        "terms": {
          "refundable": true
        },
        "expires_at": "2027-03-01T00:00:00Z"
      },
      "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
      "differences": [
        {
          "field": "item",
          "part": "Seat LIS-JFK",
          "from": "Seat LIS-JFK",
          "to": "Seat LIS-JFK",
          "direction": "different",
          "category": "same"
        },
        {
          "field": "price",
          "from": 612,
          "to": 648,
          "delta": 36,
          "delta_pct": 5.9,
          "direction": "worse"
        },
        {
          "field": "dates",
          "from": "2027-03-12T09:05:00Z",
          "to": "2027-03-12T12:40:00Z",
          "delta": 215,
          "direction": "worse"
        }
      ],
      "result": "ask",
      "reason": "item_changed",
      "status": "open"
    }
  ],
  "retry": "wait_for_person",
  "approval_id": "appr_01M8F9N81J81PB7NA14FCN6N2C",
  "ask": {
    "to": "root_person",
    "expires_at": "2026-11-27T20:17:59.761Z",
    "on_timeout": "decline",
    "options": [
      0
    ]
  },
  "decision": null,
  "acceptance": null,
  "revises": null,
  "held": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T20:02:59.761Z",
  "updated_at": "2026-11-27T20:02:59.762Z"
}
```

## Read the counter-offer settings

`GET /v1/authorize/settings/counter_offers`

The account's counter-offer settings, with the defaults filled in. Any member.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The settings.

### Errors

- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/settings/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/counter_offers`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/settings/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "counter_offer_settings",
  "accept_within_default": null,
  "unsigned": "ask",
  "unverified": "ask",
  "disclose": "agent",
  "collect_seconds": 0,
  "no_silent_accept": false,
  "ask_on_item_change": true,
  "ask_wait_minutes": 1440
}
```

## Get an authority proof for an offer

`POST /v1/authorize/authority_proofs`

An offer-scoped `authority+jwt` (ES256) for the outside agent: "this agent may commit to this offer", with `aud`, `sub`, `operator`, the person's pairwise `root_sub` and `covers`, never a limit, budget, grant or purpose. Only for an option the agent may accept now or one a person accepted. At most 10 minutes; it holds only while its keyless status is `active`. Holder proof only.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `counter_offer_id` | body | string | yes | The counter-offer (`cof_…`). |
| `option` | body | integer | yes | The option the agent will commit to. |
| `audience` | body | string | yes | Who the proof is for: the outside agent's `agent_id`, a key thumbprint the counter-offer recorded, or its origin. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token, with its RFC 9421 signature over the request. Left out with a key restricted to the agent the counter-offer's grant names (or that agent's client-credentials sign-in on the MCP server), which stands in for its holder proof. |

### Returns

The signed proof. Keep it only as long as the exchange needs it; only its status is kept here.

### Errors

- [`authority_proof_not_allowed`](https://provenanceauth.com/docs/platform/errors.md#authority_proof_not_allowed)
- [`holder_proof_invalid`](https://provenanceauth.com/docs/platform/errors.md#holder_proof_invalid)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
curl -X POST "$PROVENANCE_API/v1/authorize/authority_proofs" \
  -H "Content-Type: application/json" \
  -d '{
    "counter_offer_id": "cof_01M8FT658VK09ZG0Q2C7B0CGCX",
    "option": 0,
    "audience": "https://air.example",
    "grant_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDEifQ.c2lnbmF0dXJl"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/authority_proofs`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "counter_offer_id": "cof_01M8FT658VK09ZG0Q2C7B0CGCX",
    "option": 0,
    "audience": "https://air.example",
    "grant_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDEifQ.c2lnbmF0dXJl"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/authority_proofs", json={
    "counter_offer_id": "cof_01M8FT658VK09ZG0Q2C7B0CGCX",
    "option": 0,
    "audience": "https://air.example",
    "grant_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0In0.eyJqdGkiOiJncnRfMDEifQ.c2lnbmF0dXJl"
}).json()
```

### Response 201

```json
{
  "object": "authority_proof",
  "jti": "atp_01M8FT65A4N7Q2W9E3R5T8Y1U6",
  "authority_proof": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImF1dGhvcml0eStqd3QiLCJraWQiOiI0YzFmOWEyZTdiM2Q1YzhhIn0.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6ImF0cF8wMU04RlQ2NUE0TjdRMlc5RTNSNVQ4WTFVNiIsImF1ZCI6Imh0dHBzOi8vYWlyLmV4YW1wbGUifQ.c2lnbmF0dXJl",
  "audience": "https://air.example",
  "covers": {
    "offer_hash": "9d2c4e1f7a3b5d8c0e6f2a4b6c8d0e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d",
    "amount": 598,
    "currency": "USD"
  },
  "expires_at": "2026-11-28T01:01:51.000Z",
  "status_url": "https://sandbox-api.provenanceauth.com/v1/public/authority_proofs/atp_01M8FT65A4N7Q2W9E3R5T8Y1U6/status"
}
```

## Read the offer rules

`GET /v1/authorize/offer_rules`

The offering side's rules: the account default and each agent's own. Any member, or a key.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The account default (null when none is set) and each agent's rules.

### Errors

- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/offer_rules" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/offer_rules`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/offer_rules", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "offer_rule_list",
  "default": null,
  "agents": []
}
```

## Read an agent's offer rules

`GET /v1/authorize/offer_rules/{agent_id}`

The agent's own rules (or the default it inherits, with `inherited: true`) and `effective`: the tightest of its rules and the default, which is what applies.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The agent's rules.

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "offer_rule",
  "agent_id": "agt_01M8F9N81SDT2VDABK2Y1420BJ",
  "offer_within": {
    "discount_pct": 3
  },
  "approver": {
    "kind": "routes"
  },
  "on_timeout": "decline",
  "enforce_at_deal": true,
  "version": 1,
  "updated_by": "k_01M8F9N81WW0Q22RVRZ5NNPSX8",
  "created_at": "2026-11-28T10:00:00.000Z",
  "updated_at": "2026-11-28T10:00:00.000Z",
  "inherited": false,
  "effective": {
    "object": "offer_rule",
    "agent_id": "agt_01M8F9N81SDT2VDABK2Y1420BJ",
    "offer_within": {
      "discount_pct": 3,
      "date_earlier_minutes": 360,
      "date_later_minutes": 360
    },
    "approver": {
      "kind": "routes"
    },
    "on_timeout": "decline",
    "enforce_at_deal": true,
    "version": 1,
    "updated_by": "k_01M8F9N81WW0Q22RVRZ5NNPSX8",
    "created_at": "2026-11-28T10:00:00.000Z",
    "updated_at": "2026-11-28T10:00:00.000Z"
  }
}
```

## Change the counter-offer settings

`PUT /v1/authorize/settings/counter_offers`

Changes the fields you send. An owner or admin, or an `admin` key. Loosening `unsigned`, `unverified`, `disclose`, `no_silent_accept` or `ask_on_item_change` is written to the account's ledger. `accept_within_default: null` clears the default.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accept_within_default` | body | object \| any \| null | no | The accept within default. |
| `accept_within_default.price_up_pct` | body | number | no | The most the price may rise, as a percentage of the brief's price line. |
| `accept_within_default.price_up_amount` | body | number | no | The most the price may rise, in the grant's currency (major units). Both price fields must pass when both are set. |
| `accept_within_default.date_earlier_minutes` | body | integer | no | How much earlier a date may move. |
| `accept_within_default.date_later_minutes` | body | integer | no | How much later a date may move. |
| `accept_within_default.substitutes` | body | enum | no | Whether a substitute item in the brief line's category may be accepted. One of `none`, `same_category`. |
| `accept_within_default.quantity_short` | body | enum | no | Whether an offer of part of the quantity may be accepted. One of `none`, `partial`. |
| `accept_within_default.terms_worse` | body | boolean | no | Whether worse terms (not refundable, an earlier cancellation deadline, a change fee, later delivery) may be accepted. |
| `accept_within_default.other_seller` | body | boolean | no | Whether a seller other than the brief's counterparties may be accepted. |
| `accept_within_default.on_timeout` | body | enum | no | What happens when the person doesn't answer an ask (default `decline`). Asks arrive in a later slice. One of `decline`, `accept_within_tolerances`. |
| `unsigned` | body | enum | no | What a reported (unsigned) offer does: `ask` the person (the default), `within_tolerances` (a reported option inside every tolerance and limit, from an outside agent at a verified level, may be accepted alone; loosening it is recorded on the ledger) or `refuse` it. One of `ask`, `within_tolerances`, `refuse`. |
| `unverified` | body | enum | no | The unverified. One of `ask`, `refuse`. |
| `disclose` | body | enum | no | The disclose. One of `agent`, `chain`. |
| `collect_seconds` | body | integer | no | Hold the first ask this long to gather offers from several agents. |
| `no_silent_accept` | body | boolean | no | The no silent accept. |
| `ask_on_item_change` | body | boolean | no | The ask on item change. |
| `ask_wait_minutes` | body | enum | no | Wait for an answer, in minutes: how long a proposal waits for the person (24 hours by default). One of `15`, `60`, `240`, `1440`. |

### Returns

The settings.

### Errors

- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/authorize/settings/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "unsigned": "ask", "accept_within_default": { "price_up_pct": 2 } }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/counter_offers`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "unsigned": "ask", "accept_within_default": { "price_up_pct": 2 } }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/authorize/settings/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "unsigned": "ask",
    "accept_within_default": {
        "price_up_pct": 2
    }
}).json()
```

### Response 200

```json
{
  "object": "counter_offer_settings",
  "accept_within_default": {
    "price_up_pct": 2
  },
  "unsigned": "ask",
  "unverified": "ask",
  "disclose": "agent",
  "collect_seconds": 0,
  "no_silent_accept": false,
  "ask_on_item_change": true,
  "ask_wait_minutes": 1440
}
```

## Set the account's offer rules

`PUT /v1/authorize/offer_rules`

What any selling or support agent may offer alone, as concessions from its standard offer. Narrowing: a member who approves, or a key. Widening (a looser `offer_within`, `on_timeout: accept_within_tolerances`, `enforce_at_deal: false`): an owner or admin, or an `admin` key; written to the account's ledger.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `offer_within` | body | object | yes | Concessions the agent may make alone (see OfferRule): discount_pct, discount_amount, substitutes, quantity_short, date_earlier_minutes, date_later_minutes, terms_better, credit_instead_of_refund_max. Absent fields allow none. |
| `approver` | body | object | no | Who is asked past the rules: `kind` member, approver_link or routes (the default), with `id`; never an agent. |
| `on_timeout` | body | enum | no | What an unanswered ask does (default decline). One of `decline`, `accept_within_tolerances`. |
| `enforce_at_deal` | body | boolean | no | A deal on an uncleared offer waits for your people (default true). |
| `expected_version` | body | integer \| null | no | Compare-and-set: the `version` you read (0: only if none is set yet). Leave it out to overwrite. |

### Returns

The rules as saved.

### Errors

- [`offer_rules_changed`](https://provenanceauth.com/docs/platform/errors.md#offer_rules_changed)
- [`asked_by_not_a_person`](https://provenanceauth.com/docs/platform/errors.md#asked_by_not_a_person)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/authorize/offer_rules" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "offer_within": {
      "discount_pct": 5,
      "date_earlier_minutes": 360,
      "date_later_minutes": 360
    },
    "approver": {
      "kind": "routes"
    },
    "expected_version": 0
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/offer_rules`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "offer_within": {
      "discount_pct": 5,
      "date_earlier_minutes": 360,
      "date_later_minutes": 360
    },
    "approver": {
      "kind": "routes"
    },
    "expected_version": 0
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/authorize/offer_rules", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "offer_within": {
        "discount_pct": 5,
        "date_earlier_minutes": 360,
        "date_later_minutes": 360
    },
    "approver": {
        "kind": "routes"
    },
    "expected_version": 0
}).json()
```

### Response 200

```json
{
  "object": "offer_rule",
  "agent_id": null,
  "offer_within": {
    "discount_pct": 5,
    "date_earlier_minutes": 360,
    "date_later_minutes": 360
  },
  "approver": {
    "kind": "routes"
  },
  "on_timeout": "decline",
  "enforce_at_deal": true,
  "version": 1,
  "updated_by": "k_01M8F9N81WW0Q22RVRZ5NNPSX8",
  "created_at": "2026-11-28T10:00:00.000Z",
  "updated_at": "2026-11-28T10:00:00.000Z"
}
```

## Set an agent's offer rules

`PUT /v1/authorize/offer_rules/{agent_id}`

One agent's rules; never looser than the account default (400 naming the field). The same roles as the account default.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `offer_within` | body | object | yes | Concessions the agent may make alone (see OfferRule): discount_pct, discount_amount, substitutes, quantity_short, date_earlier_minutes, date_later_minutes, terms_better, credit_instead_of_refund_max. Absent fields allow none. |
| `approver` | body | object | no | Who is asked past the rules: `kind` member, approver_link or routes (the default), with `id`; never an agent. |
| `on_timeout` | body | enum | no | What an unanswered ask does (default decline). One of `decline`, `accept_within_tolerances`. |
| `enforce_at_deal` | body | boolean | no | A deal on an uncleared offer waits for your people (default true). |
| `expected_version` | body | integer \| null | no | Compare-and-set: the `version` you read (0: only if none is set yet). Leave it out to overwrite. |

### Returns

The rules as saved.

### Errors

- [`offer_rules_changed`](https://provenanceauth.com/docs/platform/errors.md#offer_rules_changed)
- [`asked_by_not_a_person`](https://provenanceauth.com/docs/platform/errors.md#asked_by_not_a_person)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "offer_within": { "discount_pct": 3 } }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "offer_within": { "discount_pct": 3 } }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "offer_within": {
        "discount_pct": 3
    }
}).json()
```

### Response 200

```json
{
  "object": "offer_rule",
  "agent_id": "agt_01M8F9N81SDT2VDABK2Y1420BJ",
  "offer_within": {
    "discount_pct": 3
  },
  "approver": {
    "kind": "routes"
  },
  "on_timeout": "decline",
  "enforce_at_deal": true,
  "version": 1,
  "updated_by": "k_01M8F9N81WW0Q22RVRZ5NNPSX8",
  "created_at": "2026-11-28T10:00:00.000Z",
  "updated_at": "2026-11-28T10:00:00.000Z"
}
```

## List briefs

`GET /v1/authorize/briefs`

The account's briefs, newest first. Filters: `status`, `grant_id`, `run_id`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `status` | query | enum | no | The state. One of `open`, `fulfilled`, `partly_fulfilled`, `abandoned`, `expired`, `stopped`. |
| `grant_id` | query | string | no | The grant. |
| `run_id` | query | string | no | The agent-team run, when there is one. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |

### Returns

A page of briefs.

### Errors

- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-2" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > /dev/null
curl "$PROVENANCE_API/v1/authorize/briefs?grant_id=$GRANT_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-2" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs?grant_id=${grantId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-2"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
data = httpx.get(f"{api}/v1/authorize/briefs?grant_id={grant_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "brf_01M8DAEPKRTMP4780WCP5128GP",
      "object": "brief",
      "side": "asking",
      "status": "open",
      "grant_id": "grt_01M8DAEPKMNATQ3V0SN08BDBWD",
      "agent_id": null,
      "run_id": null,
      "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
      "asked_by": {
        "kind": "root_person"
      },
      "wants": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-0905",
            "category": "flight",
            "quantity": 1
          }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
          "refundable": true
        }
      },
      "remaining": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "brief_hash": "608f7f9d74dbc512d32db37256f43d9efbf6679c9b0fa8190c2a193c96025a63",
      "deadline": null,
      "created_by": {
        "via": "account_key",
        "agent_id": null
      },
      "created_at": "2026-11-27T01:38:25.016Z",
      "updated_at": "2026-11-27T01:38:25.016Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List counter-offers

`GET /v1/authorize/counter_offers`

The account's counter-offers, newest first. Filters: `status`, `brief_id`, `grant_id`, `run_id`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `status` | query | enum | no | The state. One of `open`, `asking`, `accepted`, `declined`, `expired`, `stopped`, `withdrawn`. |
| `brief_id` | query | string | no | The brief. |
| `grant_id` | query | string | no | The grant. |
| `run_id` | query | string | no | The agent-team run, when there is one. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |

### Returns

A page of counter-offers.

### Errors

- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-6" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"counterparty\": {
      \"origin\": \"https://air.example\"
    },
    \"options\": [
      {
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-1240\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 648,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T12:40:00Z\"
          },
          \"terms\": {
            \"refundable\": true
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > /dev/null
curl "$PROVENANCE_API/v1/authorize/counter_offers?brief_id=$BRIEF_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-6" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "counterparty": {
      "origin": "https://air.example"
    },
    "options": [
      {
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-1240",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 648,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T12:40:00Z"
          },
          "terms": {
            "refundable": true
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers?brief_id=${briefId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-6"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "counterparty": {
        "origin": "https://air.example"
    },
    "options": [
        {
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-1240",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 648,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T12:40:00Z"
                },
                "terms": {
                    "refundable": True
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
data = httpx.get(f"{api}/v1/authorize/counter_offers?brief_id={brief_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "cof_01M8F9N8158DKG3N82M4Q8A2Y9",
      "object": "counter_offer",
      "side": "asking",
      "status": "asking",
      "brief_id": "brf_01M8F9N813F1NYJMWC4G8R1CE8",
      "grant_id": "grt_01M8F9N811MD3TPVTRK00F4NYE",
      "run_id": null,
      "channel": "a2a",
      "counterparty": {
        "origin": "https://air.example",
        "verification": "declared"
      },
      "options": [
        {
          "index": 0,
          "source": "reported_by_agent",
          "offer": {
            "items": [
              {
                "name": "Seat LIS-JFK",
                "sku": "TP209-1240",
                "category": "flight",
                "quantity": 1
              }
            ],
            "total": 648,
            "currency": "USD",
            "dates": {
              "start": "2027-03-12T12:40:00Z"
            },
            "terms": {
              "refundable": true
            },
            "expires_at": "2027-03-01T00:00:00Z"
          },
          "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
          "differences": [
            {
              "field": "item",
              "part": "Seat LIS-JFK",
              "from": "Seat LIS-JFK",
              "to": "Seat LIS-JFK",
              "direction": "different",
              "category": "same"
            },
            {
              "field": "price",
              "from": 612,
              "to": 648,
              "delta": 36,
              "delta_pct": 5.9,
              "direction": "worse"
            },
            {
              "field": "dates",
              "from": "2027-03-12T09:05:00Z",
              "to": "2027-03-12T12:40:00Z",
              "delta": 215,
              "direction": "worse"
            }
          ],
          "result": "ask",
          "reason": "item_changed",
          "status": "open"
        }
      ],
      "retry": "wait_for_person",
      "approval_id": "appr_01M8F9N8151359BJFWVYXEAQJA",
      "ask": {
        "to": "root_person",
        "expires_at": "2026-11-27T20:17:59.749Z",
        "on_timeout": "decline",
        "options": [
          0
        ]
      },
      "decision": null,
      "acceptance": null,
      "revises": null,
      "held": null,
      "call_id": null,
      "stopped_by": null,
      "created_by": {
        "via": "account_key",
        "agent_id": null
      },
      "created_at": "2026-11-27T20:02:59.749Z",
      "updated_at": "2026-11-27T20:02:59.750Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## Remove an agent's offer rules

`DELETE /v1/authorize/offer_rules/{agent_id}`

The agent then follows the account default, which may be looser: an owner or admin, or an `admin` key.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

Removed.

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X DELETE "$PROVENANCE_API/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.delete(f"{api}/v1/authorize/offer_rules/agt_01M8F9N81SDT2VDABK2Y1420BJ", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

## Record a brief

`POST /v1/authorize/briefs`

Records what a subagent was asked to get under a grant, and who is asked when an outside agent offers something else. A brief only narrows its grant. Holder proof, the holder of a grant above it, or the account. A retry with the same `Idempotency-Key` returns the first brief.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | yes | A retry with the same key returns the first brief. |
| `side` | body | enum | no | `asking` (the default): a subagent's brief under a grant. `offering`: a business records what a buyer's agent asked for (`wants`) and its own `standard` offer, with `agent_id`; the account's key or a console session, never a grant. One of `asking`, `offering`. |
| `agent_id` | body | string | no | Offering side: the selling or support agent that will make and sign the offer. |
| `standard` | body | object | no | Offering side: the offer the business would make by default, against which its agent's concessions are measured (a lower total is a discount; better terms are a concession). |
| `standard.items` | body | array of objects | yes | The lines of the standard offer. |
| `standard.total` | body | number | yes | Its total, in major units. |
| `standard.currency` | body | string | yes | Three-letter currency code. |
| `standard.dates` | body | object | no | When, as in `wants.dates`. |
| `standard.terms` | body | object | no | Its terms, as in `wants.terms`. |
| `requester` | body | object | no | Offering side: the buyer's agent that asked, as you recorded it. |
| `requester.agent_id` | body | string | no | Its registered agent id. |
| `requester.kid` | body | string | no | Its key thumbprint. |
| `requester.origin` | body | string | no | Its origin. |
| `requester.name` | body | string | no | Its name. |
| `share` | body | boolean | no | Asking side: share `wants` into the exchange record the outside agent's side can read (never limits, `remaining`, the grant or who decides). Default false. |
| `grant_id` | body | string | no | The grant the brief lives under (the holder's own when left out). |
| `network_grant_id` | body | string | no | Instead of `grant_id`: a person's network grant (`ngr_…`), or a helper's handed-on one, with the maker's key. Its proposals are decided by the person who granted it, never a member; `grant_id` on the brief then reads this id. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |
| `run_id` | body | string | no | The agent-team run, when there is one. |
| `purpose` | body | string | no | What the brief is for. |
| `wants` | body | object | yes | What the subagent was asked to get. |
| `wants.items` | body | array of objects | yes | The lines. |
| `wants.items.name` | body | string | yes | Plain text: no links or phone numbers. |
| `wants.items.sku` | body | string | no | The seller's item code. |
| `wants.items.category` | body | string | no | Compared with a substitute's category. |
| `wants.items.quantity` | body | number | yes | How many. |
| `wants.items.unit` | body | string | no | The unit the quantity is in. |
| `wants.max_total` | body | number | no | The price line, in `currency` (major units). Within every cap and budget in the grant's chain. `0` asks for something that costs nothing, such as a cancellation. |
| `wants.currency` | body | string | yes | ISO 4217; the grant's currency when it has one. |
| `wants.dates` | body | object | no | The dates of what is offered. |
| `wants.dates.start` | body | timestamp | no | When it starts. |
| `wants.dates.end` | body | timestamp | no | When it ends. |
| `wants.flexible` | body | object | no | How far the dates may move before it counts as a difference at all. |
| `wants.flexible.earlier_minutes` | body | integer | no | Minutes earlier that still count as the same date. |
| `wants.flexible.later_minutes` | body | integer | no | Minutes later that still count as the same date. |
| `wants.terms` | body | object | no | The offer's terms. |
| `wants.terms.refundable` | body | boolean | no | Whether it can be refunded. |
| `wants.terms.cancellation_before` | body | timestamp | no | The last time it can be cancelled. |
| `wants.terms.delivery_by` | body | timestamp | no | The latest delivery the brief accepts. |
| `wants.terms.change_fee` | body | number | no | The fee to change it, in the currency. |
| `wants.counterparties` | body | array of strings | no | Who may sell it; within the grant's allowed counterparties. |
| `asked_by` | body | object | no | Who is asked when an offer differs. |
| `asked_by.kind` | body | enum | no | Who: `root_person`, `member` or `approver_link`. One of `root_person`, `member`, `approver_link`. |
| `asked_by.id` | body | string | no | The object's id. |
| `deadline` | body | timestamp | no | The time after which the brief does not apply. |

### Returns

The brief.

### Errors

- [`brief_exceeds_grant`](https://provenanceauth.com/docs/platform/errors.md#brief_exceeds_grant)
- [`asked_by_not_a_person`](https://provenanceauth.com/docs/platform/errors.md#asked_by_not_a_person)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`holder_proof_invalid`](https://provenanceauth.com/docs/platform/errors.md#holder_proof_invalid)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-1" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-1" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
data = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-1"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
```

### Response 201

```json
{
  "id": "brf_01M8DASQS0K81T04RHT9PG73RX",
  "object": "brief",
  "side": "asking",
  "status": "open",
  "grant_id": "grt_01M8DASQRKK1W22960KMWJ59Y9",
  "agent_id": null,
  "run_id": null,
  "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
  "asked_by": {
    "kind": "root_person"
  },
  "wants": {
    "items": [
      {
        "name": "Seat LIS-JFK",
        "sku": "TP209-0905",
        "category": "flight",
        "quantity": 1
      }
    ],
    "max_total": 612,
    "currency": "USD",
    "dates": {
      "start": "2027-03-12T09:05:00Z"
    },
    "terms": {
      "refundable": true
    }
  },
  "remaining": [
    {
      "name": "Seat LIS-JFK",
      "sku": "TP209-0905",
      "category": "flight",
      "quantity": 1
    }
  ],
  "brief_hash": "16098c66a08bf9b4b2396d37df8d103b5fc8cbc5c80e34deb3d762ac5caf4c0e",
  "deadline": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T01:44:26.656Z",
  "updated_at": "2026-11-27T01:44:26.656Z"
}
```

## Close a brief

`POST /v1/authorize/briefs/{id}/close`

Closes an open brief as `fulfilled` or `abandoned`. Holder proof or the account.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The brief (`brf_…`). |
| `status` | body | enum | yes | The state. One of `fulfilled`, `abandoned`. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |

### Returns

The brief.

### Errors

- [`brief_closed`](https://provenanceauth.com/docs/platform/errors.md#brief_closed)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-4" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/briefs/$BRIEF_ID/close" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "abandoned" }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-4" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs/${briefId}/close`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "status": "abandoned" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-4"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
data = httpx.post(f"{api}/v1/authorize/briefs/{brief_id}/close", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "status": "abandoned"
}).json()
```

### Response 200

```json
{
  "id": "brf_01M8DAEPM60YRAD8ZSQ6JJ8VND",
  "object": "brief",
  "side": "asking",
  "status": "abandoned",
  "grant_id": "grt_01M8DAEPM3VJEK5GEQKKX84APN",
  "agent_id": null,
  "run_id": null,
  "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
  "asked_by": {
    "kind": "root_person"
  },
  "wants": {
    "items": [
      {
        "name": "Seat LIS-JFK",
        "sku": "TP209-0905",
        "category": "flight",
        "quantity": 1
      }
    ],
    "max_total": 612,
    "currency": "USD",
    "dates": {
      "start": "2027-03-12T09:05:00Z"
    },
    "terms": {
      "refundable": true
    }
  },
  "remaining": [
    {
      "name": "Seat LIS-JFK",
      "sku": "TP209-0905",
      "category": "flight",
      "quantity": 1
    }
  ],
  "brief_hash": "8dd0d8b377e95e63355e5104fcfce5e285c4a30adbe87cd19ec7e4209d119cb7",
  "deadline": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T01:38:25.030Z",
  "updated_at": "2026-11-27T01:38:25.032Z"
}
```

## Post a counter-offer

`POST /v1/authorize/counter_offers`

Posts what an outside agent offered when it couldn't meet a brief: one to five options, signed (`offer_jwt`) or reported by your agent (`offer`). Provenance computes each option's differences and decides it at once: `within_authority`, `ask` or `refused`. The same options again return the first counter-offer.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `brief_id` | body | string | yes | The brief. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |
| `run_id` | body | string | no | The agent-team run, when there is one. |
| `channel` | body | enum | yes | Where the offer came from. One of `a2a`, `mcp`, `ucp`, `acp`, `ap2`, `web`, `voice`, `chat`, `email`. |
| `counterparty` | body | object | no | The outside agent, by `agent_id`, `kid` or `origin`. |
| `counterparty.agent_id` | body | string | no | The agent's registered id. |
| `counterparty.kid` | body | string | no | The key id the outside agent signed with. |
| `counterparty.origin` | body | string | no | The outside agent's origin. |
| `counterparty.name` | body | string | no | The name, as given. |
| `counterparty.card_url` | body | string | no | The outside agent's Agent Card URL. |
| `counterparty.call_id` | body | string | no | The registered call the offer came on (voice). |
| `options` | body | array of objects | yes | The options offered (one to five). |
| `options.label` | body | string | no | A short label for the option. |
| `options.offer_jwt` | body | string | no | A signed offer; its signed fields are the offer. An `offer+jwt` from a registered selling agent, or a compact JWS (EdDSA or ES256) over the offer's fields by a key in the outside agent's key directory at `counterparty.origin`. A key named inside the offer is never used. |
| `options.offer` | body | object | no | What one option offers. For a signed option these are the signed fields; fields sent beside a signed offer are ignored. |
| `options.offer.items` | body | array of objects | yes | The lines. |
| `options.offer.items.name` | body | string | yes | The name, as given. |
| `options.offer.items.sku` | body | string | no | The seller's item code. |
| `options.offer.items.category` | body | string | no | The item's category. |
| `options.offer.items.quantity` | body | number | yes | How many. |
| `options.offer.items.unit` | body | string | no | The unit the quantity is in. |
| `options.offer.items.unit_price` | body | number | no | The price of one unit, in the offer's currency. |
| `options.offer.total` | body | number | yes | The offer's total, in its currency (major units). |
| `options.offer.currency` | body | string | yes | ISO 4217 currency code. |
| `options.offer.dates` | body | object | no | The dates of what is offered. |
| `options.offer.dates.start` | body | timestamp | no | When it starts. |
| `options.offer.dates.end` | body | timestamp | no | When it ends. |
| `options.offer.terms` | body | object | no | The offer's terms. |
| `options.offer.terms.refundable` | body | boolean | no | Whether it can be refunded. |
| `options.offer.terms.cancellation_before` | body | timestamp | no | The last time it can be cancelled. |
| `options.offer.terms.change_fee` | body | number | no | The fee to change it, in the currency. |
| `options.offer.delivery` | body | object | no | When it is delivered. |
| `options.offer.delivery.by` | body | timestamp | no | The delivery date. |
| `options.offer.seller` | body | string | no | The seller's id or origin. |
| `options.offer.expires_at` | body | timestamp | yes | When the offer ends. |
| `options.offer.coverage` | body | enum | no | Whether the offer covers the whole brief (`full`) or part of it (`partial`). One of `full`, `partial`. |
| `options.offer.lines` | body | array of objects | no | For a partial offer: how much of each brief line it covers. |
| `options.offer.lines.brief_line` | body | integer | no | The brief line's index. |
| `options.offer.lines.quantity_offered` | body | number | no | How much of that line is offered. |
| `options.offer.tax_and_fees` | body | number | no | Tax and fees on top of the total, when declared. |
| `options.external_ref` | body | string | no | The outside agent's own reference for the option. |
| `options.note` | body | string | no | The outside agent's own words, plain text. |
| `options.action_hash` | body | string | no | an intent bought for this option (`counter_offer_id` on `POST /v1/mandate/intents`) must carry this payload hash (sha256 hex of the canonical payload). |
| `revises` | body | string | no | The counter-offer this one replaces. |
| `collect_seconds` | body | integer | no | Hold the first ask this long to gather offers from several agents. |

### Returns

The counter-offer, decided. See [the counter offer object](#object).

### Errors

- [`offer_signature_invalid`](https://provenanceauth.com/docs/platform/errors.md#offer_signature_invalid)
- [`brief_closed`](https://provenanceauth.com/docs/platform/errors.md#brief_closed)
- [`holder_proof_invalid`](https://provenanceauth.com/docs/platform/errors.md#holder_proof_invalid)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-5" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"counterparty\": {
      \"origin\": \"https://air.example\",
      \"name\": \"The airline's booking agent\"
    },
    \"options\": [
      {
        \"label\": \"12:40\",
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-1240\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 648,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T12:40:00Z\"
          },
          \"terms\": {
            \"refundable\": true
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        },
        \"note\": \"The 9:05 is full\"
      }
    ]
  }"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-5" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "counterparty": {
      "origin": "https://air.example",
      "name": "The airline's booking agent"
    },
    "options": [
      {
        "label": "12:40",
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-1240",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 648,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T12:40:00Z"
          },
          "terms": {
            "refundable": true
          },
          "expires_at": "2027-03-01T00:00:00Z"
        },
        "note": "The 9:05 is full"
      }
    ]
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-5"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
data = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "counterparty": {
        "origin": "https://air.example",
        "name": "The airline's booking agent"
    },
    "options": [
        {
            "label": "12:40",
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-1240",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 648,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T12:40:00Z"
                },
                "terms": {
                    "refundable": True
                },
                "expires_at": "2027-03-01T00:00:00Z"
            },
            "note": "The 9:05 is full"
        }
    ]
}).json()
```

### Response 201

```json
{
  "id": "cof_01M8F9N80Q5D7W4S53G1744HDE",
  "object": "counter_offer",
  "side": "asking",
  "status": "asking",
  "brief_id": "brf_01M8F9N80B1BY758DGSKQZHH59",
  "grant_id": "grt_01M8F9N801BZ5DYQV0MEDYTW6B",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "origin": "https://air.example",
    "name": "The airline's booking agent",
    "verification": "declared"
  },
  "options": [
    {
      "index": 0,
      "label": "12:40",
      "source": "reported_by_agent",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-1240",
            "category": "flight",
            "quantity": 1
          }
        ],
        "total": 648,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T12:40:00Z"
        },
        "terms": {
          "refundable": true
        },
        "expires_at": "2027-03-01T00:00:00Z"
      },
      "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
      "differences": [
        {
          "field": "item",
          "part": "Seat LIS-JFK",
          "from": "Seat LIS-JFK",
          "to": "Seat LIS-JFK",
          "direction": "different",
          "category": "same"
        },
        {
          "field": "price",
          "from": 612,
          "to": 648,
          "delta": 36,
          "delta_pct": 5.9,
          "direction": "worse"
        },
        {
          "field": "dates",
          "from": "2027-03-12T09:05:00Z",
          "to": "2027-03-12T12:40:00Z",
          "delta": 215,
          "direction": "worse"
        }
      ],
      "result": "ask",
      "reason": "item_changed",
      "note": "The 9:05 is full",
      "status": "open"
    }
  ],
  "retry": "wait_for_person",
  "approval_id": "appr_01M8F9N80WH06X7T67MZVGFXRW",
  "ask": {
    "to": "root_person",
    "expires_at": "2026-11-27T20:17:59.735Z",
    "on_timeout": "decline",
    "options": [
      0
    ]
  },
  "decision": null,
  "acceptance": null,
  "revises": null,
  "held": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T20:02:59.733Z",
  "updated_at": "2026-11-27T20:02:59.742Z"
}
```

## Accept a counter-offer option

`POST /v1/authorize/counter_offers/{id}/accept_option`

Accepts one option that is within the agent's authority, checked again now (a grant revoked, lowered or spent since the decision refuses it). One acceptance per counter-offer; the same one again returns it. The acceptance carries the offer hash and amount a purchase must match.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The counter-offer (`cof_…`). |
| `option` | body | integer | yes | The option's index. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |

### Returns

The accepted counter-offer. See [the counter offer object](#object).

### Errors

- [`counter_offer_not_accepted`](https://provenanceauth.com/docs/platform/errors.md#counter_offer_not_accepted)
- [`counter_offer_closed`](https://provenanceauth.com/docs/platform/errors.md#counter_offer_closed)
- [`counter_offer_no_longer_allowed`](https://provenanceauth.com/docs/platform/errors.md#counter_offer_no_longer_allowed)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/counter_offers/cof_01M8DA0Q5C2K7H9N4T6W1Y3R8B/accept_option" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "option": 0 }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/cof_01M8DA0Q5C2K7H9N4T6W1Y3R8B/accept_option`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "option": 0 }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/counter_offers/cof_01M8DA0Q5C2K7H9N4T6W1Y3R8B/accept_option", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "option": 0
}).json()
```

### Response 200

```json
{
  "id": "cof_01M8DA0Q5C2K7H9N4T6W1Y3R8B",
  "object": "counter_offer",
  "side": "asking",
  "status": "accepted",
  "brief_id": "brf_01M8DA0Q4Z8N2K5H7T9W1Y3R6C",
  "grant_id": "grt_01M8DA0Q4X6M1J4G6S8V0X2Q5D",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "agent_id": "agt_01M8DA0Q4V5L0H3F5R7U9W1P4E",
    "name": "TAP booking agent",
    "verification": "registered",
    "key_thumbprint": "f3Kq9xW1bC8m7Zf0vYH3eR5tU9sL6aJ1dG4hN2pQ0cA"
  },
  "options": [
    {
      "index": 0,
      "source": "signed",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-0905",
            "category": "flight",
            "quantity": 1,
            "unit_price": 598
          }
        ],
        "total": 598,
        "currency": "USD",
        "terms": {
          "refundable": true
        },
        "delivery": {
          "by": "2027-03-12T09:05:00.000Z"
        },
        "seller": "agt_01M8DA0Q4V5L0H3F5R7U9W1P4E",
        "expires_at": "2026-11-27T02:30:00.000Z"
      },
      "offer_hash": "9d2c4e1f7a3b5d8c0e6f2a4b6c8d0e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d",
      "differences": [
        {
          "field": "price",
          "from": 612,
          "to": 598,
          "delta": -14,
          "delta_pct": -2.3,
          "direction": "better"
        }
      ],
      "result": "within_authority",
      "reason": null,
      "status": "accepted"
    }
  ],
  "retry": null,
  "approval_id": null,
  "acceptance": {
    "option": 0,
    "offer_hash": "9d2c4e1f7a3b5d8c0e6f2a4b6c8d0e1f3a5b7c9d1e3f5a7b9c1d3e5f7a9b1c3d",
    "amount": 598,
    "currency": "USD",
    "expires_at": "2026-11-27T02:30:00.000Z",
    "accepted_by": {
      "kind": "authority",
      "tolerance": "no_worse"
    },
    "accepted_at": "2026-11-27T02:00:00.000Z",
    "consumed_at": null
  },
  "revises": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "holder",
    "agent_id": "agt_01M8DA0Q4T4K9G2E4Q6T8V0N3F"
  },
  "created_at": "2026-11-27T01:59:00.000Z",
  "updated_at": "2026-11-27T02:00:00.000Z"
}
```

## Withdraw a counter-offer

`POST /v1/authorize/counter_offers/{id}/withdraw`

The agent stopped looking, or the outside agent withdrew: an open counter-offer closes as `withdrawn`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The counter-offer (`cof_…`). |
| `reason` | body | enum | no | Why. One of `agent_stopped`, `counterparty_withdrew`. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |

### Returns

The withdrawn counter-offer. See [the counter offer object](#object).

### Errors

- [`counter_offer_closed`](https://provenanceauth.com/docs/platform/errors.md#counter_offer_closed)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-8" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"counterparty\": {
      \"origin\": \"https://air.example\"
    },
    \"options\": [
      {
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-1240\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 648,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T12:40:00Z\"
          },
          \"terms\": {
            \"refundable\": true
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID/withdraw" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "counterparty_withdrew" }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-8" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "counterparty": {
      "origin": "https://air.example"
    },
    "options": [
      {
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-1240",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 648,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T12:40:00Z"
          },
          "terms": {
            "refundable": true
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}/withdraw`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "reason": "counterparty_withdrew" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-8"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "counterparty": {
        "origin": "https://air.example"
    },
    "options": [
        {
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-1240",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 648,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T12:40:00Z"
                },
                "terms": {
                    "refundable": True
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
data = httpx.post(f"{api}/v1/authorize/counter_offers/{counter_offer_id}/withdraw", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "reason": "counterparty_withdrew"
}).json()
```

### Response 200

```json
{
  "id": "cof_01M8F9N81WW0Q22RVRZ5NNPSX8",
  "object": "counter_offer",
  "side": "asking",
  "status": "withdrawn",
  "brief_id": "brf_01M8F9N81TBCPDYW352FQPV3MM",
  "grant_id": "grt_01M8F9N81SDT2VDABK2Y1420BJ",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "origin": "https://air.example",
    "verification": "declared"
  },
  "options": [
    {
      "index": 0,
      "source": "reported_by_agent",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-1240",
            "category": "flight",
            "quantity": 1
          }
        ],
        "total": 648,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T12:40:00Z"
        },
        "terms": {
          "refundable": true
        },
        "expires_at": "2027-03-01T00:00:00Z"
      },
      "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
      "differences": [
        {
          "field": "item",
          "part": "Seat LIS-JFK",
          "from": "Seat LIS-JFK",
          "to": "Seat LIS-JFK",
          "direction": "different",
          "category": "same"
        },
        {
          "field": "price",
          "from": 612,
          "to": 648,
          "delta": 36,
          "delta_pct": 5.9,
          "direction": "worse"
        },
        {
          "field": "dates",
          "from": "2027-03-12T09:05:00Z",
          "to": "2027-03-12T12:40:00Z",
          "delta": 215,
          "direction": "worse"
        }
      ],
      "result": "ask",
      "reason": "item_changed",
      "status": "open"
    }
  ],
  "retry": "find_another",
  "approval_id": "appr_01M8F9N81W44FQ5KCX1Y3NMG94",
  "ask": {
    "to": "root_person",
    "expires_at": "2026-11-27T20:17:59.772Z",
    "on_timeout": "decline",
    "options": [
      0
    ]
  },
  "decision": null,
  "acceptance": null,
  "revises": null,
  "held": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-27T20:02:59.771Z",
  "updated_at": "2026-11-27T20:02:59.777Z"
}
```

## Decline a counter-offer

`POST /v1/authorize/counter_offers/{id}/decline`

The requesting side declines an open counter-offer, with an optional reason the other side may see. It only tightens, so it never needs a person; an open ask to the person closes. The decision is written to the exchange record (`decision`, `by: agent`).

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The counter-offer (`cof_…`). |
| `reason` | body | enum | no | Why, shared with the other side. One of `price`, `terms`, `timing`, `other`. |
| `grant_token` | body | string | no | Holder proof: the agent's own grant token (with its signature over the request); leave it out with an account key. |

### Returns

The declined counter-offer. See [the counter offer object](#object).

### Errors

- [`counter_offer_closed`](https://provenanceauth.com/docs/platform/errors.md#counter_offer_closed)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/grants" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya'\''s Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' > step.json
export GRANT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: brief-lisbon-flight-decline" \
  -H "Content-Type: application/json" \
  -d "{
    \"grant_id\": \"$GRANT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      },
      \"terms\": {
        \"refundable\": true
      }
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"counterparty\": {
      \"origin\": \"https://air.example\"
    },
    \"options\": [
      {
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-1240\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 648,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T12:40:00Z\"
          },
          \"terms\": {
            \"refundable\": true
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID/decline" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "price" }'
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
      "max_amount": 1300,
      "budget_amount": 2400,
      "budget_window": "month",
      "currency": "USD",
      "accept_within": {
        "price_up_pct": 5,
        "date_later_minutes": 120
      },
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }),
})).json();
const grantId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "brief-lisbon-flight-decline" },
  body: JSON.stringify({
    "grant_id": grantId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      },
      "terms": {
        "refundable": true
      }
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "counterparty": {
      "origin": "https://air.example"
    },
    "options": [
      {
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-1240",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 648,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T12:40:00Z"
          },
          "terms": {
            "refundable": true
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}/decline`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "reason": "price" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book Maya's Lisbon trip, 12 to 16 March",
    "constraints": {
        "max_amount": 1300,
        "budget_amount": 2400,
        "budget_window": "month",
        "currency": "USD",
        "accept_within": {
            "price_up_pct": 5,
            "date_later_minutes": 120
        },
        "expires_at": "2027-12-31T23:59:59Z"
    }
}).json()
grant_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "brief-lisbon-flight-decline"}, json={
    "grant_id": grant_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        },
        "terms": {
            "refundable": True
        }
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "counterparty": {
        "origin": "https://air.example"
    },
    "options": [
        {
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-1240",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 648,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T12:40:00Z"
                },
                "terms": {
                    "refundable": True
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
data = httpx.post(f"{api}/v1/authorize/counter_offers/{counter_offer_id}/decline", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "reason": "price"
}).json()
```

### Response 200

```json
{
  "id": "cof_01M8HWP6KHXQWF937FSP3Z1RYM",
  "object": "counter_offer",
  "side": "asking",
  "status": "declined",
  "brief_id": "brf_01M8HWP6KGGEP58RFH1JW5SGCM",
  "grant_id": "grt_01M8HWP6KFGKD5KWMJ1024YP20",
  "run_id": null,
  "channel": "a2a",
  "counterparty": {
    "origin": "https://air.example",
    "verification": "declared"
  },
  "options": [
    {
      "index": 0,
      "source": "reported_by_agent",
      "offer": {
        "items": [
          {
            "name": "Seat LIS-JFK",
            "sku": "TP209-1240",
            "category": "flight",
            "quantity": 1
          }
        ],
        "total": 648,
        "currency": "USD",
        "dates": {
          "start": "2027-03-12T12:40:00Z"
        },
        "terms": {
          "refundable": true
        },
        "expires_at": "2027-03-01T00:00:00Z"
      },
      "offer_hash": "99e31a9716993e671300ef8761fac8261bafa8eefe8181edf48daa3d05877c6c",
      "differences": [
        {
          "field": "item",
          "part": "Seat LIS-JFK",
          "from": "Seat LIS-JFK",
          "to": "Seat LIS-JFK",
          "direction": "different",
          "category": "same"
        },
        {
          "field": "price",
          "from": 612,
          "to": 648,
          "delta": 36,
          "delta_pct": 5.9,
          "direction": "worse"
        },
        {
          "field": "dates",
          "from": "2027-03-12T09:05:00Z",
          "to": "2027-03-12T12:40:00Z",
          "delta": 215,
          "direction": "worse"
        }
      ],
      "result": "ask",
      "reason": "item_changed",
      "status": "open"
    }
  ],
  "retry": null,
  "approval_id": "appr_01M8HWP6KJZQ0VHW717WPVSWFG",
  "ask": {
    "to": "root_person",
    "expires_at": "2026-11-29T20:14:02.865Z",
    "on_timeout": "decline",
    "options": [
      0
    ]
  },
  "decision": {
    "kind": "decline",
    "by": "agent",
    "at": "2026-11-28T20:14:02.868Z",
    "reason": "price"
  },
  "acceptance": null,
  "revises": null,
  "held": null,
  "call_id": null,
  "stopped_by": null,
  "created_by": {
    "via": "account_key",
    "agent_id": null
  },
  "created_at": "2026-11-28T20:14:02.864Z",
  "updated_at": "2026-11-28T20:14:02.869Z"
}
```

## Check which options may be signed

`POST /v1/authorize/counter_offers/{id}/sign_check`

Offering side: which of your agent's options may be signed now (cleared by your offer rules, a staff member's yes, or the rules' timeout setting), each with the `offer_hash` to sign. Sign only those, with your agent's own key. The account's key or a console session.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The offering-side counter-offer (`cof_…`). |

### Returns

Each option, and whether it may be signed.

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Kestrel Air booking agent" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: offer-sample-signcheck" \
  -H "Content-Type: application/json" \
  -d "{
    \"side\": \"offering\",
    \"agent_id\": \"$AGENT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"standard\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"total\": 650,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"requester\": {
      \"name\": \"Flights\"
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"options\": [
      {
        \"label\": \"9:05 at list\",
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-0905\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 650,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T09:05:00Z\"
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl -X POST "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID/sign_check" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "Kestrel Air booking agent" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "offer-sample-signcheck" },
  body: JSON.stringify({
    "side": "offering",
    "agent_id": agentId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "standard": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "total": 650,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "requester": {
      "name": "Flights"
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "options": [
      {
        "label": "9:05 at list",
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-0905",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 650,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T09:05:00Z"
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}/sign_check`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "Kestrel Air booking agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "offer-sample-signcheck"}, json={
    "side": "offering",
    "agent_id": agent_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "standard": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "total": 650,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "requester": {
        "name": "Flights"
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "options": [
        {
            "label": "9:05 at list",
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-0905",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 650,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T09:05:00Z"
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
data = httpx.post(f"{api}/v1/authorize/counter_offers/{counter_offer_id}/sign_check", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "sign_check",
  "counter_offer_id": "cof_01M8GDJVVXHBYE3T6K6SPHJWR4",
  "status": "open",
  "options": [
    {
      "index": 0,
      "offer_hash": "c67b354508443ca58b8c567da1841332dcb2aad0a4a0657cb6466c9d2365903f",
      "may_sign": true,
      "cleared_by": "rules",
      "result": "within_authority",
      "reason": null
    }
  ]
}
```

## Check an authority proof's status

`GET /v1/public/authority_proofs/{jti}/status`

Before an outside agent commits: `active`, `used` (a purchase used the acceptance), `revoked` (the counter-offer closed, another option was taken or the grant chain stopped) or `expired`. Nothing else. A proof is valid only after this answers `active`; an unknown proof is 404, which reads as revoked. No API key needed; 60 a minute per IP.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `jti` | path | string | yes | The proof's `jti` (`atp_…`). |

### Returns

The proof's status.

### Errors

- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
curl "$PROVENANCE_API/v1/public/authority_proofs/atp_01M8FT65A4N7Q2W9E3R5T8Y1U6/status"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/authority_proofs/atp_01M8FT65A4N7Q2W9E3R5T8Y1U6/status`)).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/public/authority_proofs/atp_01M8FT65A4N7Q2W9E3R5T8Y1U6/status").json()
```

### Response 200

```json
{
  "object": "authority_proof_status",
  "jti": "atp_01M8FT65A4N7Q2W9E3R5T8Y1U6",
  "status": "active"
}
```
