Suspend a member
POST /fapi/v1/organizations/{org_id}/memberships/{membership_id}:suspend · called from the environment's sign-in host
Suspends a membership. The member keeps their roles but cannot act in the organization: their sessions and tokens in this organization's context are revoked, and they cannot select the organization until a member reactivates them. Suspending a member who is already suspended answers the membership unchanged. The last active admin cannot be suspended (409 last_org_admin).
Requires the authenticated user's __Host-idp_session cookie with an exact Origin, or a first-party app's front API access token (Authorization: DPoP <token> with a DPoP proof; see Front API access token). The user must be an active member of the organization with both the idp_members:update_roles and idp_members:remove permissions. A user who is not a member gets 404 not_found; a member without both permissions gets 403 insufficient_permissions. You cannot change your own membership here (403 insufficient_permissions), and only a member who holds the admin role can change a member who holds a privileged role (403 role_not_assignable).
With @keenauth/js: await keenauth.organizations.suspendMember(orgId, membershipId, { expectedVersion: 3 }).
Request
Headers:
| Header | Required | Description |
|---|---|---|
Idp-Client |
yes | SDK identifier. |
Origin |
yes, with the cookie | https://<sign-in host>. |
If-Match |
no | One version, "<version>", from the member list. A version that does not match, or more than one version, returns 412 precondition_failed. |
org_id: the organization identifier (org_…). membership_id: the membership identifier (mem_…).
No body.
Response
200 OK with the membership (the same fields as an item of the member list) and ETag: "<version>".
Errors
| Status | Code | When |
|---|---|---|
| 400 | malformed_request |
If-Match is malformed. |
| 401 | unauthenticated |
No valid session cookie or token. |
| 403 | insufficient_permissions |
The user lacks idp_members:update_roles or idp_members:remove, or the membership is the user's own. |
| 403 | role_not_assignable |
The member holds a privileged role and the user does not hold the admin role. |
| 403 | origin_not_allowed |
The Origin does not match. |
| 404 | not_found |
No such organization or membership for this user; an unknown, malformed or foreign identifier answers the same. |
| 409 | last_org_admin |
The member is the organization's last active admin. |
| 409 | organization_disabled |
The organization is disabled or pending deletion (organization_pending_deletion). |
| 412 | precondition_failed |
If-Match does not name the membership's current version. |
| 422 | validation_failed |
The membership has been removed. |
| 503 | service_unavailable |
Temporarily unavailable; retry after Retry-After. |
Example
curl -X POST "https://example.keenauth.app/fapi/v1/organizations/org_01jbz6x8kq3m2n4p5r6s7t8v9a/memberships/mem_01jbz6x8kq3m2n4p5r6s7t8v9b:suspend" \
-H "Idp-Client: my-app/1.0.0 (node/22.0.0)" \
-H "Origin: https://example.keenauth.app" \
-H 'If-Match: "3"' \
-b cookies.txt
{
"id": "mem_01jbz6x8kq3m2n4p5r6s7t8v9b",
"user_id": "usr_01jbz6x8kq3m2n4p5r6s7t8v9c",
"status": "suspended",
"roles": [{ "role_id": "rol_01jbz6x8kq3m2n4p5r6s7t8v9w", "source": "admin_api" }],
"created_at": "2026-11-03T09:00:00Z",
"activated_at": "2026-11-03T09:00:00Z",
"expires_at": null,
"updated_at": "2026-11-03T11:00:00Z",
"version": 4
}
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.