List accounts
Returns a paginated list of accounts. Results are sorted by when the record was created in Lightfield (createdAt), newest first. Each page holds only the records you can currently read, so a page can contain fewer records than limit, or none, while more remain, and totalCount can include records you can no longer read. To read every record, keep advancing offset by limit until it reaches totalCount; do not stop at a short or empty page. Use offset and limit to paginate through results, and $field query parameters to filter. Pass status=trashed to list accounts currently in the trash instead of live records. Listing trashed records additionally requires the accounts:restore scope. See List endpoints for more information about pagination and filtering.
Required scope: accounts:read
Rate limit category: Search
List accounts
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const accountListResponse = await client.account.list();
console.log(accountListResponse.data);{
"data": [
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}
],
"object": "object",
"totalCount": 0
}Returns Examples
{
"data": [
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}
],
"object": "object",
"totalCount": 0
}