Show
Show a single secret’s metadata, including its version history. Never returns values.
GET
/
v2
/
secrets
/
{id}
Show
curl --request GET \
--url https://api.incident.io/v2/secrets/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/secrets/{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/secrets/{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/secrets/{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/secrets/{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/secrets/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/secrets/{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{
"secret": {
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "Auth token for the PagerDuty outgoing webhook",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"last_four_chars": "c123",
"name": "PagerDuty webhook token",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"updated_at": "2021-08-17T13:28:57.801578Z",
"version": 3
},
"versions": [
{
"created_at": "2021-08-17T13:28:57.801578Z",
"created_by": {
"alert": {
"id": "01GW2G3V0S59R238FAHPDS1R66",
"title": "*errors.withMessage: PG::Error failed to connect"
},
"api_key": {
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My test API key"
},
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
},
"workflow": {
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My little workflow"
}
},
"last_four_chars": "c123",
"version": 3
}
]
}Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The secret's ID
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Response
200 - application/json
OK response.
A secret is a named credential that workflows can reference, for example an auth token for an outgoing webhook.
Its value can be set and rotated but never read back: the API stores it encrypted and only ever returns masked metadata (the last four characters of the current value). Update the value with the rotate action, which appends a new version and retires the previous one.
Show child attributes
Show child attributes
The secret's versions, newest first
Show child attributes
Show child attributes
Example:
[ { "created_at": "2021-08-17T13:28:57.801578Z", "created_by": { "alert": { "id": "01GW2G3V0S59R238FAHPDS1R66", "title": "*errors.withMessage: PG::Error failed to connect" }, "api_key": { "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "My test API key" }, "user": { "email": "lisa@incident.io", "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "Lisa Karlin Curtis", "role": "owner", "slack_user_id": "U02AYNF2XJM" }, "workflow": { "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "My little workflow" } }, "last_four_chars": "c123", "version": 3 } ]
Was this page helpful?
⌘I
Show
curl --request GET \
--url https://api.incident.io/v2/secrets/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/secrets/{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/secrets/{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/secrets/{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/secrets/{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/secrets/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/secrets/{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{
"secret": {
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "Auth token for the PagerDuty outgoing webhook",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"last_four_chars": "c123",
"name": "PagerDuty webhook token",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"updated_at": "2021-08-17T13:28:57.801578Z",
"version": 3
},
"versions": [
{
"created_at": "2021-08-17T13:28:57.801578Z",
"created_by": {
"alert": {
"id": "01GW2G3V0S59R238FAHPDS1R66",
"title": "*errors.withMessage: PG::Error failed to connect"
},
"api_key": {
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My test API key"
},
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
},
"workflow": {
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "My little workflow"
}
},
"last_four_chars": "c123",
"version": 3
}
]
}