{"_id":"56631bc7cd54d50d005015f7","user":"564e5788230d7c1700c9073e","__v":7,"project":"564e5930c3553e0d003e53d0","version":{"_id":"564e5a9b1560880d008d30dc","project":"564e5930c3553e0d003e53d0","__v":21,"createdAt":"2015-11-19T23:26:19.166Z","releaseDate":"2015-11-19T23:26:19.166Z","categories":["564e5a9b1560880d008d30dd","566318e1f5ca460d00f41896","56631d08cd54d50d005015fa","56631d2a81ad7417006a202c","5668ba19fbd7680d009375f4","5668cb8b10bda80d00797ed9","5668cb9d10bda80d00797eda","56830d8a3f94e00d004e2a7a","56830d9072bb720d0091f594","56830d94cb4d190d0027698e","56830dc44aecbd0d00a464c5","569e90f3c9b43e0d00c4bab1","56a96d338791090d00113bab","56b12d8336d2580d00247877","56c36bf0a869d017002ea55b","56c36bf93d30210d00ea84bb","56c77749b935671700ff0304","56c7ab9e5652c217008e091a","56cb8bdad5c6241d00ef5e61","58aefce02470660f00b54539","58aefd0bebd7370f0078b954"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"Foundation","version_clean":"2.0.0","version":"2"},"category":{"_id":"56c77749b935671700ff0304","__v":6,"pages":["56c777aec2f82e0d00d7cfc4","56cf5f668629f91300fd97ce","56d00c374a03c00b00a07c03","56d3b713d3f4650b00749658","56d3d74fd3f4650b00749677","56d3d9d20b39260b008da47b"],"project":"564e5930c3553e0d003e53d0","version":"564e5a9b1560880d008d30dc","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-19T20:12:57.931Z","from_sync":false,"order":2,"slug":"events-api","title":"Events API v1"},"editedParams":true,"editedParams2":true,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-05T17:15:51.559Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"56631e70a504730d00deb708","examples":{"codes":[{"language":"json","code":"/*\n  This example shows how to send a trigger event without an incident_key.\n  In this case, PagerDuty will automatically assign a random and unique key\n  and return it in the response object.\n  You should store this key in case you want to send an acknowledge or resolve\n  event to this incident in the future.\n*/\n\n{    \n  \"service_key\": \"e93facc04764012d7bfb002500d5d1a6\",\n  \"event_type\": \"trigger\",\n  \"description\": \"FAILURE for production/HTTP on machine srv01.acme.com\",\n  \"client\": \"Sample Monitoring Service\",\n  \"client_url\": \"https://monitoring.service.com\",\n  \"details\": {\n    \"ping time\": \"1500ms\",\n    \"load avg\": 0.75\n  },\n  \"contexts\":[ \n    {\n      \"type\": \"link\",\n      \"href\": \"http://acme.pagerduty.com\",\n      \"text\" : \"View in custom tool\"\n    },{\n      \"type\": \"link\",\n      \"href\": \"http://acme.pagerduty.com\",\n      \"text\": \"View the incident on PagerDuty\"\n    },{\n      \"type\": \"image\",\n      \"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\"\n    }\n  ]\n}","name":"Trigger Event"},{"language":"json","name":"Acknowledge Event","code":"/*\n  This example acknowledges an existing open incident with the incident key \"srv01/HTTP\".\n  If there is no open incident with that service key, no action will be taken.\n*/\n\n{\n  \"service_key\": \"e93facc04764012d7bfb002500d5d1a6\",\n  \"event_type\": \"acknowledge\",\n  \"incident_key\": \"srv01/HTTP\"\n}"},{"name":"Resolve Event","language":"json","code":"/*\n  This example resolves an existing open incident with the incident key \"srv01/HTTP\".\n  If there is no open incident with that service key, no action will be taken.\n*/\n\n{\n  \"service_key\": \"e93facc04764012d7bfb002500d5d1a6\",\n  \"event_type\": \"resolve\",\n  \"incident_key\": \"srv01/HTTP\"\n}"}]},"method":"post","results":{"codes":[{"code":"{\n  \"status\": \"success\",\n  \"message\": \"Event processed\",\n  \"incident_key\": \"73af7a305bd7012d7c06002500d5d1a6\"\n}","language":"json","status":200,"name":"Event Processed"},{"code":"{\n    \"status\": \"invalid event\",\n    \"message\": \"Event object is invalid\",\n    \"errors\": [ // This errors array indicates why the event was invalid\n        \"event_type is invalid (must be one of: trigger acknowledge resolve)\"\n    ]\n}","language":"json","status":400,"name":"Invalid Event"},{"code":"","language":"text","status":403,"name":"Rate Limited"}]},"auth":"never","params":[{"_id":"56631c21cd54d50d005015f9","ref":"","in":"body","required":true,"desc":"The GUID of one of your \"Generic API\" services. This is the \"Integration Key\" listed on a Generic API's service detail page.","default":"","type":"string","name":"service_key"},{"_id":"56d3bf49433eed15004d2552","ref":"","in":"body","required":true,"desc":"The type of event. Can be `trigger`, `acknowledge` or `resolve`.","default":"trigger","type":"string","name":"event_type"},{"_id":"56d3bf49433eed15004d2551","ref":"","in":"body","required":false,"desc":"Identifies the incident to `trigger`, `acknowledge`, or `resolve`. Required unless the `event_type` is `trigger`. The maximum permitted length of this property is **255 characters.**","default":"","type":"string","name":"incident_key"},{"_id":"56d3bf49433eed15004d2550","ref":"","in":"body","required":true,"desc":"Text that will appear in the incident's log associated with this event. Required for `trigger` events.","default":"","type":"string","name":"description"},{"_id":"56d3bf49433eed15004d254f","ref":"","in":"body","required":false,"desc":"An arbitrary JSON object containing any data you'd like included in the incident log.","default":"","type":"object","name":"details"},{"_id":"56d3bf49433eed15004d254e","ref":"","in":"body","required":false,"desc":"The name of the monitoring client that is triggering this event. (This field is only used for `trigger` events.)","default":"","type":"string","name":"client"},{"_id":"56d3bf49433eed15004d254d","ref":"","in":"body","required":false,"desc":"The URL of the monitoring client that is triggering this event. If the value is blank, the link will be dead. (This field is only used for `trigger` events.)","default":"","type":"string","name":"client_url"},{"_id":"56d3bf49433eed15004d254c","ref":"","in":"body","required":false,"desc":"Contexts to be included with the incident trigger such as links to graphs or images. (This field is only used for `trigger` events.)","default":"","type":"array_object","name":"contexts"}],"url":"/generic/2010-04-15/create_event.json"},"isReference":false,"order":1,"body":"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](/v2/page/api-reference#!/Log_Entries/get_log_entries) to an existing incident, depending on the provided `incident_key`.\n\nRead more about [event types](doc:events-api#event-types) and [incident de-duplication](doc:events-api#incident-de-duplication-and-incident_key) in the [Events API Overview](doc:events-api).\n\nIf the event is improperly formatted, a `400 Bad Request` will be returned.\n\nThere 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 to ensure that important events continue to be processed.\n\nIf the service has received too many events, a `403 Forbidden` will be returned. If it is vital that all events your monitoring tool sends be received, be sure to retry on a 403 response code (preferably with a back off).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Contexts\"\n}\n[/block]\nThe `contexts` field is a [JSON array](doc:types#array) of informational assets that can be attached to the incident. Every element of the array is a [JSON object](doc:types#object) referred to as a `context`.\n\nEvery `context` must have a `type`. There are a few different types of contexts supported; the fields allowed and required depend on the context type.\n\n## `link` context\n\nThe `link` type is used to attach hyperlinks to an incident.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"Yes\",\n    \"0-0\": \"`type`\",\n    \"0-2\": \"The `type` of context being attached to the incident. For `link` contexts, this must be `link`.\",\n    \"1-0\": \"`href`\",\n    \"1-1\": \"Yes\",\n    \"1-2\": \"The link being attached to the incident.\",\n    \"2-0\": \"`text`\",\n    \"2-1\": \"No\",\n    \"2-2\": \"Plain text that describes the purpose of the link, and can be used as the link's text.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n## `image` context\n\nThe `image` type is used to attach images to an incident. Images must be served via HTTPS.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Yes\",\n    \"0-2\": \"The `type` of context being attached to the incident. For `image` contexts, this must be `image`.\",\n    \"1-0\": \"`src`\",\n    \"1-1\": \"Yes\",\n    \"1-2\": \"The source of the image being attached to the incident. This image must be served via HTTPS.\",\n    \"2-0\": \"`href`\",\n    \"2-1\": \"No\",\n    \"2-2\": \"Optional link for the image.\",\n    \"3-0\": \"`alt`\",\n    \"3-1\": \"No\",\n    \"3-2\": \"Optional alternative text for the image.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]","excerpt":"Learn about the PagerDuty event format and send an event from this guide","slug":"trigger-events","type":"endpoint","title":"Send an Event"}

