1. Docs
  2. API Reference
  3. Update an organization's authentication policy

Update an organization's authentication policy

PATCH/api/v1/organizations/{id}/policy

Sets the organization's own authentication policy. A field set to null inherits the Environment again. The policy can only tighten the Environment's settings: mfa_required can be true where the Environment leaves MFA optional, mfa_factor_allowlist must be a subset of the Environment's, mfa_after_sso can be require where the Environment exempts, and require_sso refuses password and code logins for members. Returns 400 (organization.policy_loosens) when a value would loosen the Environment, 409 when If-Match does not match the policy version. Requires the hierarchy.manage permission at the organization and emits organization.policy.updated.

Authentication

Bearer TokenAuthorization Option A

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

API KeyX-API-Key Option B

API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.

Path Parameters

idstring Required

Headers

  • If-Match

    Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.

Request body

application/json

mfa_requiredboolean Optional

Require MFA for this organization's members. `true` tightens an Environment that leaves MFA optional; `false` is only accepted where the Environment does not require MFA; `null` inherits.

mfa_factor_allowlistenum[] Optional

Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits.

mfa_after_ssoenum Optional

Whether an SSO login still owes an MFA challenge. `require` tightens an Environment that exempts SSO; `exempt` is only accepted where the Environment exempts; `null` inherits.

one of "exempt" · "require"

allowed_sign_in_methodsenum[] Optional

The sign-in methods this organization's members may use. A non-empty subset of the methods the Environment offers (`password` unless the Environment turned it off, `email_otp` where the Environment turned it on, and `sso`); a method the Environment does not offer is refused with `organization.policy_loosens`. `null` inherits the Environment's. While `require_sso` is on, SSO is the only method whatever this says.

require_ssoboolean Optional

Members must sign in through SSO. Password and email-code logins are refused for the organization's members and for any email whose domain routes to a connection bound to this organization.

Responses

application/json

  • dataOrganizationPolicyResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X PATCH "https://auth.canopy-io.com/api/v1/organizations/value/policy" \
  -H "If-Match: "3"" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mfa_required": false,
    "mfa_factor_allowlist": [
      "totp"
    ],
    "mfa_after_sso": "exempt",
    "allowed_sign_in_methods": [
      "password"
    ],
    "require_sso": false
  }'
Response
{
  "data": {
    "organization_id": "string",
    "mfa_required": false,
    "mfa_factor_allowlist": [
      "totp"
    ],
    "mfa_after_sso": "exempt",
    "allowed_sign_in_methods": [
      "password"
    ],
    "require_sso": false,
    "environment": {
      "mfa_required": false,
      "mfa_factor_allowlist": [
        "totp"
      ],
      "mfa_after_sso": "exempt",
      "allowed_sign_in_methods": [
        "password"
      ],
      "require_sso": false
    },
    "effective": {
      "mfa_required": false,
      "mfa_factor_allowlist": [
        "totp"
      ],
      "mfa_after_sso": "exempt",
      "allowed_sign_in_methods": [
        "password"
      ],
      "require_sso": false
    },
    "version": 0,
    "sso_recovery_codes_generation": 0,
    "sso_recovery_codes_remaining": 0,
    "sso_recovery_codes": [
      "string"
    ]
  }
}
Related endpoints
GETWhat the caller administers in an organization
GETList the organization's tree as the caller sees it
GETList who holds a role at a node in the organization
GETSummarize who holds a role at a node in the organization
GETList the roles the caller may grant at a node
GETList the organization's members, for granting a role at a node
POSTGrant a role at a node beneath the organization
PATCHChange a grant in the organization
DELETETake a grant in the organization away
GETList organizations
POSTCreate an organization
DELETEDelete every organization
GETGet an organization
PATCHUpdate an organization
DELETEDelete an organization
GETGet an organization's authentication policy
POSTRegenerate the organization's SSO recovery codes
POSTStart a test sign-in on the organization's connection
GETRead the organization's test sign-in
GETList the organization's domain claims
POSTClaim a domain for the organization
POSTVerify one of the organization's domains
DELETERemove one of the organization's domain claims
GETList an organization's SSO connections
POSTBind an SSO connection to an organization
DELETEUnbind an SSO connection from an organization
GETList an organization's members
POSTAdd a member to an organization
DELETERemove a member from an organization
POSTReset a member's multi-factor authentication
GETList an organization's invitations
POSTInvite a member into an organization
GETList the roles an organization may assign
DELETERevoke an organization invitation
GETGet an organization's SSO connection
POSTSet up an organization's SSO connection
PATCHChange an organization's SSO connection
DELETERemove an organization's SSO connection
POSTActivate an organization's SSO connection
POSTDisable an organization's SSO connection
POSTImport the identity provider's SAML metadata
GETList the connection's recent sign-ins
GETList the roles the organization's SSO sign-ins may arrive with
GETGet the service-provider values for an organization's SSO connection
GETGet an organization's directory connection
POSTCreate an organization's directory connection
DELETERemove an organization's directory connection
GETList an organization's directory-sync tokens
POSTMint a directory-sync token for an organization
POSTReplace a directory-sync token without an outage
DELETERevoke a directory-sync token
GETRecent directory-sync activity for an organization
GETList the roles an organization's directory may grant
PUTReplace the roles an organization's directory may grant
GETList the groups an organization's provider has pushed
PUTMap a pushed group to one of the available roles
DELETEClear a pushed group's role mapping
Was this page helpful?

Tell us how we can improve this guide.