get_org_self_delete_by_orgid

Read-only

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

The caller's view of deleting an organization

With the caller's own token. Requires org.manage in the organization or platform authority. Says whether the caller owns it and which parent would have to approve, shows the owner the deletion preview with every blocker, and shows the organization's request.

Arguments

ArgumentTypeDescription
orgIdpathstring (uuid)required

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": "get_org_self_delete_by_orgid",
    "arguments": {
      "orgId": "11111111-1111-4111-8111-111111111111"
    }
  }
}

Result

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

The caller's view.

json
{
  "data": {
    "callerIsOwner": true,
    "callerMayCancel": true,
    "isPlatform": true,
    "orgId": "11111111-1111-4111-8111-111111111111",
    "orgName": "string",
    "parentOrgId": "11111111-1111-4111-8111-111111111111",
    "parentOrgName": "string",
    "preview": {
      "blocked": true,
      "blockedReason": "string",
      "blockers": [],
      "groupsRemoved": [],
      "membershipsRemoved": 1,
      "orgId": "string",
      "orgName": "string",
      "permissionsRetired": 1,
      "rolesRemoved": [],
      "usersDeactivated": [],
      "usersKept": []
    },
    "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.callerIsOwnerbooleanWhether the caller owns this organization — and so may ask to delete it. Gate on this, never a role name.
data.callerMayCancelboolean
data.isPlatformbooleanThe platform organization cannot be deleted.
data.orgIdstring (uuid)
data.orgNamestring
data.parentOrgIdstring (uuid) | null
data.parentOrgNamestring | null
data.previewobject | nullWhat deleting the organization now would remove and keep, and every blocker. Only for the owner — it names every member's address.
data.preview.blockedboolean
data.preview.blockedReasonstring | null
data.preview.blockersarray of objectEvery reason this organization may not be deleted yet; empty when it may.
data.preview.groupsRemovedarray of objectThe organization's live groups — its OWNER and MEMBER groups among them; each is soft-deleted.
data.preview.membershipsRemovedintegerCurrent (non-REMOVED) memberships into those groups; each is stamped REMOVED.
data.preview.orgIdstring
data.preview.orgNamestring
data.preview.permissionsRetiredintegerThe organization's per-org permissions. Not written: every grant path requires a live organization, so they confer nothing once it is deleted.
data.preview.rolesRemovedarray of objectThe organization's own live roles (its OWNER and ORG_USER roles); each is soft-deleted.
data.preview.usersDeactivatedarray of objectMembers who belong to no other live organization. Each is soft-deleted and their DynamoDB auth row suspended, so they cannot sign in by either path.
data.preview.usersKeptarray of objectMembers of another live organization. Kept, and lose only this organization's memberships; keptBy names the organization(s) that keep them.
data.requestobject | nullThe organization's current or recently finished request.
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.

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.

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": "get_org_self_delete_by_orgid",
  "description": "GET /api/org-self-delete/{orgId} — With the caller's own token. Requires `org.manage` in the organization or platform authority. Says whether the caller owns it and which parent would have to approve, shows the owner the deletion preview with every blocker, and shows the organization's request.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "orgId": {
        "type": "string"
      }
    },
    "required": [
      "orgId"
    ]
  },
  "annotations": {
    "readOnlyHint": true,
    "openWorldHint": false
  }
}