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
409with theerrorCodeALREADY_EXISTSand 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.
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. |
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 the policy allows. |
signInPermissions.meetingHost | Body | boolean | Yes | Meeting Host. |
signInPermissions.emailSelfProvisioning | Body | boolean | Yes | Email Self-Provisioning. |
signInPermissions.saml | Body | boolean | Yes | SAML Login. |
selfServicePortal | Body | boolean | Yes | Self-Service Portal. |
selfServicePermissions | Body | object | Yes | What users of the policy can manage in the Self-Service Portal. |
selfServicePermissions.manageConferences | Body | boolean | Yes | Manage Conferences. |
selfServicePermissions.manageWhitelistings | Body | boolean | Yes | Manage Whitelistings. |
siteBasedRedirect | Body | boolean | Yes | Site Based Redirect. |
Every field is required. The access policy object describes each switch.
Request example
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 }'Response
Section titled “Response”201 with the new policy and a Location header with its path. The
fields are described in
the access policy object.
Response example
{ "policyId": "66f2a1c4e8b0a93d5c1e7f20", "name": "Contractors", "default": false, "emailPatterns": [], "signInPermissions": { "meetingHost": false, "emailSelfProvisioning": true, "saml": false }, "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 created. |
400 | VALIDATION_FAILED | The policy cannot be saved with these settings: The access policy cannot be saved with these settings. Nothing is created. |
404 | RESOURCE_NOT_FOUND | 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 created. |
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 created. |
{ "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.