curl --request POST \
--url https://api.hubapi.com/crm/v3/lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filterBranch": {
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": true
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": [
"test",
"name"
]
},
"property": "firstname"
}
]
}
]
},
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingType": "DYNAMIC"
}
'import requests
url = "https://api.hubapi.com/crm/v3/lists"
payload = {
"filterBranch": {
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": True
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": ["test", "name"]
},
"property": "firstname"
}
]
}
]
},
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingType": "DYNAMIC"
}
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({
filterBranch: {
filterBranchType: 'OR',
filterBranches: [
{
filterBranchType: 'AND',
filterBranches: [
{
associationCategory: 'HUBSPOT_DEFINED',
associationTypeId: 4,
filterBranchType: 'ASSOCIATION',
filters: [
{
filterType: 'PROPERTY',
operation: {operationType: 'BOOL', operator: 'IS_EQUAL_TO', value: true},
property: 'hs_is_closed_won'
}
],
objectTypeId: '0-3',
operator: 'IN_LIST'
}
],
filters: [
{
filterType: 'PROPERTY',
operation: {
operationType: 'MULTISTRING',
operator: 'IS_EQUAL_TO',
values: ['test', 'name']
},
property: 'firstname'
}
]
}
]
},
name: 'Dynamic Association List Example',
objectTypeId: '0-1',
processingType: 'DYNAMIC'
})
};
fetch('https://api.hubapi.com/crm/v3/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.hubapi.com/crm/v3/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([
'filterBranch' => [
'filterBranchType' => 'OR',
'filterBranches' => [
[
'filterBranchType' => 'AND',
'filterBranches' => [
[
'associationCategory' => 'HUBSPOT_DEFINED',
'associationTypeId' => 4,
'filterBranchType' => 'ASSOCIATION',
'filters' => [
[
'filterType' => 'PROPERTY',
'operation' => [
'operationType' => 'BOOL',
'operator' => 'IS_EQUAL_TO',
'value' => true
],
'property' => 'hs_is_closed_won'
]
],
'objectTypeId' => '0-3',
'operator' => 'IN_LIST'
]
],
'filters' => [
[
'filterType' => 'PROPERTY',
'operation' => [
'operationType' => 'MULTISTRING',
'operator' => 'IS_EQUAL_TO',
'values' => [
'test',
'name'
]
],
'property' => 'firstname'
]
]
]
]
],
'name' => 'Dynamic Association List Example',
'objectTypeId' => '0-1',
'processingType' => 'DYNAMIC'
]),
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.hubapi.com/crm/v3/lists"
payload := strings.NewReader("{\n \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\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.hubapi.com/crm/v3/lists")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/crm/v3/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 \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\n}"
response = http.request(request)
puts response.read_body{
"list": {
"createdAt": "2023-11-15T18:16:52.165Z",
"createdById": "123",
"filterBranch": {
"filterBranchOperator": "OR",
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchOperator": "AND",
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchOperator": "AND",
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"includeObjectsWithNoValueSet": false,
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": true
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"includeObjectsWithNoValueSet": false,
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": [
"test",
"name"
]
},
"property": "firstname"
}
]
}
]
},
"filtersUpdatedAt": "2023-11-15T18:16:52.165Z",
"listId": "1",
"listVersion": 1,
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingStatus": "PROCESSING",
"processingType": "DYNAMIC",
"updatedAt": "2023-11-15T18:16:52.395Z",
"updatedById": "123"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Create list
curl --request POST \
--url https://api.hubapi.com/crm/v3/lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filterBranch": {
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": true
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": [
"test",
"name"
]
},
"property": "firstname"
}
]
}
]
},
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingType": "DYNAMIC"
}
'import requests
url = "https://api.hubapi.com/crm/v3/lists"
payload = {
"filterBranch": {
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": True
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": ["test", "name"]
},
"property": "firstname"
}
]
}
]
},
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingType": "DYNAMIC"
}
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({
filterBranch: {
filterBranchType: 'OR',
filterBranches: [
{
filterBranchType: 'AND',
filterBranches: [
{
associationCategory: 'HUBSPOT_DEFINED',
associationTypeId: 4,
filterBranchType: 'ASSOCIATION',
filters: [
{
filterType: 'PROPERTY',
operation: {operationType: 'BOOL', operator: 'IS_EQUAL_TO', value: true},
property: 'hs_is_closed_won'
}
],
objectTypeId: '0-3',
operator: 'IN_LIST'
}
],
filters: [
{
filterType: 'PROPERTY',
operation: {
operationType: 'MULTISTRING',
operator: 'IS_EQUAL_TO',
values: ['test', 'name']
},
property: 'firstname'
}
]
}
]
},
name: 'Dynamic Association List Example',
objectTypeId: '0-1',
processingType: 'DYNAMIC'
})
};
fetch('https://api.hubapi.com/crm/v3/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.hubapi.com/crm/v3/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([
'filterBranch' => [
'filterBranchType' => 'OR',
'filterBranches' => [
[
'filterBranchType' => 'AND',
'filterBranches' => [
[
'associationCategory' => 'HUBSPOT_DEFINED',
'associationTypeId' => 4,
'filterBranchType' => 'ASSOCIATION',
'filters' => [
[
'filterType' => 'PROPERTY',
'operation' => [
'operationType' => 'BOOL',
'operator' => 'IS_EQUAL_TO',
'value' => true
],
'property' => 'hs_is_closed_won'
]
],
'objectTypeId' => '0-3',
'operator' => 'IN_LIST'
]
],
'filters' => [
[
'filterType' => 'PROPERTY',
'operation' => [
'operationType' => 'MULTISTRING',
'operator' => 'IS_EQUAL_TO',
'values' => [
'test',
'name'
]
],
'property' => 'firstname'
]
]
]
]
],
'name' => 'Dynamic Association List Example',
'objectTypeId' => '0-1',
'processingType' => 'DYNAMIC'
]),
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.hubapi.com/crm/v3/lists"
payload := strings.NewReader("{\n \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\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.hubapi.com/crm/v3/lists")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/crm/v3/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 \"filterBranch\": {\n \"filterBranchType\": \"OR\",\n \"filterBranches\": [\n {\n \"filterBranchType\": \"AND\",\n \"filterBranches\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 4,\n \"filterBranchType\": \"ASSOCIATION\",\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"BOOL\",\n \"operator\": \"IS_EQUAL_TO\",\n \"value\": true\n },\n \"property\": \"hs_is_closed_won\"\n }\n ],\n \"objectTypeId\": \"0-3\",\n \"operator\": \"IN_LIST\"\n }\n ],\n \"filters\": [\n {\n \"filterType\": \"PROPERTY\",\n \"operation\": {\n \"operationType\": \"MULTISTRING\",\n \"operator\": \"IS_EQUAL_TO\",\n \"values\": [\n \"test\",\n \"name\"\n ]\n },\n \"property\": \"firstname\"\n }\n ]\n }\n ]\n },\n \"name\": \"Dynamic Association List Example\",\n \"objectTypeId\": \"0-1\",\n \"processingType\": \"DYNAMIC\"\n}"
response = http.request(request)
puts response.read_body{
"list": {
"createdAt": "2023-11-15T18:16:52.165Z",
"createdById": "123",
"filterBranch": {
"filterBranchOperator": "OR",
"filterBranchType": "OR",
"filterBranches": [
{
"filterBranchOperator": "AND",
"filterBranchType": "AND",
"filterBranches": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 4,
"filterBranchOperator": "AND",
"filterBranchType": "ASSOCIATION",
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"includeObjectsWithNoValueSet": false,
"operationType": "BOOL",
"operator": "IS_EQUAL_TO",
"value": true
},
"property": "hs_is_closed_won"
}
],
"objectTypeId": "0-3",
"operator": "IN_LIST"
}
],
"filters": [
{
"filterType": "PROPERTY",
"operation": {
"includeObjectsWithNoValueSet": false,
"operationType": "MULTISTRING",
"operator": "IS_EQUAL_TO",
"values": [
"test",
"name"
]
},
"property": "firstname"
}
]
}
]
},
"filtersUpdatedAt": "2023-11-15T18:16:52.165Z",
"listId": "1",
"listVersion": 1,
"name": "Dynamic Association List Example",
"objectTypeId": "0-1",
"processingStatus": "PROCESSING",
"processingType": "DYNAMIC",
"updatedAt": "2023-11-15T18:16:52.395Z",
"updatedById": "123"
}
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Required Scopes
Required Scopes
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
The request object used when creating a new object list.
The name of the list, which must be globally unique across all public lists in the portal.
The object type ID of the type of objects that the list will store.
The processing type of the list. One of: SNAPSHOT, MANUAL, or DYNAMIC.
The list of custom properties to tie to the list. Custom property name is the key, the value is the value.
Show child attributes
Show child attributes
Filter branch object containing filtering criteria for the list
- OR
- AND
- NOT_ALL
- NOT_ANY
- RESTRICTED
- UNIFIED_EVENTS
- ASSOCIATION
Show child attributes
Show child attributes
The ID of the folder that the list should be created in. If left blank, then the list will be created in the root of the list folder structure.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
successful operation
The response for a list create request.
An object list definition.
Show child attributes
Show child attributes
Was this page helpful?