Skip to content
Access policies

Delete an access policy

Deletes an access policy of a Sign-In Context, with its email patterns.

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

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

  • The fallback policy stays. The fallback policy of the context, the one with "default": true, cannot be deleted and returns 409 with the errorCode SIGN_IN_FALLBACK_POLICY_NOT_DELETABLE.
  • Addresses move to the next match. The email addresses the policy governed are governed by the policies that match them next, and by the fallback policy when no other policy matches.
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.

Request example

cURL
curl -X DELETE "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts/sign-in/$CONTEXT_ID/access-policies/66f2a1c4e8b0a93d5c1e7f20" \
-H "Authorization: Bearer $NCP_API_TOKEN"

204 with no body.

StatuserrorCodeWhen
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.
409SIGN_IN_FALLBACK_POLICY_NOT_DELETABLEThe policy is the fallback policy of the context.
409
{
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "The context's fallback policy cannot be deleted.",
"errorCode": "SIGN_IN_FALLBACK_POLICY_NOT_DELETABLE",
"requestId": "0d4b7c29-5e61-4f3a-9a2e-7c18b6e0f453"
}

Errors common to all operations are in Errors.

Next