post_org_self_delete_by_orgid
Calls POST /api/org-self-delete/{orgId} as the signed-in person · REST reference
Ask to delete an organization
Only the organization's OWNER may (403 for anyone else, a delegate holding org.manage included), never the platform organization, and only with confirmName exactly the organization's name (400 otherwise). Refused with 409 and the DAL's sentence while anything blocks the deletion — money owed either way, a clawback open or inside its 12-month window, vouchers in flight, recurring donations, live child organizations, a pending batch request — or while another request is in flight. A single-use code is emailed to the owner; if it cannot be sent the request is cancelled and the answer is 502. Refused while impersonating.
Arguments
| Argument | Type | Description | |
|---|---|---|---|
orgIdpath | string (uuid) | required | |
bodyJSON | object | required | The request body, as a JSON object. Its fields are listed below. |
Fields of body
| Field | Type | Description | |
|---|---|---|---|
confirmName | string | required | The organization's name, typed exactly. |
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",
"arguments": {
"orgId": "11111111-1111-4111-8111-111111111111",
"body": {
"confirmName": "string"
}
}
}
}Result
On success (HTTP 201) the tool returns one text item holding the API's JSON, pretty-printed.
The request awaits the owner's code; the code was sent.
{
"data": {
"createdAt": 1,
"expiresAt": 1,
"id": "11111111-1111-4111-8111-111111111111",
"orgId": "11111111-1111-4111-8111-111111111111",
"orgName": "string",
"requestedBy": {
"email": "string",
"userId": "11111111-1111-4111-8111-111111111111",
"firstName": "string",
"lastName": "string"
},
"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.cancelledAt | integer | null | |
data.completedAt | integer | null | |
data.confirmedAt | integer | null | |
data.createdAt | integer | Epoch milliseconds. |
data.decidedAt | integer | null | |
data.expiresAt | integer | Epoch milliseconds — the current step's deadline: the code's (OTP_EXPIRY_SECONDS), then seven days for the parent. |
data.id | string (uuid) | |
data.orgId | string (uuid) | |
data.orgName | string | |
data.parentOrgId | string (uuid) | null | The parent organization that must approve; null when there is none. |
data.parentOrgName | string | null | |
data.reason | string | null | Why it was cancelled or declined. |
data.requestedBy | object | |
data.requestedBy.email | string | |
data.requestedBy.firstName | string | null | |
data.requestedBy.lastName | string | null | |
data.requestedBy.userId | string (uuid) | |
data.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.
429Per-identifier abuse control tripped.
502The code could not be delivered; the request was cancelled.
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",
"description": "POST /api/org-self-delete/{orgId} — Only the organization's OWNER may (403 for anyone else, a delegate holding org.manage included), never the platform organization, and only with `confirmName` exactly the organization's name (400 otherwise). Refused with 409 and the DAL's sentence while anything blocks the deletion — money owed either way, a clawback open or inside its 12-month window, vouchers in flight, recurring donations, live child organizations, a pending batch request — or while another request is in flight. A single-use code is emailed to the owner; if it cannot be sent the request is cancelled and the answer is 502. 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"
},
"body": {
"type": "string",
"description": "The JSON request body: { confirmName*: string (The organization's name, typed exactly.) }"
}
},
"required": [
"orgId",
"body"
]
},
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": false
}
}