Skip to content

Delete Association

This endpoint permanently deletes a project-to-contact association. You identify the association by the project ID in the path and the contact ID in the body or query string.

DELETE /v1/associations/associations/:id

Include your API key in the x-api-key header. See Authentication.

associations:write
ParameterTypeRequiredDescription
idstringYesProject ID.
ParameterTypeRequiredDescription
contactIdstringNoContact ID. Use this or contactId in the body.

You must send a JSON body with Content-Type: application/json, even when you pass contactId in the query string. Send at least {}. A request with no body returns 500.

FieldTypeRequiredDescription
contactIdstringNoContact ID. Required here if it is not in the query string. If it is in both places, the values must match.
projectIdstringNoIf provided, it must match the route id.
{
"contactId": "contact-jkl123mno4567890"
}
Terminal window
curl -X DELETE "https://api.crewsum.com/v1/associations/associations/project-mno123pqr4567890" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contactId": "contact-jkl123mno4567890"
}'

On success, the API returns HTTP 200 OK.

{
"message": "Successfully deleted association between project-mno123pqr4567890 and contact-jkl123mno4567890"
}
  • This is a permanent delete. The association is removed and cannot be read again with Get Association.
  • If your account has no association for the project and contact, the API returns 404.
  • After the association is deleted, Crewsum emits the associations.removed webhook event. The event’s associations array is currently always empty, because the event data is read after the association is removed. Record the project and contact IDs from your own request if you need them. A webhook delivery failure does not change the API response.
StatusMeaning
400contactId must be supplied: contactId was not in the body or the query string.
400projectId in request body must match the route id.
400contactId in request body must match the query string.
400The request had Content-Type: application/json and an empty body. Send at least {}.
404Your account has no association for the project and contact. The message is Association between <projectId> and <contactId> not found.
500The request had no JSON body.
500Crewsum could not delete the association. The message is Error deleting association between <projectId> and <contactId>.

Authentication and scope failures are described in Errors.