Update Type Schema
deprecated
Update an existing catalog types schema, adding or removing attributes.
Updating the schema is handled separately from creating and updating types, so that you don’t have to worry about dependencies between types. For example, if type A has an attribute that relies on type B, you would have to create type B first.
By allowing the creation of types without a schema, they can be created in any order, but it means that you need to make a separate call to this endpoint to update the schema.
POST
/
v2
/
catalog_types
/
{id}
/
actions
/
update_schema
Update Type Schema
curl --request POST \
--url https://api.incident.io/v2/catalog_types/{id}/actions/update_schema \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": [
{
"array": false,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [
{
"attribute_id": "abc123"
}
],
"type": "Custom[\"Service\"]"
}
],
"version": 1
}
'import requests
url = "https://api.incident.io/v2/catalog_types/{id}/actions/update_schema"
payload = {
"attributes": [
{
"array": False,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [{ "attribute_id": "abc123" }],
"type": "Custom[\"Service\"]"
}
],
"version": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: [
{
array: false,
backlink_attribute: 'abc123',
id: '01GW2G3V0S59R238FAHPDS1R66',
mode: '',
name: 'tier',
path: [{attribute_id: 'abc123'}],
type: 'Custom["Service"]'
}
],
version: 1
})
};
fetch('https://api.incident.io/v2/catalog_types/{id}/actions/update_schema', 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/catalog_types/{id}/actions/update_schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attributes' => [
[
'array' => false,
'backlink_attribute' => 'abc123',
'id' => '01GW2G3V0S59R238FAHPDS1R66',
'mode' => '',
'name' => 'tier',
'path' => [
[
'attribute_id' => 'abc123'
]
],
'type' => 'Custom["Service"]'
]
],
'version' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/catalog_types/{id}/actions/update_schema"
payload := strings.NewReader("{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/catalog_types/{id}/actions/update_schema")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/catalog_types/{id}/actions/update_schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}"
response = http.request(request)
puts response.read_body{
"catalog_type": {
"annotations": {
"incident.io/catalog-importer/id": "id-of-config"
},
"categories": [
"customer"
],
"color": "yellow",
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"dynamic_resource_parameter": "abc123",
"estimated_count": 7,
"icon": "alert",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"is_editable": false,
"last_synced_at": "2021-08-17T13:28:57.801578Z",
"name": "Kubernetes Cluster",
"ranked": true,
"registry_type": "PagerDutyService",
"required_integrations": [
"pager_duty"
],
"schema": {
"attributes": [
{
"array": false,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [
{
"attribute_id": "abc123",
"attribute_name": "abc123"
}
],
"type": "Custom[\"Service\"]"
}
],
"version": 1
},
"semantic_type": "abc123",
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
ID of this catalog type
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
application/json
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Example:
{
"annotations": {
"incident.io/catalog-importer/id": "id-of-config"
},
"categories": ["customer"],
"color": "yellow",
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"dynamic_resource_parameter": "abc123",
"estimated_count": 7,
"icon": "alert",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"is_editable": false,
"last_synced_at": "2021-08-17T13:28:57.801578Z",
"name": "Kubernetes Cluster",
"ranked": true,
"registry_type": "PagerDutyService",
"required_integrations": ["pager_duty"],
"schema": {
"attributes": [
{
"array": false,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [
{
"attribute_id": "abc123",
"attribute_name": "abc123"
}
],
"type": "Custom[\"Service\"]"
}
],
"version": 1
},
"semantic_type": "custom",
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
Was this page helpful?
⌘I
Update Type Schema
curl --request POST \
--url https://api.incident.io/v2/catalog_types/{id}/actions/update_schema \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": [
{
"array": false,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [
{
"attribute_id": "abc123"
}
],
"type": "Custom[\"Service\"]"
}
],
"version": 1
}
'import requests
url = "https://api.incident.io/v2/catalog_types/{id}/actions/update_schema"
payload = {
"attributes": [
{
"array": False,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [{ "attribute_id": "abc123" }],
"type": "Custom[\"Service\"]"
}
],
"version": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: [
{
array: false,
backlink_attribute: 'abc123',
id: '01GW2G3V0S59R238FAHPDS1R66',
mode: '',
name: 'tier',
path: [{attribute_id: 'abc123'}],
type: 'Custom["Service"]'
}
],
version: 1
})
};
fetch('https://api.incident.io/v2/catalog_types/{id}/actions/update_schema', 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/catalog_types/{id}/actions/update_schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attributes' => [
[
'array' => false,
'backlink_attribute' => 'abc123',
'id' => '01GW2G3V0S59R238FAHPDS1R66',
'mode' => '',
'name' => 'tier',
'path' => [
[
'attribute_id' => 'abc123'
]
],
'type' => 'Custom["Service"]'
]
],
'version' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/catalog_types/{id}/actions/update_schema"
payload := strings.NewReader("{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.incident.io/v2/catalog_types/{id}/actions/update_schema")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/catalog_types/{id}/actions/update_schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": [\n {\n \"array\": false,\n \"backlink_attribute\": \"abc123\",\n \"id\": \"01GW2G3V0S59R238FAHPDS1R66\",\n \"mode\": \"\",\n \"name\": \"tier\",\n \"path\": [\n {\n \"attribute_id\": \"abc123\"\n }\n ],\n \"type\": \"Custom[\\\"Service\\\"]\"\n }\n ],\n \"version\": 1\n}"
response = http.request(request)
puts response.read_body{
"catalog_type": {
"annotations": {
"incident.io/catalog-importer/id": "id-of-config"
},
"categories": [
"customer"
],
"color": "yellow",
"created_at": "2021-08-17T13:28:57.801578Z",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"dynamic_resource_parameter": "abc123",
"estimated_count": 7,
"icon": "alert",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"is_editable": false,
"last_synced_at": "2021-08-17T13:28:57.801578Z",
"name": "Kubernetes Cluster",
"ranked": true,
"registry_type": "PagerDutyService",
"required_integrations": [
"pager_duty"
],
"schema": {
"attributes": [
{
"array": false,
"backlink_attribute": "abc123",
"id": "01GW2G3V0S59R238FAHPDS1R66",
"mode": "",
"name": "tier",
"path": [
{
"attribute_id": "abc123",
"attribute_name": "abc123"
}
],
"type": "Custom[\"Service\"]"
}
],
"version": 1
},
"semantic_type": "abc123",
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}