post_org_self_delete_by_orgid_by_requestid_confirm

Changes data · you confirm first

Calls POST /api/org-self-delete/{orgId}/{requestId}/confirm as the signed-in person · REST reference

Confirm deleting an organization with the emailed code

The person who made the request, signed in as themselves (403 for anyone else). An organization with no parent is deleted now (DELETED) — the blockers are read again inside the deleting transaction, and one that has appeared since is a 409 that leaves the request and its code as they were. A child organization's request moves on to its parent (AWAITING_PARENT), whose admins are emailed. Wrong, expired, exhausted and missing are distinct 400s (INVALID_CODE, CODE_EXPIRED, TOO_MANY_ATTEMPTS, NO_PENDING_REQUEST); three wrong codes cancel the request. Refused while impersonating.

Arguments

ArgumentTypeDescription
orgIdpathstring (uuid)required
requestIdpathstring (uuid)required
bodyJSONobjectrequiredThe request body, as a JSON object. Its fields are listed below.

Fields of body

FieldTypeDescription
codestringrequired6-digit code. Non-digits are stripped before the length check.

Example call

A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "post_org_self_delete_by_orgid_by_requestid_confirm",
    "arguments": {
      "orgId": "11111111-1111-4111-8111-111111111111",
      "requestId": "11111111-1111-4111-8111-111111111111",
      "body": {
        "code": "string"
      }
    }
  }
}
Confirmation
The client shows the person the exact request and waits. Nothing runs until they tick Make this change. See Reading and changing.

Result

On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.

Deleted (DELETED), or awaiting the parent (AWAITING_PARENT).

json
{
  "data": {
    "outcome": "DELETED",
    "request": {
      "createdAt": 1,
      "expiresAt": 1,
      "id": "11111111-1111-4111-8111-111111111111",
      "orgId": "11111111-1111-4111-8111-111111111111",
      "orgName": "string",
      "requestedBy": {},
      "status": "AWAITING_CODE",
      "cancelledAt": 1,
      "completedAt": 1,
      "confirmedAt": 1,
      "decidedAt": 1,
      "parentOrgId": "11111111-1111-4111-8111-111111111111",
      "parentOrgName": "string",
      "reason": "string"
    }
  },
  "success": true
}

Fields

FieldTypeDescription
dataobject
data.outcome"DELETED" | "AWAITING_PARENT"
data.requestobject
data.request.cancelledAtinteger | null
data.request.completedAtinteger | null
data.request.confirmedAtinteger | null
data.request.createdAtintegerEpoch milliseconds.
data.request.decidedAtinteger | null
data.request.expiresAtintegerEpoch milliseconds — the current step's deadline: the code's (OTP_EXPIRY_SECONDS), then seven days for the parent.
data.request.idstring (uuid)
data.request.orgIdstring (uuid)
data.request.orgNamestring
data.request.parentOrgIdstring (uuid) | nullThe parent organization that must approve; null when there is none.
data.request.parentOrgNamestring | null
data.request.reasonstring | nullWhy it was cancelled or declined.
data.request.requestedByobject
data.request.status"AWAITING_CODE" | "AWAITING_PARENT" | "COMPLETED" | "CANCELLED" | "DECLINED" | "EXPIRED"AWAITING_CODE until the owner enters the emailed code; AWAITING_PARENT while a child organization waits for its parent; COMPLETED once deleted. CANCELLED and DECLINED carry reason. EXPIRED when the current step's deadline passed.
successtrue

When it fails

A failed call returns isError: true with the API's message as text. A change the person declines, or lets time out, also comes back this way and nothing changes.

400

The request was malformed or failed a guard.

403

Authenticated, but the caller holds none of the required permissions.

404

No such resource — or none this caller may see.

409

The resource is not in a state that allows this operation.

What the model is shown

This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.

json
{
  "name": "post_org_self_delete_by_orgid_by_requestid_confirm",
  "description": "POST /api/org-self-delete/{orgId}/{requestId}/confirm — The person who made the request, signed in as themselves (403 for anyone else). An organization with no parent is deleted now (DELETED) — the blockers are read again inside the deleting transaction, and one that has appeared since is a 409 that leaves the request and its code as they were. A child organization's request moves on to its parent (AWAITING_PARENT), whose admins are emailed. Wrong, expired, exhausted and missing are distinct 400s (INVALID_CODE, CODE_EXPIRED, TOO_MANY_ATTEMPTS, NO_PENDING_REQUEST); three wrong codes cancel the request. Refused while impersonating.\n\nThis changes data. The person is asked to confirm it before it runs, and nothing happens if they decline.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "orgId": {
        "type": "string"
      },
      "requestId": {
        "type": "string"
      },
      "body": {
        "type": "string",
        "description": "The JSON request body: { code*: string (6-digit code.) }"
      }
    },
    "required": [
      "orgId",
      "requestId",
      "body"
    ]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": false,
    "openWorldHint": false
  }
}