curl --request PATCH \
--url https://api.affinity.co/v2/lists/{listId}/list-entries/{listEntryId}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "update-fields",
"updates": [
{
"id": "field-1",
"value": {
"type": "company",
"data": {
"id": 1
}
}
},
{
"id": "field-2",
"value": {
"type": "company-multi",
"data": [
{
"id": 1
},
{
"id": 2
}
]
}
},
{
"id": "field-3",
"value": {
"type": "datetime",
"data": "2023-01-01T00:00:00Z"
}
},
{
"id": "field-4",
"value": {
"type": "dropdown",
"data": {
"dropdownOptionId": 1
}
}
},
{
"id": "field-5",
"value": {
"type": "dropdown-multi",
"data": [
{
"dropdownOptionId": 1
},
{
"dropdownOptionId": 2
}
]
}
},
{
"id": "field-6",
"value": {
"type": "location",
"data": {
"streetAddress": "1 Main Street",
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
}
}
},
{
"id": "field-7",
"value": {
"type": "location-multi",
"data": [
{
"streetAddress": "1 Main Street",
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
},
{
"streetAddress": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"state": "DC",
"country": "United States",
"continent": "North America"
}
]
}
},
{
"id": "field-8",
"value": {
"type": "number",
"data": 100
}
},
{
"id": "field-9",
"value": {
"type": "number-multi",
"data": [
100,
200,
300
]
}
},
{
"id": "field-10",
"value": {
"type": "person",
"data": {
"id": 1
}
}
},
{
"id": "field-11",
"value": {
"type": "person-multi",
"data": [
{
"id": 1
},
{
"id": 2
}
]
}
},
{
"id": "field-12",
"value": {
"type": "ranked-dropdown",
"data": {
"dropdownOptionId": 1
}
}
},
{
"id": "field-13",
"value": {
"type": "text",
"data": "Some new text"
}
}
]
}
'{
"operation": "update-fields"
}Perform batch operations on a list entry’s fields.
Currently the only operation at the endpoint is update-fields, which allows you to update multiple field values with a single request. This is equivalent to calling the single field update endpoint multiple times. You can update up to 100 fields per request.
Requires the “Export data from Lists” permission.
curl --request PATCH \
--url https://api.affinity.co/v2/lists/{listId}/list-entries/{listEntryId}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "update-fields",
"updates": [
{
"id": "field-1",
"value": {
"type": "company",
"data": {
"id": 1
}
}
},
{
"id": "field-2",
"value": {
"type": "company-multi",
"data": [
{
"id": 1
},
{
"id": 2
}
]
}
},
{
"id": "field-3",
"value": {
"type": "datetime",
"data": "2023-01-01T00:00:00Z"
}
},
{
"id": "field-4",
"value": {
"type": "dropdown",
"data": {
"dropdownOptionId": 1
}
}
},
{
"id": "field-5",
"value": {
"type": "dropdown-multi",
"data": [
{
"dropdownOptionId": 1
},
{
"dropdownOptionId": 2
}
]
}
},
{
"id": "field-6",
"value": {
"type": "location",
"data": {
"streetAddress": "1 Main Street",
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
}
}
},
{
"id": "field-7",
"value": {
"type": "location-multi",
"data": [
{
"streetAddress": "1 Main Street",
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
},
{
"streetAddress": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"state": "DC",
"country": "United States",
"continent": "North America"
}
]
}
},
{
"id": "field-8",
"value": {
"type": "number",
"data": 100
}
},
{
"id": "field-9",
"value": {
"type": "number-multi",
"data": [
100,
200,
300
]
}
},
{
"id": "field-10",
"value": {
"type": "person",
"data": {
"id": 1
}
}
},
{
"id": "field-11",
"value": {
"type": "person-multi",
"data": [
{
"id": 1
},
{
"id": 2
}
]
}
},
{
"id": "field-12",
"value": {
"type": "ranked-dropdown",
"data": {
"dropdownOptionId": 1
}
}
},
{
"id": "field-13",
"value": {
"type": "text",
"data": "Some new text"
}
}
]
}
'{
"operation": "update-fields"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
List ID
1 <= x <= 9007199254740991List Entry ID
1 <= x <= 9007199254740991OK
update-fields Was this page helpful?