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

API KeyX-API-Key Option B

API key for management-tier access

Path Parameters

idstring Required

Headers

  • if-match required
  • 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"

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: value" \
  -H "If-Match: value" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mfa_required": false,
    "mfa_factor_allowlist": [
      "totp"
    ],
    "mfa_after_sso": "exempt",
    "require_sso": false
  }'
Response
{
  "data": {
    "organization_id": "string",
    "mfa_required": false,
    "mfa_factor_allowlist": [
      "totp"
    ],
    "mfa_after_sso": "exempt",
    "require_sso": false,
    "environment": {
      "mfa_required": false,
      "mfa_factor_allowlist": [
        "totp"
      ],
      "mfa_after_sso": "exempt",
      "require_sso": false
    },
    "effective": {
      "mfa_required": false,
      "mfa_factor_allowlist": [
        "totp"
      ],
      "mfa_after_sso": "exempt",
      "require_sso": false
    },
    "version": 0
  }
}
Related endpoints
GETList organizations
POSTCreate an organization
DELETEDelete every organization
GETGet an organization
PATCHUpdate an organization
DELETEDelete an organization
GETGet an organization's authentication policy
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
PATCHChange a member's role
DELETERemove a member from an organization
GETList an organization's invitations
POSTInvite a member into an organization
DELETERevoke an organization invitation
Was this page helpful?

Tell us how we can improve this guide.