List Supplier Contacts
This endpoint returns a page of supplier contacts for the authenticated account.
Endpoint
Section titled “Endpoint”GET /v1/supplier-contacts/supplier-contactsAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”supplier-contacts:readQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
supplierId | string | No | Return only contacts of this supplier. |
archived | "true" | "false" | No | When "true", return only archived contacts. Any other value returns only active contacts. Defaults to active contacts. |
all | "true" | "false" | No | When "true", return archived and active contacts together. archived is then ignored. |
page | number | No | Zero-based page index. Defaults to 0. |
pageSize | number | No | Number of contacts per page. Defaults to 25. |
sortCol | "contactName" | "contactDescription" | "contactEmail" | "createdAt" | "updatedAt" | "Suppliers.supplier_name" | No | Sort column. Suppliers.supplier_name sorts by the supplier’s name. Must be sent with a valid sortDir. |
sortDir | "asc" | "desc" | No | Sort direction. Must be sent with a valid sortCol. |
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/supplier-contacts/supplier-contacts?supplierId=supplier-stu123vwx4567890&page=0&pageSize=25" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/supplier-contacts/supplier-contacts?supplierId=supplier-stu123vwx4567890&page=0&pageSize=25", { headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();GET /v1/supplier-contacts/supplier-contacts?supplierId=supplier-stu123vwx4567890&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 supplier contacts", "data": { "contacts": [ { "id": "suppliercontact-vwx123yza4567890", "supplierId": "supplier-stu123vwx4567890", "supplierName": "Supplier Name", "name": "Supplier Contact Name", "description": "A brief description of the supplier contact", "email": "placeholder@example.com", "isArchived": false, "createdAt": "2023-01-01T00:00:00.000Z", "updatedAt": null, "isDeleted": false } ], "count": 1 }}Behavior
Section titled “Behavior”countis the total number of matching contacts, not the number on this page.- Deleted contacts are never returned, even with
all=true. - If
sortColorsortDiris missing or invalid, the API ignores both and sorts byupdatedAtdescending, thencreatedAtdescending. updatedAtisnulluntil the contact is updated for the first time.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
500 | Crewsum could not fetch supplier contacts. Message: Error fetching supplier contacts. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks”This endpoint does not trigger a webhook.