
# Cancel an organization's deletion

`POST /v1/organizations/{org_id}:cancel-deletion` · permission `organizations:write`

Cancels a self-service deletion requested by an organization administrator before `deletion_due_at`; the organization becomes `active` again. For an organization that is not waiting for deletion nothing changes. An `organization.deletion_cancelled` event is published.

## Request

| Field | Type | Required | Description |
|---|---|---|---|
| `org_id` | path | yes | Organization ID (`org_…`). |
| `Idempotency-Key` | header | no | Optional. 16-64 characters `[A-Za-z0-9_-]`; repeating the same key with the same request returns the same response. |

No request body.

## Response

`200 OK` with the organization and its `ETag`.

```json
{
  "id": "org_01j9xk3m7q8r2s4t6v8w0y2z4a",
  "name": "Acme Corp",
  "slug": "acme",
  "external_id": "crm-4821",
  "status": "active",
  "metadata": {
    "tier": "gold"
  },
  "brand_color": "#1F6FEB",
  "max_memberships": null,
  "default_zoneinfo": null,
  "created_via": "admin_api",
  "disabled_at": null,
  "deletion_requested_at": null,
  "deletion_due_at": null,
  "created_at": "2026-10-12T09:30:00.123456Z",
  "updated_at": "2026-10-12T10:10:00.111111Z",
  "version": 3
}
```

## Errors

| HTTP | code | When |
|---|---|---|
| 404 | `not_found` | No organization with this ID exists in this environment. |
| 401 | `unauthenticated` | The credential is missing, invalid or revoked. |
| 403 | `insufficient_permissions` | The credential lacks the required permission. |
| 429 | `rate_limited` | The rate limit was exceeded; retry after the `Retry-After` period. |
| 503 | `service_unavailable` | A dependency is temporarily unavailable; retry after the `Retry-After` period. |

## Example

```bash
curl -X POST "https://api.eu.keenauth.com/v1/organizations/org_01j9xk3m7q8r2s4t6v8w0y2z4a:cancel-deletion" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
```
