Skip to content
Access policies

Update an access policy

Replaces the name and the switches of an access policy.

PUT /organizations/{organizationId}/contexts/sign-in/{contextId}/access-policies/{policyId}

Permission: Sign In › Access Policies (Write). See API permissions.

  • Every field is replaced. Send all of them, with the values you keep as well as the ones you change. A missing field returns 400.
  • The email patterns stay. Change them with Add email patterns and Remove email patterns.
  • The settings behind each switch stay. Redirect URLs, session lengths, device limits and the other settings are managed in the Admin Dashboard. A switch you turn on uses the settings the policy already has.
  • The name stays unique. A name that another policy of the context has returns 409 with the errorCode ALREADY_EXISTS. The current name of the policy can be kept.
  • The fallback policy can be updated. The policy with "default": true is updated like any other.
ParameterInTypeRequiredDescription
organizationIdPathstringYesThe Organization ID of the API key. Any other ID returns 404.
contextIdPathstringYesThe ID of a Sign-In Context of the Organization. Any other ID returns 404.
policyIdPathstringYesThe ID of the access policy. An unknown ID returns 404.
nameBodystringYesThe name of the policy, 1 to 100 characters, unique in the context. Trimmed. Letters of any alphabet, including accented letters, digits, space and _ : ( ) & , . / " + -.
signInPermissionsBodyobjectYesThe sign-in methods: meetingHost, emailSelfProvisioning and saml, each a required boolean.
selfServicePortalBodybooleanYesSelf-Service Portal.
selfServicePermissionsBodyobjectYesThe Self-Service permissions: manageConferences and manageWhitelistings, each a required boolean.
siteBasedRedirectBodybooleanYesSite Based Redirect.

The body is the same as in Create an access policy.

Request example

cURL
curl -X PUT "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts/sign-in/$CONTEXT_ID/access-policies/66f2a1c4e8b0a93d5c1e7f20" \
-H "Authorization: Bearer $NCP_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Contractors",
"signInPermissions": { "meetingHost": false, "emailSelfProvisioning": true, "saml": true },
"selfServicePortal": true,
"selfServicePermissions": { "manageConferences": false, "manageWhitelistings": true },
"siteBasedRedirect": false
}'

200 with the updated policy, its email patterns included. The fields are described in the access policy object.

Response example

200
{
"policyId": "66f2a1c4e8b0a93d5c1e7f20",
"name": "Contractors",
"default": false,
"emailPatterns": ["@contractor.example"],
"signInPermissions": { "meetingHost": false, "emailSelfProvisioning": true, "saml": true },
"selfServicePortal": true,
"selfServicePermissions": { "manageConferences": false, "manageWhitelistings": true },
"siteBasedRedirect": false
}
StatuserrorCodeWhen
400VALIDATION_FAILEDA field is missing or breaks a validation rule. errors names each field. Nothing is changed.
400VALIDATION_FAILEDThe policy cannot be saved with these settings: The access policy cannot be saved with these settings. Nothing is changed.
404RESOURCE_NOT_FOUNDThe context has no access policy with this ID, organizationId is not the Organization of the API key, or contextId is not one of its Sign-In Contexts.
409ALREADY_EXISTSAnother policy of the context has the name: An access policy with that name already exists in the context. Nothing is changed.
409SIGN_IN_CONFERENCE_LIMITS_INVALIDmanageConferences is true and the conference visitor limits of the policy are not valid: The policy's conference visitor limits are not valid, so conference management cannot be switched on. Correct the limits in the Admin Dashboard first. Nothing is changed.

Errors common to all operations are in Errors.

Next