Create Type
Create a catalog type. The schema must be updated using the UpdateTypeSchema endpoint.
curl --request POST \
--url https://api.incident.io/v3/catalog_types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"annotations": {
"incident.io/catalog-importer/id": "id-of-config"
},
"categories": [
"customer"
],
"color": "yellow",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"icon": "alert",
"name": "Kubernetes Cluster",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"ranked": true,
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"use_name_as_identifier": true
}
'import requests
url = "https://api.incident.io/v3/catalog_types"
payload = {
"annotations": { "incident.io/catalog-importer/id": "id-of-config" },
"categories": ["customer"],
"color": "yellow",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"icon": "alert",
"name": "Kubernetes Cluster",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"],
"ranked": True,
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"use_name_as_identifier": True
}
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({
annotations: {'incident.io/catalog-importer/id': 'id-of-config'},
categories: ['customer'],
color: 'yellow',
description: 'Represents Kubernetes clusters that we run inside of GKE.',
icon: 'alert',
name: 'Kubernetes Cluster',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH'],
ranked: true,
source_repo_url: 'https://github.com/my-company/incident-io-catalog',
type_name: 'Custom["BackstageGroup"]',
use_name_as_identifier: true
})
};
fetch('https://api.incident.io/v3/catalog_types', 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/v3/catalog_types",
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([
'annotations' => [
'incident.io/catalog-importer/id' => 'id-of-config'
],
'categories' => [
'customer'
],
'color' => 'yellow',
'description' => 'Represents Kubernetes clusters that we run inside of GKE.',
'icon' => 'alert',
'name' => 'Kubernetes Cluster',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
],
'ranked' => true,
'source_repo_url' => 'https://github.com/my-company/incident-io-catalog',
'type_name' => 'Custom["BackstageGroup"]',
'use_name_as_identifier' => true
]),
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/v3/catalog_types"
payload := strings.NewReader("{\n \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\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/v3/catalog_types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v3/catalog_types")
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 \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\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,
"is_team_type": false,
"last_synced_at": "2021-08-17T13:28:57.801578Z",
"name": "Kubernetes Cluster",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"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
},
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"updated_at": "2021-08-17T13:28:57.801578Z",
"use_name_as_identifier": true
}
}Authorizations
API key from your incident.io dashboard (Settings → API keys)
Body
Human readble description of this type
"Represents Kubernetes clusters that we run inside of GKE."
Name is the human readable name of this type
"Kubernetes Cluster"
Annotations that can track metadata about this type
Show child attributes
Show child attributes
{
"incident.io/catalog-importer/id": "id-of-config"
}
What categories is this type considered part of
customer, issue-tracker, product-feature, service, on-call, team, user ["customer"]
Sets the display color of this type in the dashboard
yellow, green, blue, violet, pink, cyan, orange "yellow"
Sets the display icon of this type in the dashboard
alert, bolt, box, briefcase, browser, bulb, calendar, clock, cog, components, database, doc, email, escalation-path, files, flag, folder, globe, money, server, severity, status-page, store, star, tag, user, users "alert"
IDs of the teams that own this catalog type
["01G0J1EXE7AXZ2C93K61WBPYEH"]
If this type should be ranked
true
The url of the external repository where this type is managed
"https://github.com/my-company/incident-io-catalog"
The type name of this catalog type, to be used when defining attributes. This is immutable once a CatalogType has been created. For non-externally sync types, it must follow the pattern Custom["SomeName"]
"Custom[\"BackstageGroup\"]"
If enabled, you can refer to entries of this type by their name, as well as their external ID and any aliases.
true
Response
Created response.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.incident.io/v3/catalog_types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"annotations": {
"incident.io/catalog-importer/id": "id-of-config"
},
"categories": [
"customer"
],
"color": "yellow",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"icon": "alert",
"name": "Kubernetes Cluster",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"ranked": true,
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"use_name_as_identifier": true
}
'import requests
url = "https://api.incident.io/v3/catalog_types"
payload = {
"annotations": { "incident.io/catalog-importer/id": "id-of-config" },
"categories": ["customer"],
"color": "yellow",
"description": "Represents Kubernetes clusters that we run inside of GKE.",
"icon": "alert",
"name": "Kubernetes Cluster",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"],
"ranked": True,
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"use_name_as_identifier": True
}
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({
annotations: {'incident.io/catalog-importer/id': 'id-of-config'},
categories: ['customer'],
color: 'yellow',
description: 'Represents Kubernetes clusters that we run inside of GKE.',
icon: 'alert',
name: 'Kubernetes Cluster',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH'],
ranked: true,
source_repo_url: 'https://github.com/my-company/incident-io-catalog',
type_name: 'Custom["BackstageGroup"]',
use_name_as_identifier: true
})
};
fetch('https://api.incident.io/v3/catalog_types', 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/v3/catalog_types",
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([
'annotations' => [
'incident.io/catalog-importer/id' => 'id-of-config'
],
'categories' => [
'customer'
],
'color' => 'yellow',
'description' => 'Represents Kubernetes clusters that we run inside of GKE.',
'icon' => 'alert',
'name' => 'Kubernetes Cluster',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
],
'ranked' => true,
'source_repo_url' => 'https://github.com/my-company/incident-io-catalog',
'type_name' => 'Custom["BackstageGroup"]',
'use_name_as_identifier' => true
]),
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/v3/catalog_types"
payload := strings.NewReader("{\n \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\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/v3/catalog_types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v3/catalog_types")
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 \"annotations\": {\n \"incident.io/catalog-importer/id\": \"id-of-config\"\n },\n \"categories\": [\n \"customer\"\n ],\n \"color\": \"yellow\",\n \"description\": \"Represents Kubernetes clusters that we run inside of GKE.\",\n \"icon\": \"alert\",\n \"name\": \"Kubernetes Cluster\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"ranked\": true,\n \"source_repo_url\": \"https://github.com/my-company/incident-io-catalog\",\n \"type_name\": \"Custom[\\\"BackstageGroup\\\"]\",\n \"use_name_as_identifier\": true\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,
"is_team_type": false,
"last_synced_at": "2021-08-17T13:28:57.801578Z",
"name": "Kubernetes Cluster",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"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
},
"source_repo_url": "https://github.com/my-company/incident-io-catalog",
"type_name": "Custom[\"BackstageGroup\"]",
"updated_at": "2021-08-17T13:28:57.801578Z",
"use_name_as_identifier": true
}
}