Skip to content

Get User Assignments

This endpoint returns the project and task assignments for one user, including assignments from user groups.

GET /v1/user-assignments/user-assignments/:id

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

user-assignments:read
ParameterTypeRequiredDescription
idstringYesUser ID.

This endpoint does not accept a request body.

Terminal window
curl "https://api.crewsum.com/v1/user-assignments/user-assignments/user-a" \
-H "x-api-key: $CREWSUM_API_KEY"

On success, the API returns HTTP 200 OK.

{
"message": "Successfully fetched user assignments for user-a",
"data": {
"userId": "user-a",
"assignments": [
{
"id": "project-mno123pqr4567890",
"name": "Project Name",
"source": { "type": "direct" },
"groupSources": [],
"tasks": [
{
"id": "task-pqr123stu4567890",
"name": "Task Name",
"source": { "type": "direct" },
"groupSources": []
}
]
},
{
"id": "project-abc123def4567890",
"name": "Group Project",
"source": {
"type": "group",
"groupId": "36b735f8-4dd7-4c3c-836f-35d2fe84e872",
"groupName": "Operations"
},
"groupSources": [
{
"type": "group",
"groupId": "36b735f8-4dd7-4c3c-836f-35d2fe84e872",
"groupName": "Operations"
}
],
"tasks": []
}
]
}
}
  • assignments includes direct assignments and assignments the user receives through user groups.
  • Each project and task has:
    • source: { "type": "direct" } when the user has a direct assignment, otherwise the first group that gives the assignment ({ "type": "group", "groupId", "groupName" }).
    • groupSources: every group that gives the assignment. It is [] when no group gives it.
  • An unknown user ID returns 200 with "assignments": []. It is not an error.
  • The response echoes userId exactly as you sent it.
StatusMeaning
400"UserID missing": the ID path segment was empty.
500"Error fetching user assignments for <userId>": the request failed.

Authentication and scope failures are described in Errors.

This endpoint does not trigger a webhook.