Skip to main content
POST
/
v1
/
custom_field_options
Create
curl --request POST \
  --url https://api.incident.io/v1/custom_field_options \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
  "sort_key": 10,
  "value": "Product"
}
'
import requests

url = "https://api.incident.io/v1/custom_field_options"

payload = {
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"sort_key": 10,
"value": "Product"
}
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({custom_field_id: '01FCNDV6P870EA6S7TK1DSYDG0', sort_key: 10, value: 'Product'})
};

fetch('https://api.incident.io/v1/custom_field_options', 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/v1/custom_field_options",
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([
'custom_field_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'sort_key' => 10,
'value' => 'Product'
]),
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/v1/custom_field_options"

payload := strings.NewReader("{\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"sort_key\": 10,\n \"value\": \"Product\"\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/v1/custom_field_options")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"sort_key\": 10,\n \"value\": \"Product\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.incident.io/v1/custom_field_options")

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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"sort_key\": 10,\n \"value\": \"Product\"\n}"

response = http.request(request)
puts response.read_body
{
  "custom_field_option": {
    "custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
    "id": "01FCNDV6P870EA6S7TK1DSYDG0",
    "sort_key": 10,
    "value": "Product"
  }
}
🔑 Requires the organisation_settings.update scope.

Authorizations

Authorization
string
header
required

API key from your incident.io dashboard (Settings → API keys)

Body

application/json
custom_field_id
string
required

ID of the custom field this option belongs to

Example:

"01FCNDV6P870EA6S7TK1DSYDG0"

value
string
required

Human readable name for the custom field option. Values must not start or end with whitespace, or contain tabs or newlines.

Example:

"Product"

sort_key
integer<int64>
default:1000

Sort key used to order the custom field options correctly

Example:

10

Response

201 - application/json

Created response.

custom_field_option
object
required