---
title: Create an email access policy
description: Creates an email access policy for a private status page.
breadcrumbs: Docs > API > Create an email access policy
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Create an email access policy

## v2 (latest)

| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/statuspages/{page_id}/access_policies/email      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/statuspages/{page_id}/access_policies/email |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/statuspages/{page_id}/access_policies/email      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/statuspages/{page_id}/access_policies/email  |

### Overview

Creates an email access policy for a private status page.

This endpoint requires the `status_pages_settings_write` permission.

OAuth apps require the `status_pages_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#status-pages) to access this endpoint.

### Arguments

#### Path Parameters

| Field                | Type   | Description                        |
| -------------------- | ------ | ---------------------------------- |
| page_id [*required*] | string | The ID of the private status page. |

#### Query Strings

| Field   | Type   | Description                                                                                   |
| ------- | ------ | --------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of resources to include. Supported values: created_by_user, status_page. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type   | Description                                                                                                                                                                                     |
| ------------ | ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | The data object for creating a status page email access policy.                                                                                                                                 |
| data         | attributes [*required*] | object | Attributes for creating a status page email access policy.                                                                                                                                      |
| attributes   | effect [*required*]     | enum   | The effect applied when an email address matches the policy. Deny policies take precedence over allow policies. Allowed enum values: `allow`, `deny`.                                           |
| attributes   | pattern [*required*]    | string | The email address pattern matched by the policy. Supports an exact address (`user@example.com`), all addresses in a domain (`@example.com`), or all addresses in subdomains (`@*.example.com`). |
| data         | type [*required*]       | enum   | Status page email access policy resource type. Allowed enum values: `email_access_policies`. Default: `email_access_policies`.                                                                  |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "effect": "allow",
      "pattern": "@example.com"
    },
    "type": "email_access_policies"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="201" %}
Created

{% tabs %}
{% tab label="Model" %}
Response object for a status page email access policy.

| Parent field          | Field                          | Type      | Description                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]              | object    | The data object for a status page email access policy.                                                                                                                                                                                                                                                                                                                        |
| data                  | attributes [*required*]        | object    | Attributes of a status page email access policy.                                                                                                                                                                                                                                                                                                                              |
| attributes            | created_at [*required*]        | date-time | Timestamp of when the email access policy was created.                                                                                                                                                                                                                                                                                                                        |
| attributes            | effect [*required*]            | enum      | The effect applied when an email address matches the policy. Deny policies take precedence over allow policies. Allowed enum values: `allow`, `deny`.                                                                                                                                                                                                                         |
| attributes            | pattern [*required*]           | string    | The email address pattern matched by the policy.                                                                                                                                                                                                                                                                                                                              |
| data                  | id [*required*]                | uuid      | The ID of the email access policy.                                                                                                                                                                                                                                                                                                                                            |
| data                  | relationships [*required*]     | object    | Relationships of a status page email access policy.                                                                                                                                                                                                                                                                                                                           |
| relationships         | created_by_user [*required*]   | object    | The Datadog user who created the email access policy.                                                                                                                                                                                                                                                                                                                         |
| created_by_user       | data [*required*]              | object    | The data object identifying the Datadog user who created the email access policy.                                                                                                                                                                                                                                                                                             |
| data                  | id [*required*]                | uuid      | The ID of the Datadog user who created the email access policy.                                                                                                                                                                                                                                                                                                               |
| data                  | type [*required*]              | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                                                                                                                          |
| relationships         | status_page [*required*]       | object    | The status page associated with the email access policy.                                                                                                                                                                                                                                                                                                                      |
| status_page           | data [*required*]              | object    | The data object identifying the status page associated with the email access policy.                                                                                                                                                                                                                                                                                          |
| data                  | id [*required*]                | uuid      | The ID of the status page associated with the email access policy.                                                                                                                                                                                                                                                                                                            |
| data                  | type [*required*]              | enum      | Status pages resource type. Allowed enum values: `status_pages`. Default: `status_pages`.                                                                                                                                                                                                                                                                                     |
| data                  | type [*required*]              | enum      | Status page email access policy resource type. Allowed enum values: `email_access_policies`. Default: `email_access_policies`.                                                                                                                                                                                                                                                |
|                       | included                       | [<oneOf>] | Resources related to the email access policy, when requested using the `include` query parameter.                                                                                                                                                                                                                                                                             |
| included              | <type=users>                   | object    | The included Datadog user resource.                                                                                                                                                                                                                                                                                                                                           |
| <type=users>          | attributes                     | object    | Attributes of the Datadog user.                                                                                                                                                                                                                                                                                                                                               |
| attributes            | email                          | string    | The email of the Datadog user.                                                                                                                                                                                                                                                                                                                                                |
| attributes            | handle                         | string    | The handle of the Datadog user.                                                                                                                                                                                                                                                                                                                                               |
| attributes            | icon                           | string    | The icon of the Datadog user.                                                                                                                                                                                                                                                                                                                                                 |
| attributes            | name                           | string    | The name of the Datadog user.                                                                                                                                                                                                                                                                                                                                                 |
| attributes            | uuid                           | string    | The UUID of the Datadog user.                                                                                                                                                                                                                                                                                                                                                 |
| <type=users>          | id                             | uuid      | The ID of the Datadog user.                                                                                                                                                                                                                                                                                                                                                   |
| <type=users>          | type [*required*]              | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                                                                                                                          |
| included              | <type=status_pages>            | object    | The included status page resource.                                                                                                                                                                                                                                                                                                                                            |
| <type=status_pages>   | attributes                     | object    | The attributes of a status page.                                                                                                                                                                                                                                                                                                                                              |
| attributes            | company_logo                   | string    | The base64-encoded image data displayed in the company logo.                                                                                                                                                                                                                                                                                                                  |
| attributes            | components                     | [object]  | Components displayed on the status page.                                                                                                                                                                                                                                                                                                                                      |
| components            | components                     | [object]  | If the component is of type `group`, the components within the group.                                                                                                                                                                                                                                                                                                         |
| components            | id                             | uuid      | The ID of the grouped component. Read-only.                                                                                                                                                                                                                                                                                                                                   |
| components            | name                           | string    | The name of the grouped component.                                                                                                                                                                                                                                                                                                                                            |
| components            | position                       | int64     | The zero-indexed position of the grouped component. Relative to the other components in the group.                                                                                                                                                                                                                                                                            |
| components            | status                         | enum      | The status of the component. Read-only. Allowed enum values: `operational`, `degraded`, `partial_outage`, `major_outage`, `maintenance`.                                                                                                                                                                                                                                      |
| components            | type                           | enum      | The type of the component. Allowed enum values: `component`.                                                                                                                                                                                                                                                                                                                  |
| components            | id                             | uuid      | The ID of the component. Read-only.                                                                                                                                                                                                                                                                                                                                           |
| components            | name                           | string    | The name of the component.                                                                                                                                                                                                                                                                                                                                                    |
| components            | position                       | int64     | The zero-indexed position of the component.                                                                                                                                                                                                                                                                                                                                   |
| components            | status                         | enum      | The status of the component. Read-only. Allowed enum values: `operational`, `degraded`, `partial_outage`, `major_outage`, `maintenance`.                                                                                                                                                                                                                                      |
| components            | type                           | enum      | The type of the component. Allowed enum values: `component`, `group`.                                                                                                                                                                                                                                                                                                         |
| attributes            | created_at                     | date-time | Timestamp of when the status page was created.                                                                                                                                                                                                                                                                                                                                |
| attributes            | custom_domain                  | string    | If configured, the url that the status page is accessible at.                                                                                                                                                                                                                                                                                                                 |
| attributes            | custom_domain_enabled          | boolean   | Whether the custom domain is configured.                                                                                                                                                                                                                                                                                                                                      |
| attributes            | domain_prefix                  | string    | The subdomain of the status page URL. Public pages use `https://{domain_prefix}.statuspage.datadoghq.com`, while private pages use `https://{domain_prefix}.private.statuspage.datadoghq.com`. Globally unique across Datadog Status Pages.                                                                                                                                   |
| attributes            | email_header_image             | string    | Base64-encoded image data included in email notifications sent to status page subscribers.                                                                                                                                                                                                                                                                                    |
| attributes            | email_notifications_enabled    | boolean   | Whether email notifications are enabled for the status page. Must be enabled when `subscriptions_enabled` is `true`.                                                                                                                                                                                                                                                          |
| attributes            | enabled                        | boolean   | Whether the status page is enabled.                                                                                                                                                                                                                                                                                                                                           |
| attributes            | favicon                        | string    | Base64-encoded image data displayed in the browser tab.                                                                                                                                                                                                                                                                                                                       |
| attributes            | modified_at                    | date-time | Timestamp of when the status page was last modified.                                                                                                                                                                                                                                                                                                                          |
| attributes            | ms_teams_subscriptions_enabled | boolean   | Whether Microsoft Teams subscriptions are enabled for the status page.                                                                                                                                                                                                                                                                                                        |
| attributes            | name                           | string    | The name of the status page.                                                                                                                                                                                                                                                                                                                                                  |
| attributes            | page_url                       | string    | The url that the status page is accessible at.                                                                                                                                                                                                                                                                                                                                |
| attributes            | rss_feed_enabled               | boolean   | Whether the RSS feed is enabled for the status page.                                                                                                                                                                                                                                                                                                                          |
| attributes            | slack_app_icon                 | string    | The Slack app icon URL for the status page.                                                                                                                                                                                                                                                                                                                                   |
| attributes            | slack_subscriptions_enabled    | boolean   | Whether Slack subscriptions are enabled for the status page.                                                                                                                                                                                                                                                                                                                  |
| attributes            | subscriptions_enabled          | boolean   | Whether users can subscribe to the status page.                                                                                                                                                                                                                                                                                                                               |
| attributes            | type                           | enum      | The type of the status page controlling how the status page is accessed. Public pages are accessible to anyone, internal pages are accessible to authenticated users in the Datadog organization, and private pages are accessible only to users matching an allow email access policy and no deny email access policy. Allowed enum values: `public`, `internal`, `private`. |
| attributes            | visualization_layout           | enum      | The layout of components on the status page. Defaults to `list`. `grid` requires `visualization_type` to be `component_name_only`; changing `visualization_type` to any other value resets the layout to `list`. Allowed enum values: `list`, `grid`.                                                                                                                         |
| attributes            | visualization_type             | enum      | The visualization type of the status page. Allowed enum values: `bars_and_uptime_percentage`, `bars_only`, `component_name_only`.                                                                                                                                                                                                                                             |
| <type=status_pages>   | id                             | uuid      | The ID of the status page.                                                                                                                                                                                                                                                                                                                                                    |
| <type=status_pages>   | relationships                  | object    | The relationships of a status page.                                                                                                                                                                                                                                                                                                                                           |
| relationships         | created_by_user                | object    | The Datadog user who created the status page.                                                                                                                                                                                                                                                                                                                                 |
| created_by_user       | data [*required*]              | object    | The data object identifying the Datadog user who created the status page.                                                                                                                                                                                                                                                                                                     |
| data                  | id [*required*]                | string    | The ID of the Datadog user who created the status page.                                                                                                                                                                                                                                                                                                                       |
| data                  | type [*required*]              | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                                                                                                                          |
| relationships         | last_modified_by_user          | object    | The Datadog user who last modified the status page.                                                                                                                                                                                                                                                                                                                           |
| last_modified_by_user | data [*required*]              | object    | The data object identifying the Datadog user who last modified the status page.                                                                                                                                                                                                                                                                                               |
| data                  | id [*required*]                | string    | The ID of the Datadog user who last modified the status page.                                                                                                                                                                                                                                                                                                                 |
| data                  | type [*required*]              | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                                                                                                                          |
| <type=status_pages>   | type [*required*]              | enum      | Status pages resource type. Allowed enum values: `status_pages`. Default: `status_pages`.                                                                                                                                                                                                                                                                                     |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "created_at": "2026-01-01T00:00:00.000Z",
      "effect": "allow",
      "pattern": "@example.com"
    },
    "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
          "type": "users"
        }
      },
      "status_page": {
        "data": {
          "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
          "type": "status_pages"
        }
      }
    },
    "type": "email_access_policies"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="409" %}
Conflict

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export page_id="1234abcd-12ab-34cd-56ef-123456abcdef"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/statuspages/${page_id}/access_policies/email" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "effect": "allow",
      "pattern": "@example.com"
    },
    "type": "email_access_policies"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
