# Ask for a change to an approval

URL: /agents/ask-for-a-change-to-an-approval · Id: `guide:ask-for-a-change-to-an-approval`

> Send one Approval back to the agent that asked, with the change you want: the Action keeps waiting until you answer the new request.

Name the [Approval](/business/nouns/approval) and the change, and your agent reads it back before it sends it back. The [Action](/business/nouns/action) keeps waiting, and the agent returns a new Approval for the changed request, which you [answer](/agents/answer-an-approval) or [refuse](/agents/refuse-an-approval).

**Before it runs**

- Asks you first: You do it yourself: only a person answers an [Approval](/business/nouns/approval), never an agent.
- You leave the chat: Never.

## What you get
- 1 the Approval you named, read back to you before anything is answered (Approval)
- 1 change sent to the agent that asked, on the Approval (Approval)
- 1 new Approval for the changed request, waiting on you (Approval)

## Your agent does
**For agents**

- Guide: `guide:ask-for-a-change-to-an-approval`. Page: [/agents/ask-for-a-change-to-an-approval.md](/agents/ask-for-a-change-to-an-approval.md).
- Approval: ask the founder first. Show the run, then wait for their Approval; a refusal ends it.
- Leaves the chat: never.
- Run: call the steps in order, each through the API, CLI, MCP or SDK tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.
- Retry: each write sends the Idempotency-Key `ask-for-a-change-to-an-approval-<the Startup's domain>-<run>-<step>` (`ask-for-a-change-to-an-approval-leaseline.app-$RUN-1` for step 1 of the worked example), in the API and CLI as a header or flag and in the SDK as `{ idempotencyKey }`. Mint `run` once per founder request (`RUN=$(uuidgen)`, `crypto.randomUUID()`): the same ask made again later is a new request with a new run, so it runs again. After a timeout, rerun with the same run: api.sb returns each finished step's first Action and runs nothing twice.
- Retry in MCP: the `do` call carries `idempotencyKey: "ask-for-a-change-to-an-approval-<the Startup's domain>-<run>"`, and each write inside sends it plus `-<n>`, its call number. Rerun the same code with the same key after a timeout: finished calls return their first Action, and only the rest run.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Approval.get`](/business/nouns/approval/get) (`verb:Approval.get`) | `id` string, required: example `"approval_o2PM4EUAdC"` | `approval` Approval |
| 2 | [`Approval.requestChange`](/business/nouns/approval/request-change) (`verb:Approval.requestChange`) | `approval` Approval (an id), required: example `"approval_o2PM4EUAdC"`; `change` text, required: example `"Find a plan under $400 a month."` | `approval` Approval |

Returns: the last call answers with `approval` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "approval": {
    "$id": "https://api.sb/leaseline.app/approvals/approval_o2PM4EUAdC",
    "$type": "Approval"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Approval.requestChange",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

Next: offer “Approve the new one”, or “Refuse it instead”.

Calls: `Approval.get` → `Approval.requestChange`

Ask:

```text
Find a cheaper option, then I will decide.
Send it back with a smaller budget.
Change the request, then show me again.
```

API:

```bash
# 1. Approval.get
RUN=$(uuidgen)  # once per request; reuse it only to retry this request
curl https://api.sb/leaseline.app/approvals/approval_o2PM4EUAdC \
  -H "Authorization: Bearer $SB_TOKEN"

# 2. Approval.requestChange
curl -X POST https://api.sb/leaseline.app/approvals/approval_o2PM4EUAdC/requestChange \
  -H "Authorization: Bearer $SB_TOKEN" \
  -H "Idempotency-Key: ask-for-a-change-to-an-approval-leaseline.app-$RUN-2" \
  -H "Content-Type: application/json" \
  -d '{"change":"Find a plan under $400 a month."}'
```

CLI:

```bash
RUN=$(uuidgen)  # once per request; reuse it only to retry this request
npx startup-builder do Approval.get --data '{"id":"approval_o2PM4EUAdC"}'
npx startup-builder do Approval.requestChange --data '{"approval":"approval_o2PM4EUAdC","change":"Find a plan under $400 a month."}' --idempotency-key ask-for-a-change-to-an-approval-leaseline.app-$RUN-2
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Approval.get({ id: 'approval_o2PM4EUAdC' })\nreturn await $.Approval.requestChange({ approval: 'approval_o2PM4EUAdC', change: 'Find a plan under $400 a month.' })",
    "idempotencyKey": "ask-for-a-change-to-an-approval-leaseline.app-<run>"
  }
}
```

SDK:

```ts
import { $ } from 'startup-builder'

const run = crypto.randomUUID() // once per request; reuse it only to retry this request
await $.Approval.get({ id: 'approval_o2PM4EUAdC' })
await $.Approval.requestChange({ approval: 'approval_o2PM4EUAdC', change: 'Find a plan under $400 a month.' }, { idempotencyKey: `ask-for-a-change-to-an-approval-leaseline.app-${run}-2` })
```

## Change it
- Approve the new one.
- Refuse it instead.
- Show me what is still waiting.

## Under the hood
- Systems: [Work queue](/agents/work-queue)
- Nouns: [Approval](/business/nouns/approval), [Action](/business/nouns/action)
- Events: [`Approval.changeRequested`](/business/events/Approval.changeRequested)