curl --request PATCH \
--url https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "Medium",
"is_archived": false
}
}
'import requests
url = "https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}"
payload = { "data": {
"title": "Medium",
"is_archived": False
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {title: 'Medium', is_archived: false}})
};
fetch('https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}', 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.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'title' => 'Medium',
'is_archived' => false
]
]),
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.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96",
"option_id": "08c2c59a-c18e-40c6-8dc4-95415313b2ea"
},
"title": "Medium",
"is_archived": false
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Cannot find select attribute with select option title \"Medium\"."
}{
"status_code": 403,
"type": "auth_error",
"code": "unauthorized",
"message": "You do not have the necessary permissions to update this select option."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Attribute with slug/ID \"my_attribute\" not found."
}{
"status_code": 409,
"type": "invalid_request_error",
"code": "slug_conflict",
"message": "There is already another select option with the title \"Medium\"."
}Update a select option
Updates a select option on an attribute on either an object or a list.
When target is objects, the required scopes are object_configuration:read-write. When target is lists, the required scopes are list_configuration:read-write.
Supported token levels: workspace, user.
curl --request PATCH \
--url https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "Medium",
"is_archived": false
}
}
'import requests
url = "https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}"
payload = { "data": {
"title": "Medium",
"is_archived": False
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {title: 'Medium', is_archived: false}})
};
fetch('https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}', 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.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'title' => 'Medium',
'is_archived' => false
]
]),
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.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}/options/{option}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"title\": \"Medium\",\n \"is_archived\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96",
"option_id": "08c2c59a-c18e-40c6-8dc4-95415313b2ea"
},
"title": "Medium",
"is_archived": false
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Cannot find select attribute with select option title \"Medium\"."
}{
"status_code": 403,
"type": "auth_error",
"code": "unauthorized",
"message": "You do not have the necessary permissions to update this select option."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Attribute with slug/ID \"my_attribute\" not found."
}{
"status_code": 409,
"type": "invalid_request_error",
"code": "slug_conflict",
"message": "There is already another select option with the title \"Medium\"."
}Authorizations
This API uses OAuth 2.0 with the authorization code grant flow.
Path Parameters
Whether the attribute is on an object or a list.
objects, lists "lists"
A UUID or slug to identify the object or list the select attribute belongs to.
"33ebdbe9-e529-47c9-b894-0ba25e9c15c0"
A UUID or slug to identify the select attribute.
"41252299-f8c7-4b5e-99c9-4ff8321d2f96"
A UUID or select option title to identify the select option you would like to update.
"Medium"
Body
Show child attributes
Show child attributes
Response
Success
Success
Show child attributes
Show child attributes
Was this page helpful?