# Cancel pending approval

> Withdraw a call kept for the user's approval, by its pending_action_id - it will not be carried out.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: yes
- Stability: stable
- MCP tool: `manitu_approval_cancel` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/approval/cancel`
- Counts against: [writes](/rate-limits/#limit-writes) (60 per hour per account)
- Page: /reference/approval/cancel/

## MCP tool

`manitu_approval_cancel`

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

### Description for the model

Withdraws a call this access made that waits for the user's approval in the customer panel, by its pending_action_id: it will not be carried out, and the user no longer sees it as waiting. Use it when the call is no longer wanted, or was made by mistake - not to change it: make the new call, and withdraw the old one. Refused when it no longer waits (approval_not_pending, with its status) - then it is decided already.

Reasons it may answer: resource_not_found, approval_not_pending.

### Arguments

- `pending_action_id` (string, required) - The pending_action_id that approval_required answered, passed as it is. (minLength `1`; maxLength `40`; pattern `"^[^\\x00-\\x1F\\x7F]*$"`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_approval_cancel",
    "arguments": {
      "pending_action_id": "string"
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/approval/cancel`

**This request changes something.**

### Description

Withdraws a call of the calling access that waits for approval in the customer panel, by its pending_action_id: it is not carried out, and it no longer shows as waiting. Refused when the call does not wait any more (approval_not_pending, with its status), and when there is no such call (resource_not_found).

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `pending_action_id` (string, required) - The pending_action_id that approval_required answered, passed as it is. (minLength `1`; maxLength `40`; pattern `"^[^\\x00-\\x1F\\x7F]*$"`)

### Response

In `data`; the rest of the body as on every call.

