Deactivate a connection

POST /v1/connections/{connection_id}:deactivate · permission connections:write

Sets the connection status to inactive. The request body is optional and has no fields. The operation is idempotent: if the connection already has this status nothing is written, the version is unchanged and the current connection is returned. If-Match is not used; if another writer changes the connection at the same moment the call is retried a few times. Activation does not check that the protocol configuration is complete.

Request

Field Type Required Description
connection_id string yes Connection identifier (conn_…).
Idempotency-Key header no Optional key (16-64 characters) that makes a retried request safe.

The body is optional; if present it must be {}.

Response

200 OK with the connection and its ETag.

{
  "id": "conn_0k3v8m1q2x9dz4h7s5t6w0y1ab",
  "key": "google",
  "type": "social",
  "strategy": "google",
  "name": "Google",
  "display_name": "Sign in with Google",
  "status": "inactive",
  "org_id": null,
  "allowed_email_domains": [],
  "allow_external_domains": false,
  "jit_mode": null,
  "email_trust": null,
  "default_role_ids": [],
  "trust_idp_mfa": null,
  "allow_idp_initiated": null,
  "idp_initiated_default_application_id": null,
  "idp_initiated_allowed_application_ids": [],
  "settings": {},
  "created_at": "2026-10-05T09:30:00.123456Z",
  "updated_at": "2026-10-05T09:30:00.123456Z"
}

Errors

HTTP code When
400 unknown_field The body contains a field.
404 not_found The connection does not exist or belongs to another environment.
412 precondition_failed The connection kept changing concurrently; retry.
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 -X POST https://api.eu.keenauth.com/v1/connections/conn_0k3v8m1q2x9dz4h7s5t6w0y1ab:deactivate \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"