Zum Inhalt springen
Docs
Deutsch
Esc
navigateopen⌘Jpreview

Assign a role to a user

Assigns an institution-wide or course-specific role. Pass courseCodes to scope the assignment.

POST/users/{id}/roles
Path parameters
idstringrequired
Request body
requiredapplication/json
roleIdstringrequired
courseCodesstring[]
Scope assignment to specific courses
Responses
200Role assigned
dataobjectrequired
Show properties
successboolean
assignmentsRoleAssignment[]
Show properties
Array of RoleAssignment
idstringrequired
roleIdstring | null
roleobject | null
Show properties
idstring
namestring
colorstring
layerIdstring | null
courseCodestring | null
cohortIdstring | null
studyProgramIdstring | null
createdAtstring<date-time>required
metaResponseMetarequired
Show properties
requestIdstringrequired
timestampstring<date-time>required
versionstringrequired
Allowed:v4
400Bad Request
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
401Unauthorized
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
404Not Found
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
409Conflict
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
429Too Many Requests
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
500Internal Server Error
typestringrequired
Allowed:error
codestringrequired
Allowed:bad_requestunauthorizedforbiddenresource_not_foundconflictvalidation_failedidempotency_key_reusedrate_limit_exceededinternal_error
titlestringrequired
statusintegerrequired
detailstringrequired
instancestring
errorsobject[]
Show properties
Array of object
fieldstring
messagestring
Request
curl -X POST "https://fuxam.app/api/v4/users/string/roles" \
  -H "Content-Type: application/json" \
  -d '{
  "roleId": "string",
  "courseCodes": [
    "string"
  ]
}'
Response
{
  "data": {
    "success": true,
    "assignments": [
      {
        "id": "clxassign1234",
        "roleId": "clxrole1234",
        "role": {
          "id": "string",
          "name": "string",
          "color": "string"
        },
        "layerId": "string",
        "courseCode": "string",
        "cohortId": "string",
        "studyProgramId": "string",
        "createdAt": "2024-01-01T00:00:00Z"
      }
    ]
  },
  "meta": {
    "requestId": "req_1234567890_abc",
    "timestamp": "2026-06-02T07:00:00.000Z",
    "version": "v4"
  }
}