Skip to main content
PATCH
/
v2
/
{target}
/
{identifier}
/
attributes
/
{attribute}
Update an attribute
curl --request PATCH \
  --url https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": {
    "title": "Your Attribute",
    "description": "Lorem ipsum",
    "api_slug": "my-attribute",
    "is_required": true,
    "is_unique": true,
    "default_value": {
      "type": "static",
      "template": [
        {
          "value": 5
        }
      ]
    },
    "config": {},
    "is_archived": false
  }
}
'
import requests

url = "https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}"

payload = { "data": {
"title": "Your Attribute",
"description": "Lorem ipsum",
"api_slug": "my-attribute",
"is_required": True,
"is_unique": True,
"default_value": {
"type": "static",
"template": [{ "value": 5 }]
},
"config": {},
"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: 'Your Attribute',
description: 'Lorem ipsum',
api_slug: 'my-attribute',
is_required: true,
is_unique: true,
default_value: {type: 'static', template: [{value: 5}]},
config: {},
is_archived: false
}
})
};

fetch('https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}', 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}",
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' => 'Your Attribute',
'description' => 'Lorem ipsum',
'api_slug' => 'my-attribute',
'is_required' => true,
'is_unique' => true,
'default_value' => [
'type' => 'static',
'template' => [
[
'value' => 5
]
]
],
'config' => [

],
'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}"

payload := strings.NewReader("{\n \"data\": {\n \"title\": \"Your Attribute\",\n \"description\": \"Lorem ipsum\",\n \"api_slug\": \"my-attribute\",\n \"is_required\": true,\n \"is_unique\": true,\n \"default_value\": {\n \"type\": \"static\",\n \"template\": [\n {\n \"value\": 5\n }\n ]\n },\n \"config\": {},\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}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"Your Attribute\",\n \"description\": \"Lorem ipsum\",\n \"api_slug\": \"my-attribute\",\n \"is_required\": true,\n \"is_unique\": true,\n \"default_value\": {\n \"type\": \"static\",\n \"template\": [\n {\n \"value\": 5\n }\n ]\n },\n \"config\": {},\n \"is_archived\": false\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.attio.com/v2/{target}/{identifier}/attributes/{attribute}")

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\": \"Your Attribute\",\n \"description\": \"Lorem ipsum\",\n \"api_slug\": \"my-attribute\",\n \"is_required\": true,\n \"is_unique\": true,\n \"default_value\": {\n \"type\": \"static\",\n \"template\": [\n {\n \"value\": 5\n }\n ]\n },\n \"config\": {},\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"
    },
    "title": "Company",
    "description": "A company attribute",
    "api_slug": "company",
    "type": "record-reference",
    "is_system_attribute": false,
    "is_writable": true,
    "is_required": false,
    "is_unique": false,
    "is_multiselect": false,
    "is_default_value_enabled": false,
    "is_archived": false,
    "default_value": null,
    "relationship": {
      "id": {
        "workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
        "object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
        "attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
      },
      "object_slug": "companies",
      "title": "Team members",
      "api_slug": "team_members",
      "is_multiselect": true
    },
    "created_at": "2021-11-21T13:22:49.061Z",
    "config": {
      "currency": {
        "default_currency_code": null,
        "display_type": null
      },
      "record_reference": {
        "allowed_object_ids": [
          "companies"
        ]
      }
    }
  }
}
{
"status_code": 400,
"type": "invalid_request_error",
"code": "system_edit_unauthorized",
"message": "Cannot update a System attribute."
}
{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Attribute with slug/ID \"my-attribute\" not found."
}

Authorizations

Authorization
string
header
required

This API uses OAuth 2.0 with the authorization code grant flow.

Path Parameters

target
enum<string>
required

Whether the attribute is on an object or a list.

Available options:
objects,
lists
Example:

"lists"

identifier
string
required

A UUID or slug to identify the object or list the attribute belongs to.

Example:

"33ebdbe9-e529-47c9-b894-0ba25e9c15c0"

attribute
string
required

A UUID or slug to identify the attribute.

Example:

"41252299-f8c7-4b5e-99c9-4ff8321d2f96"

Body

application/json
data
object
required

Response

Success

Success

data
object
required
Example:
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
},
"title": "Company",
"description": "A company attribute",
"api_slug": "company",
"type": "record-reference",
"is_system_attribute": false,
"is_writable": true,
"is_required": false,
"is_unique": false,
"is_multiselect": false,
"is_default_value_enabled": false,
"is_archived": false,
"default_value": null,
"relationship": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
},
"object_slug": "companies",
"title": "Team members",
"api_slug": "team_members",
"is_multiselect": true
},
"created_at": "2021-11-21T13:22:49.061Z",
"config": {
"currency": {
"default_currency_code": null,
"display_type": null
},
"record_reference": { "allowed_object_ids": ["companies"] }
}
}