Show
Show a single workflow run, including the full webhook delivery for any step that sent one.
A delivery is kept for 7 days. After that webhook_delivery_state becomes
expired and the delivery itself is absent: the step still ran and may well have
succeeded, so an expired delivery must not be read as a failure.
This may return a cancelled run, in which case cancelled_at is set.
GET
/
v2
/
workflow_runs
/
{id}
Show
curl --request GET \
--url https://api.incident.io/v2/workflow_runs/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/workflow_runs/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/workflow_runs/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/workflow_runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/workflow_runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/workflow_runs/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/workflow_runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workflow_run": {
"cancelled_at": "2021-08-17T13:28:57.801578Z",
"created_at": "2021-08-17T13:28:57.801578Z",
"enqueued_at": "2021-08-17T13:28:57.801578Z",
"error": "Something went wrong and our engineers have been notified.",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_reference": "INC-123",
"progress": [
{
"completed_at": "2021-08-17T13:28:57.801578Z",
"error": "Something went wrong and our engineers have been notified.",
"incident_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_reference": "INC-123",
"status": "complete",
"step": "slack.post_message",
"webhook_delivery": {
"duration_ms": 412,
"endpoint": "https://example.com/hooks/incident",
"method": "POST",
"outcome": "non_2xx",
"request": {
"body": "{\"incident_id\":\"01FCNDV6P870EA6S7TK1DSYDG0\"}",
"body_truncated": false,
"headers": {
"Content-Type": "application/json"
}
},
"response": {
"body": "{\"error\":\"unprocessable\"}",
"body_truncated": false,
"headers": {
"Content-Type": "application/json"
}
},
"status_code": 500
},
"webhook_delivery_state": "expired"
}
],
"scheduled_at": "2021-08-17T13:28:57.801578Z",
"updated_at": "2021-08-17T13:28:57.801578Z",
"workflow_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"workflow_name": "Announce incident updates",
"workflow_version_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"workflow_version_number": 3
}
}🔑 Requires the
workflows.view scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Unique identifier for the workflow run
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Show
curl --request GET \
--url https://api.incident.io/v2/workflow_runs/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/workflow_runs/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/workflow_runs/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/workflow_runs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/workflow_runs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/workflow_runs/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/workflow_runs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workflow_run": {
"cancelled_at": "2021-08-17T13:28:57.801578Z",
"created_at": "2021-08-17T13:28:57.801578Z",
"enqueued_at": "2021-08-17T13:28:57.801578Z",
"error": "Something went wrong and our engineers have been notified.",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_reference": "INC-123",
"progress": [
{
"completed_at": "2021-08-17T13:28:57.801578Z",
"error": "Something went wrong and our engineers have been notified.",
"incident_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_reference": "INC-123",
"status": "complete",
"step": "slack.post_message",
"webhook_delivery": {
"duration_ms": 412,
"endpoint": "https://example.com/hooks/incident",
"method": "POST",
"outcome": "non_2xx",
"request": {
"body": "{\"incident_id\":\"01FCNDV6P870EA6S7TK1DSYDG0\"}",
"body_truncated": false,
"headers": {
"Content-Type": "application/json"
}
},
"response": {
"body": "{\"error\":\"unprocessable\"}",
"body_truncated": false,
"headers": {
"Content-Type": "application/json"
}
},
"status_code": 500
},
"webhook_delivery_state": "expired"
}
],
"scheduled_at": "2021-08-17T13:28:57.801578Z",
"updated_at": "2021-08-17T13:28:57.801578Z",
"workflow_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"workflow_name": "Announce incident updates",
"workflow_version_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"workflow_version_number": 3
}
}