curl --request POST \
--url https://api.attio.com/v2/lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"name": "Enterprise Sales",
"api_slug": "enterprise_sales",
"parent_object": "people",
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
]
}
}
'import requests
url = "https://api.attio.com/v2/lists"
payload = { "data": {
"name": "Enterprise Sales",
"api_slug": "enterprise_sales",
"parent_object": "people",
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
]
} }
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({
data: {
name: 'Enterprise Sales',
api_slug: 'enterprise_sales',
parent_object: 'people',
workspace_access: 'read-and-write',
workspace_member_access: [
{
workspace_member_id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b',
level: 'read-and-write'
}
]
}
})
};
fetch('https://api.attio.com/v2/lists', 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/lists",
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([
'data' => [
'name' => 'Enterprise Sales',
'api_slug' => 'enterprise_sales',
'parent_object' => 'people',
'workspace_access' => 'read-and-write',
'workspace_member_access' => [
[
'workspace_member_id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b',
'level' => 'read-and-write'
]
]
]
]),
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/lists"
payload := strings.NewReader("{\n \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\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.attio.com/v2/lists")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/lists")
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 \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"list_id": "33ebdbe9-e529-47c9-b894-0ba25e9c15c0"
},
"api_slug": "hiring-engineering",
"name": "Hiring Engineering",
"parent_object": [
"people"
],
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
],
"created_by_actor": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2022-11-21T13:22:49.061281000Z"
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Workspace member with ID \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\" not found."
}{
"status_code": 403,
"type": "auth_error",
"code": "billing_error",
"message": "You attempted to create a List using permissions features that are not currently supported on your plan. Please upgrade, contact sales, or try a different access configuration for your list."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Parent object with slug/ID \"people\" not found."
}{
"status_code": 409,
"type": "invalid_request_error",
"code": "slug_conflict",
"message": "A list with api_slug \"my_list\" already exists."
}Create a list
Creates a new list.
Once you have your list, add attributes to it using the Create attribute API, and add records to it using the Add records to list API.
New lists must specify which records can be added with the parent_object parameter which accepts either an object slug or an object ID. Permissions for the list are controlled with the workspace_access and workspace_member_access parameters.
Please note that new lists must have either workspace_access set to "full-access" or one or more element of workspace_member_access with a "full-access" level. It is also possible to receive a 403 billing error if your workspace is not on a plan that supports either advanced workspace or workspace member-level access for lists.
Required scopes: list_configuration:read-write.
curl --request POST \
--url https://api.attio.com/v2/lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"name": "Enterprise Sales",
"api_slug": "enterprise_sales",
"parent_object": "people",
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
]
}
}
'import requests
url = "https://api.attio.com/v2/lists"
payload = { "data": {
"name": "Enterprise Sales",
"api_slug": "enterprise_sales",
"parent_object": "people",
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
]
} }
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({
data: {
name: 'Enterprise Sales',
api_slug: 'enterprise_sales',
parent_object: 'people',
workspace_access: 'read-and-write',
workspace_member_access: [
{
workspace_member_id: '50cf242c-7fa3-4cad-87d0-75b1af71c57b',
level: 'read-and-write'
}
]
}
})
};
fetch('https://api.attio.com/v2/lists', 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/lists",
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([
'data' => [
'name' => 'Enterprise Sales',
'api_slug' => 'enterprise_sales',
'parent_object' => 'people',
'workspace_access' => 'read-and-write',
'workspace_member_access' => [
[
'workspace_member_id' => '50cf242c-7fa3-4cad-87d0-75b1af71c57b',
'level' => 'read-and-write'
]
]
]
]),
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/lists"
payload := strings.NewReader("{\n \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\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.attio.com/v2/lists")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attio.com/v2/lists")
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 \"data\": {\n \"name\": \"Enterprise Sales\",\n \"api_slug\": \"enterprise_sales\",\n \"parent_object\": \"people\",\n \"workspace_access\": \"read-and-write\",\n \"workspace_member_access\": [\n {\n \"workspace_member_id\": \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\",\n \"level\": \"read-and-write\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"list_id": "33ebdbe9-e529-47c9-b894-0ba25e9c15c0"
},
"api_slug": "hiring-engineering",
"name": "Hiring Engineering",
"parent_object": [
"people"
],
"workspace_access": "read-and-write",
"workspace_member_access": [
{
"workspace_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b",
"level": "read-and-write"
}
],
"created_by_actor": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"created_at": "2022-11-21T13:22:49.061281000Z"
}
}{
"status_code": 400,
"type": "invalid_request_error",
"code": "value_not_found",
"message": "Workspace member with ID \"50cf242c-7fa3-4cad-87d0-75b1af71c57b\" not found."
}{
"status_code": 403,
"type": "auth_error",
"code": "billing_error",
"message": "You attempted to create a List using permissions features that are not currently supported on your plan. Please upgrade, contact sales, or try a different access configuration for your list."
}{
"status_code": 404,
"type": "invalid_request_error",
"code": "not_found",
"message": "Parent object with slug/ID \"people\" not found."
}{
"status_code": 409,
"type": "invalid_request_error",
"code": "slug_conflict",
"message": "A list with api_slug \"my_list\" already exists."
}Was this page helpful?