post_org_self_delete_by_orgid_by_requestid_decision

Changes data · you confirm first

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

Approve or decline deleting a child organization

orgId is the CHILD. Someone holding org.manage in the child's parent, other than the person who requested it (403). Approving deletes the child (DELETED) — the blockers are read again inside the deleting transaction, and one that has appeared since is a 409 that leaves the request awaiting the parent. Declining closes it (DECLINED) with the optional reason. The requester is emailed either way. A request that lapsed is 409 REQUEST_EXPIRED; one whose child moved to another parent is cancelled, 409 REQUEST_CANCELLED. 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
approvebooleanrequired
reasonstring

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_decision",
    "arguments": {
      "orgId": "11111111-1111-4111-8111-111111111111",
      "requestId": "11111111-1111-4111-8111-111111111111",
      "body": {
        "approve": true,
        "reason": "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 declined (DECLINED).

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" | "DECLINED"
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_decision",
  "description": "POST /api/org-self-delete/{orgId}/{requestId}/decision — `orgId` is the CHILD. Someone holding `org.manage` in the child's parent, other than the person who requested it (403). Approving deletes the child (DELETED) — the blockers are read again inside the deleting transaction, and one that has appeared since is a 409 that leaves the request awaiting the parent. Declining closes it (DECLINED) with the optional reason. The requester is emailed either way. A request that lapsed is 409 REQUEST_EXPIRED; one whose child moved to another parent is cancelled, 409 REQUEST_CANCELLED. 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: { approve*: boolean; reason: string }"
      }
    },
    "required": [
      "orgId",
      "requestId",
      "body"
    ]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": false,
    "openWorldHint": false
  }
}