- `pending_action_id` (string, required) - The id, not guessable, bound to the account and the access that made it. (minLength `1`; maxLength `255`)
- `status` (any, required) - pending: waits for the person; approved: approved, not carried out yet; executed: carried out, result is its answer; failed: carried out, it failed - result says how; unverified: carried out, whether it took effect is not known; declined: the person said no; expired: nobody decided in time; cancelled: the caller withdrew it. (one of `"pending"`, `"approved"`, `"executed"`, `"failed"`, `"unverified"`, `"declined"`, `"expired"`, `"cancelled"`)
- `operation_id` (string | null) - The operation of the route export it carries out; null where the backend does not say. (pattern `"^[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*$"`)
- `created_at` (string, required) - (format `date-time`)
- `expires_at` (string, required) - Until when it waits for the person. (format `date-time`)
- `decided_at` (string | null) - When it was approved, declined, cancelled or expired; null while it is pending. (format `date-time`)
- `decided_via` (string | null) - Where it was decided: panel - the backend's own user interface; api - a call of the backend (cancelled); an open set, lower_snake_case. null while it is pending. (pattern `"^[a-z][a-z0-9]*(_[a-z0-9]+)*$"`)
- `approval` (object) - The approval it waits for - the ways while it is pending, none once it is decided. Not under approval_required, where it stands beside it as params.approval.
  - `approval.required_level` (any, required) - The level of approval the call needs (components/1/approval-levels.json). A reader compares ranks, never names. (one of `"none"`, `"client_dialog"`, `"caller_confirmation"`, `"client_click"`, `"signed_in_person"`, `"fresh_second_factor"`)
  - `approval.concerns` (array of any, required) - What the approval is about, at least one, each once: terms (a declaration on terms), price (it costs money), contract (a contract is concluded, changed or ended), irreversible (what is deleted or overwritten cannot be brought back), downtime (a service is unreachable for a while), service_access (someone gets access to a service or its data), account_access (who can access the account changes), ownership (something leaves the account or changes its owner), disclosure (data goes to a party outside the account). A closed set; a new value comes with a new release of the spec. An approval given in advance never covers terms or price. (minItems `1`; uniqueItems `true`)
  - `approval.raised_by` (array of any, required) - Why the level is above what the operation needs at least, where it is: consumer_price (it costs a consumer money), outside_content (this credential read content from the internet shortly before), account_rule (the account has it so), input_content (what the call sets runs code or sends data out of the account), input_field (the call sends a field the operation asks more for, approval_by_field of the route export). Empty where the level is the operation's own. A closed set; a new value comes with a new release of the spec. (uniqueItems `true`)
  - `approval.elements` (array of object, required) - What the approval is about, each shown as it is - may be empty.
    - `approval.elements[].kind` (any, required) - document, text, declaration - what the person agrees to; subject, change, consequence - what is done and what follows; price - what it costs. (one of `"document"`, `"text"`, `"price"`, `"declaration"`, `"subject"`, `"change"`, `"consequence"`)
    - `approval.elements[].code` (string | null) - What it is, as a code - required by a reader for document, text and declaration, which are logged by it. (pattern `"^[a-z][a-z0-9]*(_[a-z0-9]+)*$"`)
    - `approval.elements[].title` (string | null) - Its title, in language.
    - `approval.elements[].language` (string | null) - The language of title and text - the binding wording. (pattern `"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"`)
    - `approval.elements[].url` (string | null) - Where the document is; a document only.
    - `approval.elements[].text` (string | null) - The text, shown as it is: of a text, a declaration (a sentence in the first person) or a consequence.
    - `approval.elements[].label` (string | null) - Of a subject or a change: what it is about (Server, Package).
    - `approval.elements[].value` (string | null) - Of a subject: which one (vs-1002).
    - `approval.elements[].before` (string | null) - Of a change: the value now.
    - `approval.elements[].after` (string | null) - Of a change: the value after.
    - `approval.elements[].price` (object) - Of a price: what it costs.
      - `approval.elements[].price.charges` (array of object, required) - The charges, at least one - e.g. a prorated amount now and the new plan per year. (minItems `1`)
        - `approval.elements[].price.charges[].code` (string, required) - What the charge is for, a lower_snake_case code of the backend, e.g. domain_fee, plan_fee - the reader translates it. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
        - `approval.elements[].price.charges[].billing` (object, required) - How the charge is billed.
          - `approval.elements[].price.charges[].billing.kind` (string, required) - one_time: charged once; recurring: charged per period; usage: charged by use, per unit, settled per period. An open set: a reader that does not know a kind shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
          - `approval.elements[].price.charges[].billing.period` (object) - The billing period - with recurring and usage, not with one_time.
            - `approval.elements[].price.charges[].billing.period.unit` (string, required) - hour, day, month, year, or the unit a usage charge counts in - an open set of lower_snake_case codes. A reader that does not know one shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
            - `approval.elements[].price.charges[].billing.period.length` (integer, required) - How many of the unit, at least 1. (minimum `1`)
          - `approval.elements[].price.charges[].billing.per` (object) - The unit a usage charge counts, e.g. 1 hour - with usage, and only there.
            - `approval.elements[].price.charges[].billing.per.unit` (string, required) - hour, day, month, year, or the unit a usage charge counts in - an open set of lower_snake_case codes. A reader that does not know one shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
            - `approval.elements[].price.charges[].billing.per.length` (integer, required) - How many of the unit, at least 1. (minimum `1`)
        - `approval.elements[].price.charges[].usage` (object) - What bounds a usage charge - with usage only.
          - `approval.elements[].price.charges[].usage.cap` (any) - The most the charge comes to per billing period - binding, with the digits of the currency.
          - `approval.elements[].price.charges[].usage.included` (object) - How much of the unit is in the price before the rate applies - in the unit of billing.per.
            - `approval.elements[].price.charges[].usage.included.unit` (string, required) - hour, day, month, year, or the unit a usage charge counts in - an open set of lower_snake_case codes. A reader that does not know one shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
            - `approval.elements[].price.charges[].usage.included.length` (integer, required) - How many of the unit, at least 1. (minimum `1`)
        - `approval.elements[].price.charges[].condition` (string) - When the charge is due at all, a lower_snake_case code: on_success - only when what it is for succeeds. An open set; not there: always. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
        - `approval.elements[].price.charges[].service_period` (object) - The days the charge covers, the first and the last both included - e.g. the rest of a period on a change of plan.
          - `approval.elements[].price.charges[].service_period.from` (string, required) - The first day. (format `date`)
          - `approval.elements[].price.charges[].service_period.to` (string, required) - The last day. (format `date`)
        - `approval.elements[].price.charges[].phases` (array of object, required) - What the charge amounts to, phase by phase, in order: each begins where the one before it ends. A one_time charge has one phase, without cycles; the last phase of a recurring or usage charge has cycles null, and only that one. (minItems `1`)
          - `approval.elements[].price.charges[].phases[].kind` (string, required) - trial, promo or regular. An open set: a reader that does not know a kind shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
          - `approval.elements[].price.charges[].phases[].cycles` (integer | null) - How many billing periods the phase lasts; null: without end. Not there with one_time. (minimum `1`)
          - `approval.elements[].price.charges[].phases[].period` (object) - The billing period of this phase, where it differs from billing.period - e.g. three months free of a yearly plan.
            - `approval.elements[].price.charges[].phases[].period.unit` (string, required) - hour, day, month, year, or the unit a usage charge counts in - an open set of lower_snake_case codes. A reader that does not know one shows the price by its summary. (pattern `"^[a-z0-9]+(_[a-z0-9]+)*$"`)
            - `approval.elements[].price.charges[].phases[].period.length` (integer, required) - How many of the unit, at least 1. (minimum `1`)
          - `approval.elements[].price.charges[].phases[].amount` (any, required) - What is charged per period of the phase - never per month unless the period is one. With usage: per unit of billing.per, and it may have more digits than the currency.
      - `approval.elements[].price.summary` (string) - The whole price in one sentence, in the language of the answer, as the backend writes it - what a reader shows where it does not know a code. Never instead of the charges. (minLength `1`; maxLength `1000`)
  - `approval.ways` (array of object, required) - How it can be given, the best first; the last is the fallback. A reader takes the first it can use and passes over a kind it does not know. Empty once a kept call is decided.
    - `approval.ways[].kind` (string, required) - call_again - the caller sends the same call again with token in the input field parameter, after an explicit yes of the person; panel - a person approves it in the backend's own user interface, at url. An open set, lower_snake_case. (pattern `"^[a-z][a-z0-9]*(_[a-z0-9]+)*$"`)
    - `approval.ways[].token` (string) - Of call_again: what to send with the same call again - bound to this call and its input. (minLength `1`; maxLength `255`)
    - `approval.ways[].parameter` (string) - Of call_again: the input field the token goes in - a protocol parameter of the operation, approval_token. (pattern `"^[a-z][a-z0-9]*(_[a-z0-9]+)*$"`)
    - `approval.ways[].url` (string) - Of panel: the page where the person approves it. A pointer only - the person signs in there all the same. (minLength `1`)
  - `approval.expires_at` (string | null, required) - Until when the approval can be given; null where the backend does not say. (format `date-time`)
