Create a new incident in your account
1 min
POST
https://api.waydev.co/v2/incidents
Header Parameters
- AuthorizationstringrequiredDescription
Body Parameters
- bodyIncidentrequiredDescription
- titlestringrequiredExampleDescription
- identifierstringExampleDescription
- repository_idintegerrequiredExampleDescription
- urlstringExampleDescription
- refstringExampleDescription
- issued_atstringrequiredExampleDescription
- fixed_atstringExampleDescription
Responses
200
- objectDescription
- messagestringExample
- numberstringExample
401
- objectDescription
- messagestringExample
curl
curl --request POST \
--url https://api.waydev.co/v2/incidents \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'authorization: string' \
--data '{
"title": "Production failure",
"repository_id": 2548,
"issued_at": "2024-03-20 12:34:56"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("authorization", "string");
var raw = JSON.stringify({
"title": "Production failure",
"repository_id": 2548,
"issued_at": "2024-03-20 12:34:56"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.waydev.co/v2/incidents", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.waydev.co/v2/incidents")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["authorization"] = "string"
request.body = JSON.dump({
"title": "Production failure",
"repository_id": 2548,
"issued_at": "2024-03-20 12:34:56"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.waydev.co/v2/incidents"
payload = json.dumps({
"title": "Production failure",
"repository_id": 2548,
"issued_at": "2024-03-20 12:34:56"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'authorization': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successfully created
{
"message": "Incident successfully created",
"number": "v1.2"
}401
// Unauthorized
{
"message": "Unauthorized"
}