---
title: "Require single sign-on for addresses on the verified domains, or stop requiring it."
method: PATCH
path: "/v1/organizations/current/sso/enforce"
tags: ["organizations"]
---

# Require single sign-on for addresses on the verified domains, or stop requiring it.

`PATCH /v1/organizations/current/sso/enforce`

## Request

- Base URL: `https://api.50heads.com`
- URL: `https://api.50heads.com/v1/organizations/current/sso/enforce`
- Auth: HTTP bearer

Organization admins only (403 `organization_admin_required`), on a browser session with a fresh proof in the `x-50h-reauth` header (401 `reauth_required`). It needs a person: API keys, connected apps and service accounts get 403 `session_required`. Every change is written to the organization's audit. On: email codes stop for those addresses and passkey sign-in is kept only for break-glass owners. It can only be turned on by an admin whose own test sign-in since the last change worked (409 `sso_test_required`), so nobody locks themselves out. Off is always allowed.

## Request body

- OrganizationSsoEnforceRequest
  - `enforce` boolean, required

## Response `200`

OK

- OrganizationSsoGetResponse
  - `connection` object, nullable, required
    - `id` string, required
    - `protocol` 'oidc' | 'saml', required
    - `issuer` string, required: OIDC: the identity provider's issuer URL, exactly as its discovery document gives it. SAML: the identity provider's entity ID.
    - `clientId` string, required
    - `clientSecretSet` boolean, required
    - `clientSecretHint` string, nullable, required
    - `tokenAuthMethod` 'client_secret_basic' | 'client_secret_post', required
    - `defaultWorkspaceId` string, nullable, required
    - `defaultRole` 'admin' | 'member' | 'viewer', required
    - `state` 'draft' | 'tested' | 'enabled', required
    - `enforce` boolean, required
    - `enforceEnabledAt` string, nullable, required
    - `configChangedAt` string, required
    - `lastTest` object, nullable, required
      - `at` string, required
      - `by` object, required
        - `id` string, required
        - `name` string, nullable, required
      - `result` string, required
      - `matchedTester` boolean, required
      - `current` boolean, required
    - `lastSignInAt` string, nullable, required
    - `createdAt` string, required
    - `updatedAt` string, nullable, required
    - `saml` object, nullable, required
      - `idpEntityId` string, required
      - `ssoUrl` string, required
      - `metadataUrl` string, nullable, required
      - `certificates` object[], required
        - `fingerprint` string, required
        - `notBefore` string, required
        - `notAfter` string, required
        - `subject` string, nullable, required
        - `keyType` 'rsa' | 'ec-p256', required
      - `allowIdpInitiated` boolean, required
  - `redirectUri` string, required
  - `scopes` string[], required
  - `saml` object, required
    - `entityId` string, required
    - `acsUrl` string, required
    - `metadataUrl` string, required
    - `nameIdFormat` string, required

## Other responses

- `400`: The request is not valid; `error.details.validation` lists the fixes.
- `401`: No key or token, or it expired or was revoked.
- `403`: The key or token lacks the scope (`insufficient_scope`), or the action is not allowed.
- `429`: Too many requests; wait for Retry-After.

---

[API](https://skmtc.dev/50heads/apis/50heads-api.md) · [All operations](https://skmtc.dev/50heads/apis/50heads-api/llms.txt) · [OpenAPI document](https://skmtc.dev/50heads/apis/50heads-api/revisions/20175e8b00e3?raw)
