Skip to content

Update a list

client.list.update(stringid, ListUpdateParams { fields, relationships } body, RequestOptionsoptions?): ListUpdateResponse { id, createdAt, fields, httpLink }
POST/v1/lists/{id}

Updates an existing list by ID. Only included fields are modified.

Supports idempotency via the Idempotency-Key header.

Required scope: lists:update

Rate limit category: Write

ParametersExpand Collapse
id: string

Unique identifier of the list to update.

body: ListUpdateParams { fields, relationships }
fields?: Fields

Field values to update — only provided fields are modified; omitted fields are left unchanged.

"$name"?: string

Display name of the list.

relationships?: Accounts { $accounts } | Contacts { $contacts } | Opportunities { $opportunities }

Relationship operations. Use the key matching the list's $objectType (e.g. $accounts for an account list).

Accepts one of the following:
Accounts { $accounts }
"$accounts": Accounts { add, remove }

Add/remove accounts. List $objectType must be account.

add?: string | Array<string>

Entity ID(s) to add to the list.

Accepts one of the following:
string
Array<string>
remove?: string | Array<string>

Entity ID(s) to remove from the list.

Accepts one of the following:
string
Array<string>
Contacts { $contacts }
"$contacts": Contacts { add, remove }

Add/remove contacts. List $objectType must be contact.

add?: string | Array<string>

Entity ID(s) to add to the list.

Accepts one of the following:
string
Array<string>
remove?: string | Array<string>

Entity ID(s) to remove from the list.

Accepts one of the following:
string
Array<string>
Opportunities { $opportunities }
"$opportunities": Opportunities { add, remove }

Add/remove opportunities. List $objectType must be opportunity.

add?: string | Array<string>

Entity ID(s) to add to the list.

Accepts one of the following:
string
Array<string>
remove?: string | Array<string>

Entity ID(s) to remove from the list.

Accepts one of the following:
string
Array<string>
ReturnsExpand Collapse
ListUpdateResponse { id, createdAt, fields, httpLink }
id: string

Unique identifier for the list.

createdAt: string

ISO 8601 timestamp of when the list was created.

fields: Record<string, Fields>

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $objectType).

value: string | number | boolean | 3 more | null

The field value, or null if unset.

Accepts one of the following:
string
number
boolean
Array<string>
Address { city, country, latitude, 5 more }
city?: string | null

City name.

country?: string | null

2-letter ISO 3166-1 alpha-2 country code.

latitude?: number | null

Latitude coordinate.

longitude?: number | null

Longitude coordinate.

postalCode?: string | null

Postal or ZIP code.

state?: string | null

State or province.

street?: string | null

Street address line 1.

street2?: string | null

Street address line 2.

FullName { firstName, lastName }
firstName?: string | null

The contact's first name.

lastName?: string | null

The contact's last name.

valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 11 more

The data type of the field.

Accepts one of the following:
"ADDRESS"
"CHECKBOX"
"CURRENCY"
"DATETIME"
"EMAIL"
"FULL_NAME"
"MARKDOWN"
"MULTI_SELECT"
"NUMBER"
"SINGLE_SELECT"
"SOCIAL_HANDLE"
"TELEPHONE"
"TEXT"
"URL"

Update a list

import Lightfield from 'lightfield';

const client = new Lightfield({
  apiKey: 'My API Key',
});

const listUpdateResponse = await client.list.update('id');

console.log(listUpdateResponse.id);
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink"
}
Returns Examples
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink"
}