- `result` (object | null) - The structured answer of the operation it carried out, once executed, failed or unverified; null until then.
- `created_by` (object, required) - Who made it - for the main access, which sees the calls of every access of the account.
  - `created_by.account_user_id` (integer, required) - The access that made it.
  - `created_by.type` (string, required) - primary: the main access; secondary: a sub access. (one of `"primary"`, `"secondary"`, `"ngcobalt_site_mail_user"`)
  - `created_by.description` (string | null, required) - The description written for it, null if nothing - not its name or user name.

### Statuses

- `200` Success.
- `400` The input is wrong, or the request itself (INVALID_INPUT). Each entry names its field and its reason - correct the input and call again.
- `401` No credential was presented, or it was not recognised (UNAUTHENTICATED).
- `403` The credential is valid, but may not do this (PERMISSION_DENIED). The reason says why - another credential is the way, not a repeat.
- `404` What the call names does not exist, or not for this caller (NOT_FOUND). Look it up again - do not guess another.
- `409` Not possible in the current state (PRECONDITION_FAILED). The reason says what stands in the way; the same call may succeed once it has changed.
- `429` Too many calls. The Retry-After header says when to try again.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST \
  'https://api.manitu.de/v1/approval/cancel' \
  -H "X-API-Key: $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"pending_action_id":"string"}'
```

## Example result

```json
{
  "pending_action_id": "string",
  "status": "pending",
  "operation_id": "string",
  "created_at": "2026-10-23T12:00:00+02:00",
  "expires_at": "2026-10-23T12:00:00+02:00",
  "decided_at": "2026-10-23T12:00:00+02:00",
  "decided_via": "string",
  "approval": {
    "required_level": "none",
    "concerns": [
      "terms"
    ],
    "raised_by": [
      "consumer_price"
    ],
    "elements": [
      {
        "kind": "document",
        "code": "string",
        "title": "string",
        "language": "string",
        "url": "https://www.example.com/",
        "text": "string",
        "label": "string",
        "value": "string",
        "before": "string",
        "after": "string",
        "price": {
          "charges": [
            {
              "code": "string",
              "billing": {
                "kind": "string",
                "period": {
                  "unit": null,
                  "length": null
                },
                "per": {
                  "unit": null,
                  "length": null
                }
              },
              "usage": {
                "cap": "string",
                "included": {
                  "unit": null,
                  "length": null
                }
              },
              "condition": "string",
              "service_period": {
                "from": "2026-10-23",
                "to": "2026-10-23"
              },
              "phases": [
                {
                  "kind": null,
                  "cycles": null,
                  "period": null,
                  "amount": null
                }
              ]
            }
          ],
          "summary": "string"
        }
      }
    ],
    "ways": [
      {
        "kind": "string",
        "token": "eyJwYWdlIjoyfQ",
        "parameter": "string",
        "url": "https://www.example.com/"
      }
    ],
    "expires_at": "2026-10-23T12:00:00+02:00"
  },
  "result": {},
  "created_by": {
    "account_user_id": 12345,
    "type": "primary",
    "description": "Example"
  }
}
```

## Errors

Reasons it is known to fail with - any other may come too; act on the class.

- [`resource_not_found`](/errors/resource_not_found.md) (`NOT_FOUND`) - What the call names does not exist in the account, or not for this access.
- [`approval_not_pending`](/errors/approval_not_pending.md) (`PRECONDITION_FAILED`) - It no longer waits for an approval - it was decided, carried out or has expired.
