> For the complete documentation index, see [llms.txt](https://docs.mymedtrics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mymedtrics.com/api-reference/medtrics-classic-sis-bridge/user-roles.md).

# User Roles

## POST /api/users/user\_role/

> Legacy /api/users/user\_role/ bridge resource (ORC-209 Phase E).\
> \
> Classic \`\`UserRoleViewSet\`\` (users\_userrole) is a program-LESS role-designation model\
> (user\_profile + role + start/end dates + active flag). Oracle has no standalone user-role\
> table — a user's role lives on their program\_membership (Connect enrollment). So a UserRole\
> write is mapped to a role change on the learner's PRIMARY program membership (decided with\
> Chris, ORC-209 Phase E):\
> \
> &#x20;   POST/PUT/PATCH /api/users/user\_role/  ->  resolve user\_profile -> learner (DDB-3) + role,\
> &#x20;       find the learner's primary enrollment, then:\
> &#x20;         active == false  ->  POST /enrollments/{id}/deactivate\
> &#x20;         otherwise        ->  PATCH /enrollments/{id} {role\_id\[, start\_date]}\
> \
> This converges with PATCH /api-banner/users/ (which also changes the primary membership's\
> role), so both classic role-change paths land the same Oracle effect.\
> \
> Scope / caveats (recorded for the #424 register):\
> &#x20; \- Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\
> &#x20;   multi-program learner this targets the PRIMARY membership only.\
> &#x20; \- DELETE (role removal) is NOT supported here — a bare DELETE carries no user\_profile to\
> &#x20;   resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:"Inactive"} with\
> &#x20;   the program to deactivate a specific membership.\
> &#x20; \- Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\
> &#x20;   use GET /api/programs/affiliations/?user= to see a learner's memberships.

```json
{"openapi":"3.1.0","info":{"title":"Medtrics Legacy SIS Bridge (Compatibility API)","version":"draft-2026-10-29"},"servers":[{"url":"https://{client}.mymedtrics.com","description":"Tenant host; Caddy routes /api-banner/* and /api/* to the bridge (internal only)","variables":{"client":{"default":"<client-name>","description":"Tenant subdomain"}}},{"url":"http://localhost:8090","description":"local dev (see docker/caddy/Caddyfile for deployed hosts)"}],"security":[{"LegacyToken":[]},{"LegacyBasic":[]}],"components":{"securitySchemes":{"LegacyToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization: Token <hex>"},"LegacyBasic":{"type":"http","scheme":"basic"}},"schemas":{"UserRoles":{"type":"object","description":"Legacy-shaped user_role record as served by the bridge; translated from Connect /enrollments","properties":{"id":{"type":"integer","description":"legacy numeric id"}}}}},"paths":{"/api/users/user_role/":{"post":{"operationId":"userRoles_create","tags":["UserRoles"],"description":"Legacy /api/users/user_role/ bridge resource (ORC-209 Phase E).\n\nClassic ``UserRoleViewSet`` (users_userrole) is a program-LESS role-designation model\n(user_profile + role + start/end dates + active flag). Oracle has no standalone user-role\ntable — a user's role lives on their program_membership (Connect enrollment). So a UserRole\nwrite is mapped to a role change on the learner's PRIMARY program membership (decided with\nChris, ORC-209 Phase E):\n\n    POST/PUT/PATCH /api/users/user_role/  ->  resolve user_profile -> learner (DDB-3) + role,\n        find the learner's primary enrollment, then:\n          active == false  ->  POST /enrollments/{id}/deactivate\n          otherwise        ->  PATCH /enrollments/{id} {role_id[, start_date]}\n\nThis converges with PATCH /api-banner/users/ (which also changes the primary membership's\nrole), so both classic role-change paths land the same Oracle effect.\n\nScope / caveats (recorded for the #424 register):\n  - Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\n    multi-program learner this targets the PRIMARY membership only.\n  - DELETE (role removal) is NOT supported here — a bare DELETE carries no user_profile to\n    resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:\"Inactive\"} with\n    the program to deactivate a specific membership.\n  - Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\n    use GET /api/programs/affiliations/?user= to see a learner's memberships.","requestBody":{"content":{"application/json":null}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoles"}}}},"400":{"description":"validation error"},"401":{"description":"unauthenticated"},"404":{"description":"not found or out of tenant scope"}}}}}}
```

## PUT /api/users/user\_role/{id}/

> Legacy /api/users/user\_role/ bridge resource (ORC-209 Phase E).\
> \
> Classic \`\`UserRoleViewSet\`\` (users\_userrole) is a program-LESS role-designation model\
> (user\_profile + role + start/end dates + active flag). Oracle has no standalone user-role\
> table — a user's role lives on their program\_membership (Connect enrollment). So a UserRole\
> write is mapped to a role change on the learner's PRIMARY program membership (decided with\
> Chris, ORC-209 Phase E):\
> \
> &#x20;   POST/PUT/PATCH /api/users/user\_role/  ->  resolve user\_profile -> learner (DDB-3) + role,\
> &#x20;       find the learner's primary enrollment, then:\
> &#x20;         active == false  ->  POST /enrollments/{id}/deactivate\
> &#x20;         otherwise        ->  PATCH /enrollments/{id} {role\_id\[, start\_date]}\
> \
> This converges with PATCH /api-banner/users/ (which also changes the primary membership's\
> role), so both classic role-change paths land the same Oracle effect.\
> \
> Scope / caveats (recorded for the #424 register):\
> &#x20; \- Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\
> &#x20;   multi-program learner this targets the PRIMARY membership only.\
> &#x20; \- DELETE (role removal) is NOT supported here — a bare DELETE carries no user\_profile to\
> &#x20;   resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:"Inactive"} with\
> &#x20;   the program to deactivate a specific membership.\
> &#x20; \- Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\
> &#x20;   use GET /api/programs/affiliations/?user= to see a learner's memberships.

```json
{"openapi":"3.1.0","info":{"title":"Medtrics Legacy SIS Bridge (Compatibility API)","version":"draft-2026-10-29"},"servers":[{"url":"https://{client}.mymedtrics.com","description":"Tenant host; Caddy routes /api-banner/* and /api/* to the bridge (internal only)","variables":{"client":{"default":"<client-name>","description":"Tenant subdomain"}}},{"url":"http://localhost:8090","description":"local dev (see docker/caddy/Caddyfile for deployed hosts)"}],"security":[{"LegacyToken":[]},{"LegacyBasic":[]}],"components":{"securitySchemes":{"LegacyToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization: Token <hex>"},"LegacyBasic":{"type":"http","scheme":"basic"}},"schemas":{"UserRoles":{"type":"object","description":"Legacy-shaped user_role record as served by the bridge; translated from Connect /enrollments","properties":{"id":{"type":"integer","description":"legacy numeric id"}}}}},"paths":{"/api/users/user_role/{id}/":{"put":{"operationId":"userRoles_update","tags":["UserRoles"],"description":"Legacy /api/users/user_role/ bridge resource (ORC-209 Phase E).\n\nClassic ``UserRoleViewSet`` (users_userrole) is a program-LESS role-designation model\n(user_profile + role + start/end dates + active flag). Oracle has no standalone user-role\ntable — a user's role lives on their program_membership (Connect enrollment). So a UserRole\nwrite is mapped to a role change on the learner's PRIMARY program membership (decided with\nChris, ORC-209 Phase E):\n\n    POST/PUT/PATCH /api/users/user_role/  ->  resolve user_profile -> learner (DDB-3) + role,\n        find the learner's primary enrollment, then:\n          active == false  ->  POST /enrollments/{id}/deactivate\n          otherwise        ->  PATCH /enrollments/{id} {role_id[, start_date]}\n\nThis converges with PATCH /api-banner/users/ (which also changes the primary membership's\nrole), so both classic role-change paths land the same Oracle effect.\n\nScope / caveats (recorded for the #424 register):\n  - Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\n    multi-program learner this targets the PRIMARY membership only.\n  - DELETE (role removal) is NOT supported here — a bare DELETE carries no user_profile to\n    resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:\"Inactive\"} with\n    the program to deactivate a specific membership.\n  - Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\n    use GET /api/programs/affiliations/?user= to see a learner's memberships.","requestBody":{"content":{"application/json":null}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoles"}}}},"400":{"description":"validation error"},"401":{"description":"unauthenticated"},"404":{"description":"not found or out of tenant scope"}}}}}}
```

## PATCH /api/users/user\_role/{id}/

> Legacy /api/users/user\_role/ bridge resource (ORC-209 Phase E).\
> \
> Classic \`\`UserRoleViewSet\`\` (users\_userrole) is a program-LESS role-designation model\
> (user\_profile + role + start/end dates + active flag). Oracle has no standalone user-role\
> table — a user's role lives on their program\_membership (Connect enrollment). So a UserRole\
> write is mapped to a role change on the learner's PRIMARY program membership (decided with\
> Chris, ORC-209 Phase E):\
> \
> &#x20;   POST/PUT/PATCH /api/users/user\_role/  ->  resolve user\_profile -> learner (DDB-3) + role,\
> &#x20;       find the learner's primary enrollment, then:\
> &#x20;         active == false  ->  POST /enrollments/{id}/deactivate\
> &#x20;         otherwise        ->  PATCH /enrollments/{id} {role\_id\[, start\_date]}\
> \
> This converges with PATCH /api-banner/users/ (which also changes the primary membership's\
> role), so both classic role-change paths land the same Oracle effect.\
> \
> Scope / caveats (recorded for the #424 register):\
> &#x20; \- Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\
> &#x20;   multi-program learner this targets the PRIMARY membership only.\
> &#x20; \- DELETE (role removal) is NOT supported here — a bare DELETE carries no user\_profile to\
> &#x20;   resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:"Inactive"} with\
> &#x20;   the program to deactivate a specific membership.\
> &#x20; \- Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\
> &#x20;   use GET /api/programs/affiliations/?user= to see a learner's memberships.

```json
{"openapi":"3.1.0","info":{"title":"Medtrics Legacy SIS Bridge (Compatibility API)","version":"draft-2026-10-29"},"servers":[{"url":"https://{client}.mymedtrics.com","description":"Tenant host; Caddy routes /api-banner/* and /api/* to the bridge (internal only)","variables":{"client":{"default":"<client-name>","description":"Tenant subdomain"}}},{"url":"http://localhost:8090","description":"local dev (see docker/caddy/Caddyfile for deployed hosts)"}],"security":[{"LegacyToken":[]},{"LegacyBasic":[]}],"components":{"securitySchemes":{"LegacyToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization: Token <hex>"},"LegacyBasic":{"type":"http","scheme":"basic"}},"schemas":{"UserRoles":{"type":"object","description":"Legacy-shaped user_role record as served by the bridge; translated from Connect /enrollments","properties":{"id":{"type":"integer","description":"legacy numeric id"}}}}},"paths":{"/api/users/user_role/{id}/":{"patch":{"operationId":"userRoles_partial_update","tags":["UserRoles"],"description":"Legacy /api/users/user_role/ bridge resource (ORC-209 Phase E).\n\nClassic ``UserRoleViewSet`` (users_userrole) is a program-LESS role-designation model\n(user_profile + role + start/end dates + active flag). Oracle has no standalone user-role\ntable — a user's role lives on their program_membership (Connect enrollment). So a UserRole\nwrite is mapped to a role change on the learner's PRIMARY program membership (decided with\nChris, ORC-209 Phase E):\n\n    POST/PUT/PATCH /api/users/user_role/  ->  resolve user_profile -> learner (DDB-3) + role,\n        find the learner's primary enrollment, then:\n          active == false  ->  POST /enrollments/{id}/deactivate\n          otherwise        ->  PATCH /enrollments/{id} {role_id[, start_date]}\n\nThis converges with PATCH /api-banner/users/ (which also changes the primary membership's\nrole), so both classic role-change paths land the same Oracle effect.\n\nScope / caveats (recorded for the #424 register):\n  - Single-program clients (e.g. RUSM) have exactly one membership → unambiguous. For a\n    multi-program learner this targets the PRIMARY membership only.\n  - DELETE (role removal) is NOT supported here — a bare DELETE carries no user_profile to\n    resolve the learner; use PATCH /api/programs/affiliations/{id}/ {status:\"Inactive\"} with\n    the program to deactivate a specific membership.\n  - Read (list/retrieve) is NOT supported — there is no Oracle user-role entity to enumerate;\n    use GET /api/programs/affiliations/?user= to see a learner's memberships.","requestBody":{"content":{"application/json":null}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoles"}}}},"400":{"description":"validation error"},"401":{"description":"unauthenticated"},"404":{"description":"not found or out of tenant scope"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mymedtrics.com/api-reference/medtrics-classic-sis-bridge/user-roles.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
