---
title: "Add role(s) to user"
method: POST
path: "/api/v1/organizations/{organizationId}/users/{username}/roles"
tags: ["Accounts", "Organizations"]
---

# Add role(s) to user

`POST /api/v1/organizations/{organizationId}/users/{username}/roles`

## Request

- Base URL: `https://backend.id4i.de`
- URL: `https://backend.id4i.de/api/v1/organizations/{organizationId}/users/{username}/roles`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/id4i/apis/id4i-api/docs/api/v1/organizations/:organizationId/users/:username/roles/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `organizationId` string, required
- `username` string, required

## Request body

- ChangeRoleRequest
  - `roles` string[]

## Response `200`

OK

## Other responses

- `201`: Created
- `202`: Accepted
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method not allowed
- `406`: Not Acceptable
- `409`: Conflict
- `415`: Unsupported Media Type
- `500`: Internal Server Error

---

[API](https://skmtc.dev/id4i/apis/id4i-api.md) - [All operations](https://skmtc.dev/id4i/apis/id4i-api/llms.txt) - [OpenAPI document](https://skmtc.dev/id4i/apis/id4i-api/revisions/b5f585ff1a29?raw)
