post_org_self_delete_by_orgid_by_requestid_decision
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
| Argument | Type | Description | |
|---|---|---|---|
orgIdpath | string (uuid) | required | |
requestIdpath | string (uuid) | required | |
bodyJSON | object | required | The request body, as a JSON object. Its fields are listed below. |
Fields of body
| Field | Type | Description | |
|---|---|---|---|
approve | boolean | required | |
reason | string |
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.
{
"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"
}
}
}
}Result
On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.
Deleted (DELETED) or declined (DECLINED).
{
"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
| Field | Type | Description |
|---|---|---|
data | object | |
data.outcome | "DELETED" | "DECLINED" | |
data.request | object | |
data.request.cancelledAt | integer | null | |
data.request.completedAt | integer | null | |
data.request.confirmedAt | integer | null | |
data.request.createdAt | integer | Epoch milliseconds. |
data.request.decidedAt | integer | null | |
data.request.expiresAt | integer | Epoch milliseconds — the current step's deadline: the code's (OTP_EXPIRY_SECONDS), then seven days for the parent. |
data.request.id | string (uuid) | |
data.request.orgId | string (uuid) | |
data.request.orgName | string | |
data.request.parentOrgId | string (uuid) | null | The parent organization that must approve; null when there is none. |
data.request.parentOrgName | string | null | |
data.request.reason | string | null | Why it was cancelled or declined. |
data.request.requestedBy | object | |
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. |
success | true |
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.
400The request was malformed or failed a guard.
403Authenticated, but the caller holds none of the required permissions.
404No such resource — or none this caller may see.
409The 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.
{
"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
}
}