Skip to content
Access policies

Create an access policy

Creates an access policy in a Sign-In Context, with a name and the switches of its sign-in methods and Self-Service permissions.

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

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

  • The name is unique in the context. A name that another policy of the context already has returns 409 with the errorCode ALREADY_EXISTS and nothing is created, so repeating the call is safe.
  • The new policy has no email patterns. It applies to nobody until you add email patterns to it.
  • The settings are the defaults of a new policy. The redirect URLs, session lengths, device limits and the other settings behind each switch are the same as for a policy created in the Admin Dashboard. Change them in the Admin Dashboard, under Access Policies.
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.
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 the policy allows.
signInPermissions.meetingHostBodybooleanYesMeeting Host.
signInPermissions.emailSelfProvisioningBodybooleanYesEmail Self-Provisioning.
signInPermissions.samlBodybooleanYesSAML Login.
selfServicePortalBodybooleanYesSelf-Service Portal.
selfServicePermissionsBodyobjectYesWhat users of the policy can manage in the Self-Service Portal.
selfServicePermissions.manageConferencesBodybooleanYesManage Conferences.
selfServicePermissions.manageWhitelistingsBodybooleanYesManage Whitelistings.
siteBasedRedirectBodybooleanYesSite Based Redirect.

Every field is required. The access policy object describes each switch.

Request example

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

201 with the new policy and a Location header with its path. The fields are described in the access policy object.

Response example

201
{
"policyId": "66f2a1c4e8b0a93d5c1e7f20",
"name": "Contractors",
"default": false,
"emailPatterns": [],
"signInPermissions": { "meetingHost": false, "emailSelfProvisioning": true, "saml": false },
"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 created.
400VALIDATION_FAILEDThe policy cannot be saved with these settings: The access policy cannot be saved with these settings. Nothing is created.
404RESOURCE_NOT_FOUNDorganizationId 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 created.
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 created.
409
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "An access policy with that name already exists in the context.",
"errorCode": "ALREADY_EXISTS",
"requestId": "0d4b7c29-5e61-4f3a-9a2e-7c18b6e0f453"
}

Errors common to all operations are in Errors.

Next