Suspend a membership
POST /v1/organizations/{org_id}/memberships/{membership_id}:suspend · permission organizations:write
Suspends an active membership (reason admin_suspended). A suspended member cannot sign in in the organization's context and their organization sessions end. The organization's last active admin cannot be suspended. Suspending a suspended membership writes nothing. The write is audited as organization_membership.updated with change=suspended.
Request
| Field | Type | Required | Description |
|---|---|---|---|
org_id |
path | yes | Organization ID (org_…). |
membership_id |
path | yes | Membership ID (mem_…). |
If-Match |
header | no | Current ETag; if given it must match (412) and pins the write to that version. |
No request body.
Response
200 OK with the updated membership and its ETag.
{
"id": "mem_01j9xn5p9s0t4v6w8x0y2z4a6c",
"organization_id": "org_01j9xk3m7q8r2s4t6v8w0y2z4a",
"user_id": "usr_01j9xh2k6p7q1r3s5t7v9w1x3y",
"status": "suspended",
"source": "admin_api",
"reason": "admin_suspended",
"roles": [
{
"role_id": "rol_01j9xr7s1t2w6x8y0z2a4b6c8e",
"source": "admin_api",
"assigned_at": "2026-10-12T09:31:00.123456Z"
}
],
"expires_at": null,
"created_at": "2026-10-12T09:31:00.123456Z",
"activated_at": "2026-10-12T09:31:00.123456Z",
"suspended_at": "2026-10-12T10:00:00Z",
"removed_at": null,
"updated_at": "2026-10-12T10:00:00Z",
"version": 2
}
Errors
| HTTP | code | When |
|---|---|---|
| 404 | not_found |
The membership does not exist in this organization. |
| 409 | last_org_admin |
The membership is the organization's last active admin. |
| 412 | precondition_failed |
If-Match does not match the current version. |
| 422 | validation_failed |
The membership is invited or removed (/status invalid_state). |
| 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
curl -i -X POST "https://api.eu.keenauth.com/v1/organizations/org_01j9xk3m7q8r2s4t6v8w0y2z4a/memberships/mem_01j9xn5p9s0t4v6w8x0y2z4a6c:suspend" \
-H "Authorization: Bearer $KEENAUTH_SECRET_KEY" \
-H 'If-Match: "2"'
Personal data
This endpoint carries personal data: organization memberships and invitations. Personal data in the KeenAuth APIs describes what is stored, how long it is kept and how it is deleted. Do not send special categories of personal data (health, biometric data, religion, political opinions, sexual orientation) in any field.