---
title: "Gets list of roles assigned to user by username"
method: GET
path: "/api/Roles/{username}"
tags: ["Roles"]
---

# Gets list of roles assigned to user by username

`GET /api/Roles/{username}`

## Request

- Base URL: `https://apidocs.cflowapps.com` (the document declares no server; this is the origin it was published from)
- URL: `https://apidocs.cflowapps.com/api/Roles/{username}`
- Auth: API key in header `X-Api-Key` and API key in header `X-User-Key`
- TypeScript: <https://skmtc.dev/cflowapps/apis/cflow-public-api/docs/api/Roles/:username/get.ts> (a function with typed inputs; its response is checked against the schema)

Sample request:
            
    Get api/roles/john

## Path parameters

- `username` string, required

## Response `200`

Return list of roles assigned to the user.

- UserRolesResDto[]
  - `status` string, nullable: Returns status
  - `roles` RolesListResDto[], nullable: List of roles assigned to the user
    - `roleId` integer: Role Id
    - `roles` string, nullable: Name of the role

## Other responses

- `400`: Username is missing
- `401`: Unauthorized
- `403`: Forbidden
- `404`: The specified user was not found.
- `500`: Internal Server Error

---

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