> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Create an Event Enrichment

`POST https://api.pagerduty.com/enrichment/event_enrichments`

Event Enrichments allow you to automatically add contextual data to events as they're ingested, so that relevant information is available throughout the event, alert, and incident lifecycle. By leveraging the Contextual Data Platform (CDP), you can define rules that extract values from events or query enrichment schemas to populate event fields.

<!-- theme: warning -->

> ### Early Access
> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.

Create a new Event Enrichment.

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`) — required

The Event Enrichment to create.

| Field | Type | Required | Description |
|---|---|---|---|
| `event_enrichment` | object | yes |  |
| `event_enrichment.id` | string |  | ID of the Event Enrichment. Read-only. |
| `event_enrichment.name` | string |  | The name of the Event Enrichment. |
| `event_enrichment.description` | string \| null |  | A description of this Event Enrichment's purpose. |
| `event_enrichment.is_default` | boolean |  | Indicates whether this Event Enrichment is the account default. Read-only. |
| `event_enrichment.associated_services` | integer |  | The number of Services associated with this Event Enrichment. Read-only. |
| `event_enrichment.associated_event_orchestrations` | integer |  | The number of Event Orchestrations associated with this Event Enrichment. Read-only. |
| `event_enrichment.team` | object \| null |  | Reference to the team that owns this Event Enrichment. |
| `event_enrichment.team.id` | string |  | The ID of the team. |
| `event_enrichment.team.type` | string |  | A string that determines the schema of the object. Read-only. |
| `event_enrichment.team.self` | string (url) |  | The API show URL at which the object is accessible. Read-only. |
| `event_enrichment.privileges` | object \| null |  | Details about the read/update permissions of the current user for this Event Enrichment. Only present when `include[]=privileges` is requested. Read-only. |
| `event_enrichment.privileges.permissions` | array of string |  | The list of permissions the current user has for this Event Enrichment. |
| `event_enrichment.created_at` | string (date-time) |  | The date/time the Event Enrichment was created. Read-only. |
| `event_enrichment.created_by` | object \| null |  | Reference to the user that created the Event Enrichment. Read-only. |
| `event_enrichment.created_by.id` | string |  | Read-only. |
| `event_enrichment.created_by.type` | string |  | A string that determines the schema of the object. Read-only. |
| `event_enrichment.created_by.self` | string (url) |  | The API show URL at which the object is accessible. Read-only. |
| `event_enrichment.updated_at` | string (date-time) |  | The date/time the Event Enrichment was last updated. Read-only. |
| `event_enrichment.updated_by` | object \| null |  | Reference to the user that last updated the Event Enrichment. Read-only. |
| `event_enrichment.updated_by.id` | string |  | Read-only. |
| `event_enrichment.updated_by.type` | string |  | A string that determines the schema of the object. Read-only. |
| `event_enrichment.updated_by.self` | string (url) |  | The API show URL at which the object is accessible. Read-only. |
| `event_enrichment.self` | string (url) |  | The API show URL at which the object is accessible. Read-only. |

Example: Create a new Event Enrichment

```json
{
  "event_enrichment": {
    "name": "1st Event Enrichment",
    "description": "My very first EE!",
    "team": {
      "id": "PA5JAKW"
    }
  }
}
```

## Response 200

The Event Enrichment was created successfully.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `event_enrichment` | object |  | Same fields as `event_enrichment` above. |

Example: Example Response

```json
{
  "event_enrichment": {
    "id": "AGN4PVDO2F5AZIVWETZ42I6IP4",
    "name": "1st Event Enrichment",
    "description": "My very first EE!",
    "is_default": false,
    "associated_services": 0,
    "associated_event_orchestrations": 0,
    "team": {
      "id": "PA5JAKW",
      "type": "team_reference",
      "self": "https://api.pagerduty.com/teams/PA5JAKW"
    },
    "created_at": "2023-10-25T22:04:24Z",
    "created_by": {
      "id": "P1TYZRY",
      "type": "user_reference",
      "self": "https://api.pagerduty.com/users/P1TYZRY"
    },
    "updated_at": "2023-10-25T22:04:24Z",
    "updated_by": {
      "id": "P1TYZRY",
      "type": "user_reference",
      "self": "https://api.pagerduty.com/users/P1TYZRY"
    },
    "self": "https://api.pagerduty.com/enrichment/event_enrichments/AGN4PVDO2F5AZIVWETZ42I6IP4"
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 500

Internal Server Error the PagerDuty server experienced an error.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
