Skip to content

Delete User Assignments

This endpoint removes all of a user’s direct project and task assignments.

DELETE /v1/user-assignments/user-assignments/:id

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

user-assignments:write
ParameterTypeRequiredDescription
idstringYesUser whose direct assignments are removed.
FieldTypeRequiredDescription
userIdstringNoIf you send it, it must match the route id.
{
"userId": "user-a"
}
Terminal window
curl -X DELETE "https://api.crewsum.com/v1/user-assignments/user-assignments/user-a" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "user-a"
}'

On success, the API returns HTTP 200 OK.

{
"message": "Successfully deleted user assignments for user-a",
"data": {
"userId": "user-a"
}
}
  • Crewsum removes every direct project and task assignment for the user.
  • Assignments the user receives through user groups are not removed. To remove those, remove the user from the group with Set User Group Users or Update User.
  • An unknown user ID returns 200. Nothing is removed.
StatusMeaning
400"UserID missing": the ID path segment was empty.
400"userId in request body must match the route id": userId in the body is different from the route id.
500"Error deleting user assignments for <userId>": the request failed.
500A request with no body returns Fastify’s default error body, for example { "statusCode": 500, "error": "Internal Server Error", "message": "Cannot read properties of undefined (reading 'userId')" }.

Authentication and scope failures are described in Errors.

This endpoint does not trigger a webhook.