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

# Send an event to PagerDuty

`POST https://events.pagerduty.com/generic/2010-04-15/create_event.json`

Your monitoring tools should send PagerDuty a trigger event to report a new problem, or update an ongoing problem, depending on the event type.

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

| Field | Type | Required | Description |
|---|---|---|---|
| `service_key` | string | yes | The GUID of one of your "Generic API" services. This is the "Integration Key" listed on a Generic API's service detail page. |
| `event_type` | string | yes | The type of event. Can be `trigger`, `acknowledge` or `resolve`. One of: `trigger`, `acknowledge`, `resolve`. |
| `incident_key` | string |  | Identifies the incident to `trigger`, `acknowledge`, or `resolve`. Required unless the `event_type` is `trigger`. |
| `description` | string |  | Text that will appear in the incident's log associated with this event. Required for `trigger` events. |
| `details` | object |  | An arbitrary JSON object containing any data you'd like included in the incident log. |
| `client` | string |  | The name of the monitoring client that is triggering this event. (This field is only used for `trigger` events.) |
| `client_url` | string (url) |  | The URL of the monitoring client that is triggering this event. (This field is only used for `trigger` events.) |
| `contexts` | array of one of: object \| object |  | Contexts to be included with the incident trigger such as links to graphs or images. (This field is only used for `trigger` events.) |
| `contexts[].type` | string | yes | (option 1) The type of context being attached to the incident. One of: `link`. |
| `contexts[].href` | string (url) | yes | (option 1) The link being attached to the incident. |
| `contexts[].text` | string |  | (option 1) Optional information pertaining to this context link. |
| `contexts[].type` | string | yes | (option 2) The type of context being attached to the incident. One of: `image`. |
| `contexts[].src` | string (url) | yes | (option 2) The source of the image being attached to the incident. This image must be served via HTTPS. |
| `contexts[].href` | string (url) |  | (option 2) Optional link for the image. |
| `contexts[].alt` | string |  | (option 2) Optional alternative text for the image. |

Example: Example Request Body

```json
{
  "service_key": "e93facc04764012d7bfb002500d5d1a6",
  "incident_key": "srv01/HTTP",
  "event_type": "trigger",
  "description": "FAILURE for production/HTTP on machine srv01.acme.com",
  "client": "Sample Monitoring Service",
  "client_url": "https://monitoring.service.com",
  "details": {
    "ping time": "1500ms",
    "load avg": 0.75
  },
  "contexts": [
    {
      "type": "link",
      "href": "http://acme.pagerduty.com"
    },
    {
      "type": "link",
      "href": "http://acme.pagerduty.com"
    },
    {
      "text": "View the incident on PagerDuty",
      "type": "image",
      "src": "https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1"
    },
    {
      "type": "image",
      "src": "https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1",
      "href": "https://google.com"
    }
  ]
}
```

## Response 200

The incident has been opened or updated.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | string | yes | A short name for the error, or "success" if successful. |
| `incident_key` | string |  | The key of the incident that will be affected by the request, if successful. |
| `message` | string |  | A description of the problem, or "Event processed" if successful. |

Example: Example Success Response

```json
{
  "status": "success",
  "message": "Event processed",
  "incident_key": "srv01/HTTP"
}
```

## Response 400

Invalid event format (i.e. JSON parse error) or incorrect event structure

## Response 403

Rate limit reached (too many Events API requests)

## Response 5XX

An error occurred on a request.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | string | yes | A short name for the error. |
| `message` | string | yes | A description of the problem. |
| `errors` | array of string |  | An array of specific error messages. |

Example: Example Error Response

```json
{
  "status": "unrecognized object",
  "message": "Event object format is unrecognized",
  "errors": [
    "JSON parse error"
  ]
}
```

## 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).
