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
409with theerrorCodeALREADY_EXISTS. The current name of the policy can be kept. - The fallback policy can be updated. The policy with
"default": trueis updated like any other.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | The Organization ID of the API key. Any other ID returns 404. |
contextId | Path | string | Yes | The ID of a Sign-In Context of the Organization. Any other ID returns 404. |
policyId | Path | string | Yes | The ID of the access policy. An unknown ID returns 404. |
name | Body | string | Yes | The name of the policy, 1 to 100 characters, unique in the context. Trimmed. Letters of any alphabet, including accented letters, digits, space and _ : ( ) & , . / " + -. |
signInPermissions | Body | object | Yes | The sign-in methods: meetingHost, emailSelfProvisioning and saml, each a required boolean. |
selfServicePortal | Body | boolean | Yes | Self-Service Portal. |
selfServicePermissions | Body | object | Yes | The Self-Service permissions: manageConferences and manageWhitelistings, each a required boolean. |
siteBasedRedirect | Body | boolean | Yes | Site Based Redirect. |
The body is the same as in Create an access policy.
Request example
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 }'Response
Section titled “Response”200 with the updated policy, its email patterns included. The fields
are described in
the access policy object.
Response example
{ "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}Errors
Section titled “Errors”| Status | errorCode | When |
|---|---|---|
400 | VALIDATION_FAILED | A field is missing or breaks a validation rule. errors names each field. Nothing is changed. |
400 | VALIDATION_FAILED | The policy cannot be saved with these settings: The access policy cannot be saved with these settings. Nothing is changed. |
404 | RESOURCE_NOT_FOUND | The 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. |
409 | ALREADY_EXISTS | Another policy of the context has the name: An access policy with that name already exists in the context. Nothing is changed. |
409 | SIGN_IN_CONFERENCE_LIMITS_INVALID | manageConferences 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.