{"_id":"56c3cec2106c12170020db96","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"},"user":"564e5788230d7c1700c9073e","__v":6,"category":{"_id":"56a96d338791090d00113bab","__v":13,"pages":["56a96d492bb3910d000ee931","56c3cec2106c12170020db96","56c51da4ba4a540d0091b9b7","56c51dc3ba4a540d0091b9b9","56c51eb916c7190d00ff7b19","56c51ec2d7b9ed19008d1752","56c51eec668eb01900719bcd","56c51effba4a540d0091b9bb","56c51f1cf7c4da0d00614b02","56c51f2a8dc1c51900abc142","56c51f367de3580d00bdaf2a","56c67b6270e7660d004a8985","56c67b7cfd00bb0d0016daad"],"project":"564e5930c3553e0d003e53d0","version":"564e5a9b1560880d008d30dc","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-28T01:21:55.716Z","from_sync":false,"order":1,"slug":"patterns","title":"REST API"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T01:37:06.960Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":13,"body":"If an API request is successful, PagerDuty will respond to it with HTTP status code 2XX and the resources that match the query.\n\nIf the API request is unsuccessful, PagerDuty will respond with a corresponding HTTP error status code and the response body will contain PagerDuty error details.\n\nThe response body (with error details) will have the following properties:\n[block:html]\n{\n  \"html\": \"<pre class=\\\" language-javascript\\\"><code class=\\\" language-javascript\\\"><span class=\\\"token punctuation\\\">{</span>\\n  <span class=\\\"token string\\\">\\\"error\\\"</span><span class=\\\"token punctuation\\\">:</span> <span class=\\\"token punctuation\\\">{</span>\\n    <span class=\\\"token string\\\">\\\"message\\\"</span><span class=\\\"token punctuation\\\">:</span> <span class=\\\"token string\\\">\\\"Error Message String\\\"</span><span class=\\\"token punctuation\\\">,</span>\\n    <span class=\\\"token string\\\">\\\"code\\\"</span><span class=\\\"token punctuation\\\">:</span> <span class=\\\"token number\\\">2001</span><span class=\\\"token punctuation\\\">,</span>\\n    <span class=\\\"token string\\\">\\\"errors\\\"</span><span class=\\\"token punctuation\\\">:</span> <span class=\\\"token punctuation\\\">[</span>\\n      <span class=\\\"token string\\\">\\\"human-readable error details\\\"</span><span class=\\\"token punctuation\\\">,</span>\\n      <span class=\\\"token string\\\">\\\"more details\\\"</span>\\n    <span class=\\\"token punctuation\\\">]</span>\\n  <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"HTTP Responses\"\n}\n[/block]\nThe HTTP response can be used to determine if the request was successful, and if not, whether the request should be retried.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"HTTP Definition\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"200\",\n    \"0-1\": \"OK\",\n    \"0-2\": \"The request was successful.\",\n    \"1-0\": \"201\",\n    \"1-1\": \"Created\",\n    \"1-2\": \"The request was successful and a new resource was created.\",\n    \"2-0\": \"204\",\n    \"2-1\": \"No Content\",\n    \"2-2\": \"The request was successful. No content is returned.\",\n    \"3-0\": \"400\",\n    \"3-1\": \"Bad Request\",\n    \"3-2\": \"Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.\",\n    \"4-0\": \"401\",\n    \"4-1\": \"Unauthorized\",\n    \"4-2\": \"Caller did not supply credentials or did not provide the correct credentials.\",\n    \"6-0\": \"403\",\n    \"6-1\": \"Forbidden\",\n    \"6-2\": \"Caller is not authorized to view the requested resource.\",\n    \"7-0\": \"404\",\n    \"7-1\": \"Not Found\",\n    \"7-2\": \"The requested resource was not found.\",\n    \"8-0\": \"408\",\n    \"8-1\": \"Request Timeout\",\n    \"8-2\": \"The request took too long to process. Please try again.\",\n    \"10-0\": \"500\",\n    \"10-1\": \"Internal Server Error\",\n    \"10-2\": \"Internal error occurred while processing request. Please try again.\",\n    \"9-0\": \"429\",\n    \"9-1\": \"Too Many Requests\",\n    \"9-2\": \"The caller is making requests too frequently. Wait a moment before making further requests and make them at a reduced rate.\",\n    \"5-0\": \"402\",\n    \"5-1\": \"Payment Required\",\n    \"5-2\": \"The PagerDuty account does not have access to one or more abilities needed to complete this request. Use the [Account Abilities API](/v2/page/api-reference#!/Abilities/get_abilities)  to determine which abilities the account supports.\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"PagerDuty Error Codes\"\n}\n[/block]\nIn the case of an error, the PagerDuty error code can give further details on the nature of the error.\n\nThis list of error codes is not exhaustive, but is representative of the kinds of errors you will see in API responses.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Message\",\n    \"0-0\": \"1001\",\n    \"0-1\": \"Incident Already Resolved\",\n    \"1-0\": \"1002\",\n    \"1-1\": \"Incident Already Acknowledged\",\n    \"2-0\": \"1003\",\n    \"2-1\": \"Invalid Status Provided\",\n    \"3-0\": \"1004\",\n    \"3-1\": \"Invalid Id Provided\",\n    \"4-0\": \"1005\",\n    \"4-1\": \"Data Updated Since Last Request\",\n    \"5-0\": \"1006\",\n    \"5-1\": \"Cannot Escalate\",\n    \"6-0\": \"1007\",\n    \"6-1\": \"Assigned To User Not Found\",\n    \"7-0\": \"1008\",\n    \"7-1\": \"Requester User Not Found\",\n    \"8-0\": \"1009\",\n    \"8-1\": \"Error Parsing before_time Parameter\",\n    \"9-0\": \"1010\",\n    \"9-1\": \"Before Time or Before Incident Number Not Found\",\n    \"10-0\": \"1011\",\n    \"10-1\": \"Cannot process reassign action\",\n    \"11-0\": \"1012\",\n    \"11-1\": \"Incident Is Not Acknowledged\",\n    \"12-0\": \"1013\",\n    \"12-1\": \"Snooze Duration is Invalid\",\n    \"13-0\": \"1014\",\n    \"13-1\": \"Escalation Policy Not Found\",\n    \"14-0\": \"2000\",\n    \"14-1\": \"An internal error has occurred. PagerDuty administrators have been notified.\",\n    \"15-0\": \"2001\",\n    \"15-1\": \"* Cannot Delete Only Rule For Escalation Policy\\n* Cannot create more than 50 users at one time\\n* Escalation Policy has already been taken\\n* Incident could not be created\\n* Invalid Input Provided\\n* Users must be an array\",\n    \"16-0\": \"2002\",\n    \"16-1\": \"Arguments Caused Error\",\n    \"17-0\": \"2003\",\n    \"17-1\": \"Missing Arguments\",\n    \"18-0\": \"2004\",\n    \"18-1\": \"Invalid time values in 'since' and/or 'until' parameters\",\n    \"19-0\": \"2005\",\n    \"19-1\": \"Invalid Query Date Range\",\n    \"20-0\": \"2006\",\n    \"20-1\": \"Authentication failed\",\n    \"21-0\": \"2007\",\n    \"21-1\": \"Account Not Found\",\n    \"22-0\": \"2008\",\n    \"22-1\": \"Account Locked\",\n    \"23-0\": \"2009\",\n    \"23-1\": \"Only HTTPS Allowed For This Call\",\n    \"24-0\": \"2010\",\n    \"24-1\": \"Access Denied\",\n    \"25-0\": \"2011\",\n    \"25-1\": \"You must specify a requester_id to perform this action\",\n    \"26-0\": \"2012\",\n    \"26-1\": \"Your account is expired and cannot use the API.\",\n    \"27-0\": \"2013\",\n    \"27-1\": \"User not found\",\n    \"28-0\": \"2100\",\n    \"28-1\": \"Not Found\",\n    \"29-0\": \"3001\",\n    \"29-1\": \"Invalid Schedule\",\n    \"30-0\": \"3004\",\n    \"30-1\": \"* Schedule Not Found\\n* Unknown Schedule\",\n    \"31-0\": \"4004\",\n    \"31-1\": \"* Invalid Override\\n* Override Not Found\",\n    \"32-0\": \"5001\",\n    \"32-1\": \"* Affiliate Partner Not Found\\n* Color Not Found\\n* Escalation Policy Not Found\\n* Escalation Rule Not Found\\n* Incident Not Found\\n* Log Entry Not Found\\n* Maintenance Window Not Found\\n* User Next On-call Not Found\\n* Vendor Not Found\\n* Webhook Not Found\",\n    \"33-0\": \"5002\",\n    \"33-1\": \"* Service Not Found\\n* Simple Log Entry Limit Reached\",\n    \"34-0\": \"5003\",\n    \"34-1\": \"Cannot cancel a maintenance window from the past\",\n    \"35-0\": \"6001\",\n    \"35-1\": \"Team Not Found\",\n    \"36-0\": \"7001\",\n    \"36-1\": \"saml is not enabled\",\n    \"37-0\": \"7002\",\n    \"37-1\": \"SAMLResponse is not provided\",\n    \"38-0\": \"7003\",\n    \"38-1\": \"failed to parse SAMLResponse\",\n    \"39-0\": \"7004\",\n    \"39-1\": \"SAMLResponse is invalid\",\n    \"40-0\": \"7005\",\n    \"40-1\": \"unable to find user by name_id\",\n    \"41-0\": \"7006\",\n    \"41-1\": \"invalid name_id found in SAMLResponse\",\n    \"42-0\": \"7007\",\n    \"42-1\": \"unexpected validation error\",\n    \"43-0\": \"8001\",\n    \"43-1\": \"* google auth is not enabled\\n* pre_auth.authorizable? returned false\",\n    \"44-0\": \"8002\",\n    \"44-1\": \"redirect_uri is invalid\",\n    \"45-0\": \"8004\",\n    \"45-1\": \"unable to find account\",\n    \"46-0\": \"8005\",\n    \"46-1\": \"unable to find user by name_id\",\n    \"47-0\": \"8006\",\n    \"47-1\": \"user has denied google auth\",\n    \"48-0\": \"8007\",\n    \"48-1\": \"unable to log in using google auth\",\n    \"49-0\": \"8008\",\n    \"49-1\": \"user has tried to access an invalid host domain\"\n  },\n  \"cols\": 2,\n  \"rows\": 50\n}\n[/block]","excerpt":"Errors returned by the PagerDuty API","slug":"errors","type":"basic","title":"Errors"}

Errors

Errors returned by the PagerDuty API

If an API request is successful, PagerDuty will respond to it with HTTP status code 2XX and the resources that match the query. If the API request is unsuccessful, PagerDuty will respond with a corresponding HTTP error status code and the response body will contain PagerDuty error details. The response body (with error details) will have the following properties: [block:html] { "html": "<pre class=\" language-javascript\"><code class=\" language-javascript\"><span class=\"token punctuation\">{</span>\n <span class=\"token string\">\"error\"</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n <span class=\"token string\">\"message\"</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"Error Message String\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token string\">\"code\"</span><span class=\"token punctuation\">:</span> <span class=\"token number\">2001</span><span class=\"token punctuation\">,</span>\n <span class=\"token string\">\"errors\"</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n <span class=\"token string\">\"human-readable error details\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token string\">\"more details\"</span>\n <span class=\"token punctuation\">]</span>\n <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre>" } [/block] [block:api-header] { "type": "basic", "title": "HTTP Responses" } [/block] The HTTP response can be used to determine if the request was successful, and if not, whether the request should be retried. [block:parameters] { "data": { "h-0": "Code", "h-1": "HTTP Definition", "h-2": "Description", "0-0": "200", "0-1": "OK", "0-2": "The request was successful.", "1-0": "201", "1-1": "Created", "1-2": "The request was successful and a new resource was created.", "2-0": "204", "2-1": "No Content", "2-2": "The request was successful. No content is returned.", "3-0": "400", "3-1": "Bad Request", "3-2": "Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.", "4-0": "401", "4-1": "Unauthorized", "4-2": "Caller did not supply credentials or did not provide the correct credentials.", "6-0": "403", "6-1": "Forbidden", "6-2": "Caller is not authorized to view the requested resource.", "7-0": "404", "7-1": "Not Found", "7-2": "The requested resource was not found.", "8-0": "408", "8-1": "Request Timeout", "8-2": "The request took too long to process. Please try again.", "10-0": "500", "10-1": "Internal Server Error", "10-2": "Internal error occurred while processing request. Please try again.", "9-0": "429", "9-1": "Too Many Requests", "9-2": "The caller is making requests too frequently. Wait a moment before making further requests and make them at a reduced rate.", "5-0": "402", "5-1": "Payment Required", "5-2": "The PagerDuty account does not have access to one or more abilities needed to complete this request. Use the [Account Abilities API](/v2/page/api-reference#!/Abilities/get_abilities) to determine which abilities the account supports." }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "PagerDuty Error Codes" } [/block] In the case of an error, the PagerDuty error code can give further details on the nature of the error. This list of error codes is not exhaustive, but is representative of the kinds of errors you will see in API responses. [block:parameters] { "data": { "h-0": "Code", "h-1": "Message", "0-0": "1001", "0-1": "Incident Already Resolved", "1-0": "1002", "1-1": "Incident Already Acknowledged", "2-0": "1003", "2-1": "Invalid Status Provided", "3-0": "1004", "3-1": "Invalid Id Provided", "4-0": "1005", "4-1": "Data Updated Since Last Request", "5-0": "1006", "5-1": "Cannot Escalate", "6-0": "1007", "6-1": "Assigned To User Not Found", "7-0": "1008", "7-1": "Requester User Not Found", "8-0": "1009", "8-1": "Error Parsing before_time Parameter", "9-0": "1010", "9-1": "Before Time or Before Incident Number Not Found", "10-0": "1011", "10-1": "Cannot process reassign action", "11-0": "1012", "11-1": "Incident Is Not Acknowledged", "12-0": "1013", "12-1": "Snooze Duration is Invalid", "13-0": "1014", "13-1": "Escalation Policy Not Found", "14-0": "2000", "14-1": "An internal error has occurred. PagerDuty administrators have been notified.", "15-0": "2001", "15-1": "* Cannot Delete Only Rule For Escalation Policy\n* Cannot create more than 50 users at one time\n* Escalation Policy has already been taken\n* Incident could not be created\n* Invalid Input Provided\n* Users must be an array", "16-0": "2002", "16-1": "Arguments Caused Error", "17-0": "2003", "17-1": "Missing Arguments", "18-0": "2004", "18-1": "Invalid time values in 'since' and/or 'until' parameters", "19-0": "2005", "19-1": "Invalid Query Date Range", "20-0": "2006", "20-1": "Authentication failed", "21-0": "2007", "21-1": "Account Not Found", "22-0": "2008", "22-1": "Account Locked", "23-0": "2009", "23-1": "Only HTTPS Allowed For This Call", "24-0": "2010", "24-1": "Access Denied", "25-0": "2011", "25-1": "You must specify a requester_id to perform this action", "26-0": "2012", "26-1": "Your account is expired and cannot use the API.", "27-0": "2013", "27-1": "User not found", "28-0": "2100", "28-1": "Not Found", "29-0": "3001", "29-1": "Invalid Schedule", "30-0": "3004", "30-1": "* Schedule Not Found\n* Unknown Schedule", "31-0": "4004", "31-1": "* Invalid Override\n* Override Not Found", "32-0": "5001", "32-1": "* Affiliate Partner Not Found\n* Color Not Found\n* Escalation Policy Not Found\n* Escalation Rule Not Found\n* Incident Not Found\n* Log Entry Not Found\n* Maintenance Window Not Found\n* User Next On-call Not Found\n* Vendor Not Found\n* Webhook Not Found", "33-0": "5002", "33-1": "* Service Not Found\n* Simple Log Entry Limit Reached", "34-0": "5003", "34-1": "Cannot cancel a maintenance window from the past", "35-0": "6001", "35-1": "Team Not Found", "36-0": "7001", "36-1": "saml is not enabled", "37-0": "7002", "37-1": "SAMLResponse is not provided", "38-0": "7003", "38-1": "failed to parse SAMLResponse", "39-0": "7004", "39-1": "SAMLResponse is invalid", "40-0": "7005", "40-1": "unable to find user by name_id", "41-0": "7006", "41-1": "invalid name_id found in SAMLResponse", "42-0": "7007", "42-1": "unexpected validation error", "43-0": "8001", "43-1": "* google auth is not enabled\n* pre_auth.authorizable? returned false", "44-0": "8002", "44-1": "redirect_uri is invalid", "45-0": "8004", "45-1": "unable to find account", "46-0": "8005", "46-1": "unable to find user by name_id", "47-0": "8006", "47-1": "user has denied google auth", "48-0": "8007", "48-1": "unable to log in using google auth", "49-0": "8008", "49-1": "user has tried to access an invalid host domain" }, "cols": 2, "rows": 50 } [/block]