curl --request POST \
--url https://api.affinity.co/v2/lists/{listId}/list-entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": {
"id": 12345
}
}
'import requests
url = "https://api.affinity.co/v2/lists/{listId}/list-entries"
payload = { "entity": { "id": 12345 } }
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({entity: {id: 12345}})
};
fetch('https://api.affinity.co/v2/lists/{listId}/list-entries', 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.affinity.co/v2/lists/{listId}/list-entries",
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([
'entity' => [
'id' => 12345
]
]),
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.affinity.co/v2/lists/{listId}/list-entries"
payload := strings.NewReader("{\n \"entity\": {\n \"id\": 12345\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.affinity.co/v2/lists/{listId}/list-entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": {\n \"id\": 12345\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/lists/{listId}/list-entries")
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 \"entity\": {\n \"id\": 12345\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"type": "company",
"listId": 1,
"createdAt": "2026-01-01T00:00:00Z",
"creatorId": 1,
"entity": {
"id": 12345,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"fields": []
}
}Add a List Entry to a List
| ⚠️ This endpoint is currently in BETA |
|---|
Adds a Company or Person to a List as a new List Entry. Opportunities cannot be added with this endpoint.
The type of the entity referenced by entity.id is determined by the List’s type: a Company ID for a company List, a Person ID for a person List. If no entity of the List’s type exists with the given ID, the request is rejected with 400 Bad Request.
Only the List’s own required fields are checked. Required fields on the entity itself were already enforced when the entity was created, so they are not re-checked here.
If the List has a required field, the request is rejected with 400 Bad Request and the missing field IDs are returned in the response body. This endpoint does not accept field values, so there is no API-level remediation: populate such a List through a UI flow that provides values at add time, or remove the required flag from the List’s field configuration.
The new List Entry gets the same initial field values an add in the app gets: the Status field is set to the List’s first open Status, and the Owners field is set to the List Entry’s creator. The creator defaults to the authenticated user; it can be overridden by providing creatorId.
curl --request POST \
--url https://api.affinity.co/v2/lists/{listId}/list-entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": {
"id": 12345
}
}
'import requests
url = "https://api.affinity.co/v2/lists/{listId}/list-entries"
payload = { "entity": { "id": 12345 } }
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({entity: {id: 12345}})
};
fetch('https://api.affinity.co/v2/lists/{listId}/list-entries', 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.affinity.co/v2/lists/{listId}/list-entries",
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([
'entity' => [
'id' => 12345
]
]),
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.affinity.co/v2/lists/{listId}/list-entries"
payload := strings.NewReader("{\n \"entity\": {\n \"id\": 12345\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.affinity.co/v2/lists/{listId}/list-entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": {\n \"id\": 12345\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/lists/{listId}/list-entries")
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 \"entity\": {\n \"id\": 12345\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"type": "company",
"listId": 1,
"createdAt": "2026-01-01T00:00:00Z",
"creatorId": 1,
"entity": {
"id": 12345,
"name": "Horizon Technologies",
"domain": "horizontech.com",
"domains": [
"horizontech.com"
],
"isGlobal": true,
"fields": []
}
}Authorizations
Body
Request body for creating a List Entry on a List. The entity referenced by entity.id must
match the List's type: a Company ID for a company List, a Person ID for a person List.
Opportunities cannot be added with this endpoint. An opportunity List's entries are the
opportunities themselves, and each opportunity belongs to exactly one List, so an existing
entity cannot be added to one.
Response
Created
- CompanyListEntry
- OpportunityListEntry
- PersonListEntry
Was this page helpful?