Update an object view
curl --request PATCH \
--url https://api.attio.com/v2/objects/{object}/views/{view_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "Leads",
"type": "kanban",
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": true,
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
}
}
'import requests
url = "https://api.attio.com/v2/objects/{object}/views/{view_id}"
payload = { "data": {
"title": "Leads",
"type": "kanban",
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": True,
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
} }
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: 'Leads',
type: 'kanban',
filter: {attribute: 'name', op: 'contains', value: 'Ada'},
sorts: [{attribute: 'name', field: 'last_name', direction: 'asc'}],
attributes: [{attribute: 'name', field: 'first_name'}],
kanban: {
status_attribute: ['company', {object: 'companies', attribute: 'name'}],
show_no_status_column: true,
aggregation: {attribute: 'deal_value', type: 'sum'}
}
}
})
};
fetch('https://api.attio.com/v2/objects/{object}/views/{view_id}', 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/objects/{object}/views/{view_id}",
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' => 'Leads',
'type' => 'kanban',
'filter' => [
'attribute' => 'name',
'op' => 'contains',
'value' => 'Ada'
],
'sorts' => [
[
'attribute' => 'name',
'field' => 'last_name',
'direction' => 'asc'
]
],
'attributes' => [
[
'attribute' => 'name',
'field' => 'first_name'
]
],
'kanban' => [
'status_attribute' => [
'company',
[
'object' => 'companies',
'attribute' => 'name'
]
],
'show_no_status_column' => true,
'aggregation' => [
'attribute' => 'deal_value',
'type' => 'sum'
]
]
]
]),
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/objects/{object}/views/{view_id}"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\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/objects/{object}/views/{view_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/objects/{object}/views/{view_id}")
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\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\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",
"view_id": "cf7aaeb5-7507-4a84-9c26-9d36e34d7b70"
},
"title": "All people",
"created_at": "2022-11-21T13:22:49.061281000Z",
"type": "table",
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"metadata": {
"41252299-f8c7-4b5e-99c9-4ff8321d2f96": {
"kind": "attribute",
"title": "Name",
"api_slug": "name"
}
},
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": true,
"attribute_label_display": "icon",
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "unknown_attribute",
"message": "No attribute matches \"nickname\" on this object",
"path": [
"data",
"filter",
"attribute"
]
}{
"status_code": 403,
"type": "auth_error",
"code": "unauthorized",
"message": "You do not have the necessary permissions to update views of this object."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "The referenced view was not found."
}Views
Update an object view
Updates the title, type, filter, sorts, shown attributes or kanban settings of a view of an object. Each given field replaces that part of the view, and an omitted field stays as it is. Attributes, objects, options and statuses can be referenced by slug, ID or title; the response references them by ID, as the get view endpoint does.
This endpoint is in alpha and may be subject to breaking changes as we gather feedback.
Required scopes: view:read-write, object_configuration:read.
Supported token levels: workspace, user.
PATCH
/
v2
/
objects
/
{object}
/
views
/
{view_id}
Update an object view
curl --request PATCH \
--url https://api.attio.com/v2/objects/{object}/views/{view_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "Leads",
"type": "kanban",
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": true,
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
}
}
'import requests
url = "https://api.attio.com/v2/objects/{object}/views/{view_id}"
payload = { "data": {
"title": "Leads",
"type": "kanban",
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": True,
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
} }
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: 'Leads',
type: 'kanban',
filter: {attribute: 'name', op: 'contains', value: 'Ada'},
sorts: [{attribute: 'name', field: 'last_name', direction: 'asc'}],
attributes: [{attribute: 'name', field: 'first_name'}],
kanban: {
status_attribute: ['company', {object: 'companies', attribute: 'name'}],
show_no_status_column: true,
aggregation: {attribute: 'deal_value', type: 'sum'}
}
}
})
};
fetch('https://api.attio.com/v2/objects/{object}/views/{view_id}', 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/objects/{object}/views/{view_id}",
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' => 'Leads',
'type' => 'kanban',
'filter' => [
'attribute' => 'name',
'op' => 'contains',
'value' => 'Ada'
],
'sorts' => [
[
'attribute' => 'name',
'field' => 'last_name',
'direction' => 'asc'
]
],
'attributes' => [
[
'attribute' => 'name',
'field' => 'first_name'
]
],
'kanban' => [
'status_attribute' => [
'company',
[
'object' => 'companies',
'attribute' => 'name'
]
],
'show_no_status_column' => true,
'aggregation' => [
'attribute' => 'deal_value',
'type' => 'sum'
]
]
]
]),
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/objects/{object}/views/{view_id}"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\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/objects/{object}/views/{view_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/objects/{object}/views/{view_id}")
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\": \"Leads\",\n \"type\": \"kanban\",\n \"filter\": {\n \"attribute\": \"name\",\n \"op\": \"contains\",\n \"value\": \"Ada\"\n },\n \"sorts\": [\n {\n \"attribute\": \"name\",\n \"field\": \"last_name\",\n \"direction\": \"asc\"\n }\n ],\n \"attributes\": [\n {\n \"attribute\": \"name\",\n \"field\": \"first_name\"\n }\n ],\n \"kanban\": {\n \"status_attribute\": [\n \"company\",\n {\n \"object\": \"companies\",\n \"attribute\": \"name\"\n }\n ],\n \"show_no_status_column\": true,\n \"aggregation\": {\n \"attribute\": \"deal_value\",\n \"type\": \"sum\"\n }\n }\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",
"view_id": "cf7aaeb5-7507-4a84-9c26-9d36e34d7b70"
},
"title": "All people",
"created_at": "2022-11-21T13:22:49.061281000Z",
"type": "table",
"sorts": [
{
"attribute": "name",
"field": "last_name",
"direction": "asc"
}
],
"attributes": [
{
"attribute": "name",
"field": "first_name"
}
],
"metadata": {
"41252299-f8c7-4b5e-99c9-4ff8321d2f96": {
"kind": "attribute",
"title": "Name",
"api_slug": "name"
}
},
"filter": {
"attribute": "name",
"op": "contains",
"value": "Ada"
},
"kanban": {
"status_attribute": [
"company",
{
"object": "companies",
"attribute": "name"
}
],
"show_no_status_column": true,
"attribute_label_display": "icon",
"aggregation": {
"attribute": "deal_value",
"type": "sum"
}
}
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "unknown_attribute",
"message": "No attribute matches \"nickname\" on this object",
"path": [
"data",
"filter",
"attribute"
]
}{
"status_code": 403,
"type": "auth_error",
"code": "unauthorized",
"message": "You do not have the necessary permissions to update views of this object."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "The referenced view was not found."
}Authorizations
Scopes
Path Parameters
Was this page helpful?