Add emails to access policy
Add email addresses or patterns to a Sign-In access policy.
POST /v1/org/{organizationId}/contexts/sign-in/{contextId}/policies/{accessPolicyId}/emails
Adds one or more email addresses or pattern rules (e.g. *@acme.com)
to an access policy.
See Access Policy for the accepted email patterns and the family-wide error body.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | Organization ID. |
contextId | Path | string | Yes | Sign-In Context ID. |
accessPolicyId | Path | string | Yes | Access policy UUID. Find it in the Context under Configuration → Access Policies. |
x-auth-token | Header | string | Yes | Context API key. |
emails | Body | string[] | Yes | List of email addresses or patterns to add. Duplicates in the request or already in the policy are silently ignored; duplicates that match another rule produce a warnings entry in the response. |
Request example
curl -X POST "$API_BASE_URL/v1/org/$ORG_ID/contexts/sign-in/$CTX_ID/policies/$POLICY_ID/emails" \ -H "x-auth-token: $NETGRAPH_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "emails": ["alice@acme.com", "*@external.example.com"] }'Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
policyEmails | string[] | Complete list of emails now in the policy after the add. |
warnings | object[] | One entry per input email that was not added. Empty when all inputs were accepted. |
warnings[].email | string | The input email that triggered the warning. |
warnings[].reason | string | Why it was skipped. For a duplicate pattern this is "Pattern already exist in policy: <policy name>". |
Response example
{ "policyEmails": [ "alice@acme.com", "*@external.example.com", "bob@acme.com" ], "warnings": [ { "email": "alice@acme.com", "reason": "Pattern already exist in policy: Staff" } ]}