Update an organization's authentication policy
/api/v1/organizations/{id}/policySets 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
Authorization Option A JWT access token
X-API-Key Option B API key for management-tier access
Path Parameters
idstring Required Headers
if-matchrequiredIf-MatchOptimistic-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.
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
data *OrganizationPolicyResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
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 }'
{ "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 } }
Tell us how we can improve this guide.