Skip to main content
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"]
  }'
{
  "policyEmails": [
    "alice@acme.com",
    "*@external.example.com",
    "bob@acme.com"
  ],
  "warnings": [
    { "email": "alice@acme.com", "reason": "already in policy" }
  ]
}
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

organizationId
string
required
Organization ID.
contextId
string
required
Sign-In Context ID.
accessPolicyId
string
required
Access policy UUID. Find it in the Context under Configuration → Access Policies.
x-auth-token
string
required
Context API key.
emails
string[]
required
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.
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

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.
{
  "policyEmails": [
    "alice@acme.com",
    "*@external.example.com",
    "bob@acme.com"
  ],
  "warnings": [
    { "email": "alice@acme.com", "reason": "already in policy" }
  ]
}