Get User Assignments
This endpoint returns the project and task assignments for one user, including assignments from user groups.
Endpoint
Section titled “Endpoint”GET /v1/user-assignments/user-assignments/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”user-assignments:readPath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | User ID. |
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/user-assignments/user-assignments/user-a" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/user-assignments/user-assignments/user-a", { headers: { "x-api-key": process.env.CREWSUM_API_KEY, }, },);const result = await response.json();GET /v1/user-assignments/user-assignments/user-a 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 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": [] } ] }}Behavior
Section titled “Behavior”assignmentsincludes 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
200with"assignments": []. It is not an error. - The response echoes
userIdexactly as you sent it.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
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.
Related Webhooks
Section titled “Related Webhooks”This endpoint does not trigger a webhook.