List Associations
This endpoint returns the project-to-contact associations for one project or one contact.
Endpoint
Section titled “Endpoint”GET /v1/associations/associationsAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”associations:readQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | No | Return the associations for this project. |
contactId | string | No | Return the associations for this contact. Ignored when projectId is also sent. |
Send projectId or contactId. If you send both, the API uses projectId and ignores contactId. If you send neither, the API returns 400.
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/associations/associations?projectId=project-mno123pqr4567890" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/associations/associations?projectId=project-mno123pqr4567890", { headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();GET /v1/associations/associations?projectId=project-mno123pqr4567890 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 associations", "data": { "associations": [ { "projectId": "project-mno123pqr4567890", "projectName": "Project Name", "contactId": "contact-jkl123mno4567890", "contactName": "Contact Name", "contactType": "MANAGER", "notificationLevel": "COPY_ONLY", "projectEndCustomer": "End Customer Name" } ] }}Behavior
Section titled “Behavior”- The response is not paginated and has no
count. It contains every matching association. - Associations removed by a project or contact delete are not returned.
- If nothing matches,
associationsis an empty array. projectEndCustomeris the name of the project’s end customer, ornull.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | Neither projectId nor contactId was supplied. The message is Either a projectId or contactId must be supplied. |
500 | Crewsum could not fetch associations. The message is Error fetching associations. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks”This endpoint does not trigger a webhook.