List End Customers
This endpoint returns a page of end customers for the authenticated account.
Endpoint
Section titled “Endpoint”GET /v1/end-customers/end-customersAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”end-customers:readQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
clientId | string | No | Returns only end customers linked to this client. |
archived | string | No | "true" returns only archived end customers. Any other value, or no value, returns only end customers that are not archived. |
all | string | No | "true" returns archived and non-archived end customers. When set, archived is ignored. |
page | string | No | 0-based page index. Defaults to 0. A non-numeric value is treated as 0. |
pageSize | string | No | Number of end customers per page. Defaults to 25. There is no maximum. |
sortCol | string | No | One of name, description, email, phoneNumber, createdAt, updatedAt, Client.client_name. Requires sortDir. Invalid values are ignored. |
sortDir | string | No | asc or desc (not case-sensitive). Requires sortCol. Invalid values are ignored. |
See Pagination for paging and sorting rules.
Request Body
Section titled “Request Body”This endpoint does not accept a request body.
Example Request
Section titled “Example Request”curl "https://api.crewsum.com/v1/end-customers/end-customers?clientId=client-ghi123jkl4567890&page=0&pageSize=25" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/end-customers/end-customers?clientId=client-ghi123jkl4567890&page=0&pageSize=25", { headers: { "x-api-key": process.env.CREWSUM_API_KEY } },);const result = await response.json();GET /v1/end-customers/end-customers?clientId=client-ghi123jkl4567890&page=0&pageSize=25 HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Response
Section titled “Response”On success, the API returns HTTP 200 OK.
Example Response
Section titled “Example Response”{ "message": "Successfully fetched end customers", "data": { "endCustomers": [ { "id": "endcustomer-abc123def4567890", "name": "End Customer Name", "description": "A brief description", "clientId": "client-ghi123jkl4567890", "clientName": "Client Name", "clientArchived": false, "clientDeleted": false, "email": "buyer@example.com", "phoneNumber": "555-0100", "address": "123 Main St", "notes": "Important delivery requirements", "isArchived": false, "createdAt": "2026-01-05T15:30:00.000Z", "updatedAt": "2026-02-10T09:12:00.000Z", "isDeleted": false } ], "count": 1 }}Behavior
Section titled “Behavior”data.endCustomersholds the current page.data.countis the total number of end customers that match the filters, across all pages.- Deleted end customers are never returned.
- Without a valid
sortColandsortDirpair, end customers are sorted byupdatedAtdescending, thencreatedAtdescending. End customers that were never updated (updatedAt: null) sort last. - End customers without a client return
nullforclientId,clientName,clientArchived, andclientDeleted. updatedAtisnullfor end customers that were never updated.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
500 | {"message": "Error fetching end customers"}. Crewsum could not fetch end customers. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks”This endpoint does not trigger a webhook.