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

# Events API v1

# PagerDuty Events API

The Events API is how you would add PagerDuty's advanced alerting functionality to any system that can make an HTTP API call. You can now add phone, SMS and email alerting to your monitoring tools, ticketing systems and custom software.


## Description

The API was designed to allow you to easily integrate a monitoring system with a Service in PagerDuty. Monitoring systems generally send out events when problems are detected and when these problems have been resolved (fixed). Some more advanced systems also understand the concept of acknowledgements: problems can be acknowledged by an engineer to signal he or she is working on fixing the issue.

Since monitoring systems emit events, the API is based around accepting events. Incoming events (sent via the API) are routed to a PagerDuty service and processed. They may result in a new incident being created, or an existing incident being acknowledged or resolved.

The same event-based API can also be used to integrate a PagerDuty service with ticketing systems and various other software tools.

Interested in becoming a PagerDuty partner? Check out how you can [Publish an App](https://docs.pagerduty.com/developer/publish-an-app)!


## Getting Started

The Events API can be used with any "Generic API" service in PagerDuty. If you don't already have a "Generic API" service, you should create one:

1. In your account, under the Services tab, click "Add New Service".
2. Enter a name for the service and select an escalation policy. Then, select "Generic API" for the Service Type.
3. Click the "Add Service" button.
4. Once the service is created, you'll be taken to the service page. On this page, you'll see the "Service key", which is needed to access the API


## Making a Request

To make an API request, POST a JSON object of the desired event type to the following URL:

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


## Event Types

The `event_type` field specifies what action to take on an incident:


| Event Type    | Description |
| ------------- | ------------|
| `trigger`     | Your monitoring tools should send PagerDuty a trigger event to report a new or ongoing problem. When PagerDuty receives a trigger event, it will either open a new incident, or add a new trigger log entry to an existing incident, depending on the provided incident_key. |
| `acknowledge` | Acknowledge events cause the referenced incident to enter the acknowledged state. While an incident is acknowledged, it won't generate any additional notifications, even if it receives new trigger events. Your monitoring tools should send PagerDuty an acknowledge event when they know someone is presently working on the problem. |
| `resolve`     | Resolve events cause the referenced incident to enter the resolved state. Once an incident is resolved, it won't generate any additional notifications. New trigger events with the same incident_key as a resolved incident won't re-open the incident. Instead, a new incident will be created. Your monitoring tools should send PagerDuty a resolve event when the problem that caused the initial trigger event has been fixed. |


## API Response Codes & Retry Logic

Ideally, the API request will succeed and the PagerDuty server will indicate that it successfully received that event. In practice, the request may fail due to various reasons.

The following table shows the possible results of the API request and if you need to retry the API call for that result:


| Result  | Description   | Retry? |
| ------- | ------------- | ------ |
| 200     | OK - The event has been accepted by PagerDuty. See below for details. | No |
| 400     | Bad Request - Check that the JSON is valid. See below for details.    | No |
| 403     | Forbidden - Too many API calls at a time.                             | Yes - retry after some time. |
| 500 or other 5XX  | Internal Server Error - the PagerDuty server experienced an error while processing the event. | Yes - retry after some time. |
| Networking Error  | Error while trying to communicate with PagerDuty servers.   | Yes - retry after some time. |


## API Limits

There is a limit on the number of events that a service can accept at any given time. Depending on the behavior of the incoming traffic and how many incidents are being created at once, we reduce our throttle dynamically.

If each of the events your monitoring system is sending is important, be sure to retry on a 403 response code, preferably with a back off.

- [Send Event](https://docs.pagerduty.com/developer/api/reference/events-v1/send-event.md)

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