Skip to content

List members

client.member.list(MemberListParams { limit, offset } query?, RequestOptionsoptions?): MemberListResponse { data, object, totalCount }
GET/v1/members

Returns a paginated list of members in your workspace. Results are sorted by when the record was created in Lightfield (createdAt), newest first. Use offset and limit to paginate through results. See List endpoints for more information about pagination.

Required scope: members:read

Rate limit category: Search

ParametersExpand Collapse
query: MemberListParams { limit, offset }
limit?: number

Maximum number of records to return. Defaults to 25, maximum 25.

minimum1
maximum9007199254740991
offset?: number

Number of records to skip for pagination. Defaults to 0.

minimum0
maximum9007199254740991
ReturnsExpand Collapse
MemberListResponse { data, object, totalCount }
data: Array<Data>

Array of member objects for the current page.

id: string

Unique identifier for the member.

createdAt: string

ISO 8601 timestamp of when the member was created.

fields: Fields { $email, $name, $profileImage, $role }

Map of field names to their typed values.

"$email": Email { value, valueType }

The member’s email address.

value: string

The field value.

valueType: "EMAIL"

The data type of the field value.

"$name": Name { value, valueType }

The member’s full name.

value: Value { firstName, lastName }
firstName?: string | null

The contact’s first name.

lastName?: string | null

The contact’s last name.

valueType: "FULL_NAME"

The data type of the field value.

"$profileImage": ProfileImage { value, valueType }

URL of the member’s profile image, or null if unset.

value: string | null

The field value, or null if unset.

valueType: "URL"

The data type of the field value.

"$role": Role { value, valueType }

The member’s workspace role.

value: string

The field value.

valueType: "TEXT"

The data type of the field value.

relationships: Relationships { $user }

Map of relationship names to their associated entities.

"$user": User { cardinality, objectType, values }

The underlying user record for this workspace member.

cardinality: "HAS_ONE"

Whether the relationship is has_one or has_many.

objectType: "user"

The type of the related object.

values: Array<string>

IDs of the related users.

updatedAt: string | null

ISO 8601 timestamp of when the member was last updated, or null.

object: string

The object type, always "list".

totalCount: number

Total number of members in the workspace.

minimum0
maximum9007199254740991

List members

import Lightfield from 'lightfield';

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

const memberListResponse = await client.member.list();

console.log(memberListResponse.data);
{
  "data": [
    {
      "id": "id",
      "createdAt": "createdAt",
      "fields": {
        "$email": {
          "value": "value",
          "valueType": "EMAIL"
        },
        "$name": {
          "value": {
            "firstName": "firstName",
            "lastName": "lastName"
          },
          "valueType": "FULL_NAME"
        },
        "$profileImage": {
          "value": "value",
          "valueType": "URL"
        },
        "$role": {
          "value": "value",
          "valueType": "TEXT"
        }
      },
      "httpLink": "httpLink",
      "relationships": {
        "$user": {
          "cardinality": "HAS_ONE",
          "objectType": "user",
          "values": [
            "string"
          ]
        }
      },
      "updatedAt": "updatedAt"
    }
  ],
  "object": "object",
  "totalCount": 0
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "createdAt": "createdAt",
      "fields": {
        "$email": {
          "value": "value",
          "valueType": "EMAIL"
        },
        "$name": {
          "value": {
            "firstName": "firstName",
            "lastName": "lastName"
          },
          "valueType": "FULL_NAME"
        },
        "$profileImage": {
          "value": "value",
          "valueType": "URL"
        },
        "$role": {
          "value": "value",
          "valueType": "TEXT"
        }
      },
      "httpLink": "httpLink",
      "relationships": {
        "$user": {
          "cardinality": "HAS_ONE",
          "objectType": "user",
          "values": [
            "string"
          ]
        }
      },
      "updatedAt": "updatedAt"
    }
  ],
  "object": "object",
  "totalCount": 0
}