postSend an Event

Learn about the PagerDuty event format and send an event from this guide

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

service_key:
required
string
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:
required
stringtrigger
The type of event. Can be `trigger`, `acknowledge` or `resolve`.
incident_key:
string
Identifies the incident to `trigger`, `acknowledge`, or `resolve`. Required unless the `event_type` is `trigger`. The maximum permitted length of this property is **255 characters.**
description:
required
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
The URL of the monitoring client that is triggering this event. If the value is blank, the link will be dead. (This field is only used for `trigger` events.)
contexts:
array of objects
Contexts to be included with the incident trigger such as links to graphs or images. (This field is only used for `trigger` events.)

Examples


Result Format


Documentation

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](/v2/page/api-reference#!/Log_Entries/get_log_entries) to an existing incident, depending on the provided `incident_key`. Read more about [event types](doc:events-api#event-types) and [incident de-duplication](doc:events-api#incident-de-duplication-and-incident_key) in the [Events API Overview](doc:events-api). If the event is improperly formatted, a `400 Bad Request` will be returned. 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 to ensure that important events continue to be processed. If the service has received too many events, a `403 Forbidden` will be returned. If it is vital that all events your monitoring tool sends be received, be sure to retry on a 403 response code (preferably with a back off). [block:api-header] { "type": "basic", "title": "Contexts" } [/block] The `contexts` field is a [JSON array](doc:types#array) of informational assets that can be attached to the incident. Every element of the array is a [JSON object](doc:types#object) referred to as a `context`. Every `context` must have a `type`. There are a few different types of contexts supported; the fields allowed and required depend on the context type. ## `link` context The `link` type is used to attach hyperlinks to an incident. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-1": "Yes", "0-0": "`type`", "0-2": "The `type` of context being attached to the incident. For `link` contexts, this must be `link`.", "1-0": "`href`", "1-1": "Yes", "1-2": "The link being attached to the incident.", "2-0": "`text`", "2-1": "No", "2-2": "Plain text that describes the purpose of the link, and can be used as the link's text." }, "cols": 3, "rows": 3 } [/block] ## `image` context The `image` type is used to attach images to an incident. Images must be served via HTTPS. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "`type`", "0-1": "Yes", "0-2": "The `type` of context being attached to the incident. For `image` contexts, this must be `image`.", "1-0": "`src`", "1-1": "Yes", "1-2": "The source of the image being attached to the incident. This image must be served via HTTPS.", "2-0": "`href`", "2-1": "No", "2-2": "Optional link for the image.", "3-0": "`alt`", "3-1": "No", "3-2": "Optional alternative text for the image." }, "cols": 3, "rows": 4 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}