Skip to content

Retrieve a list

client.list.retrieve(stringid, RequestOptionsoptions?): ListRetrieveResponse { id, createdAt, fields, httpLink }
GET/v1/lists/{id}

Retrieves a single list by its ID.

Required scope: lists:read

Rate limit category: Read

ParametersExpand Collapse
id: string

Unique identifier of the list to retrieve.

ReturnsExpand Collapse
ListRetrieveResponse { 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"

Retrieve a list

import Lightfield from 'lightfield';

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

const listRetrieveResponse = await client.list.retrieve('id');

console.log(listRetrieveResponse.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"
}