Saltar al contenido
Docs
Español
Esc
↑↓navegar↵abrir⌘Jvista previa

Assign a role to a user

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

POST/users/{id}/roles
Authorization
AuthorizationBasic auth · headerrequired

Basic Auth with clientId as username and clientSecret as password

Path parameters
idstringrequired
Request body
requiredapplication/json
roleIdstringrequired
courseCodesstring[]

Scope assignment to specific courses

Responses
200

Role 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
400

Bad 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
401

Unauthorized

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
404

Not 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
409

Conflict

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
429

Too 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
500

Internal 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
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://fuxam.app/api/v4/users/string/roles' \
  -H 'Authorization: Basic YOUR_CREDENTIALS' \
  -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": "2019-08-24T14:15:22Z"
      }
    ]
  },
  "meta": {
    "requestId": "req_1234567890_abc",
    "timestamp": "2026-06-02T07:00:00.000Z",
    "version": "v4"
  }
}