---
title: "Get user-to-role report (U2R)"
method: GET
path: "/admin/user-to-roles"
tags: ["Admin"]
---

# Get user-to-role report (U2R)

`GET /admin/user-to-roles`

## Request

- Base URL: `https://api.unravelcarbon.com/api/v1`
- URL: `https://api.unravelcarbon.com/api/v1/admin/user-to-roles`
- Auth: HTTP bearer

Export the user-to-role (U2R) mapping for access reviews.

- **Grain**: one row per user, role, and organizational unit
- **Active rows** (`User Active Status` / `User Role Active Status` = `1`): live `UserRole` assignments
- **Inactive rows** (status = `0`): pending company invitations, including **Invite Expired** and Invite Sent, plus the latest deleted-user snapshot per email
- **Precedence**: a live assignment for an email is status `1` only (no duplicate inactive row); pending invitations win over deleted snapshots for the same email
- **Blank fields**: `Department` is always an empty string
- **UserID**: SSO login email (same as `UserEmail`)
- **Created / Modified**: from the live role assignment for active rows; from the invitation or deleted-user snapshot for inactive rows
- **CreatedBy / ModifiedBy**: actor emails when known (granting admin, inviter, or last role editor). Deleted snapshots leave `CreatedBy` blank

Requires an API key whose owner currently has company Administrator or workspace Administrator access.

## Headers

- `Authorization` string, required

## Response `200`

User-to-role report

- AuditUserToRoleResponse
  - `data` AuditUserToRoleRecord[]
    - `UserID` string: SSO login email. Same value as `UserEmail`.
    - `User` string
    - `UserEmail` string
    - `Department` string: Always blank.
    - `Rolename` string
    - `Created` string: Role assignment created date (`dd/MM/yyyy`) from the live `UserRole` (or invitation / deleted snapshot for inactive rows).
    - `Modified` string: Role assignment last modified date (`dd/MM/yyyy`) from the live `UserRole` (or invitation / deleted snapshot for inactive rows).
    - `CreatedBy` string: Email of the user who created the assignment. Blank when unknown.
    - `ModifiedBy` string: Email of the user who last changed the assignment. Blank when unknown.
    - `LastLoginDateTime` string: Last login timestamp (`dd/MMM/yyyy HH:mm:ss`), blank when never logged in.
    - `LastLogoutDateTime` string: Last logout timestamp (`dd/MMM/yyyy HH:mm:ss`), blank when never logged out.
    - `User Active Status` 0 | 1: `1` for users with a live `UserRole` assignment. `0` for inactive rows: pending invitations (Invite Sent and Invite Expired) and the latest deleted-user snapshot per email.
    - `User Role Active Status` 0 | 1: Mirrors user active status for each U2R row.

## Other responses

- `401`: Missing, invalid, or expired API key, or a valid key whose owner is not currently a company or workspace Administrator. These cases return 401 with a `message` field. A valid non-admin key does not return 403.

## Changes

- **2026-10-14** `92352c72d399`: 2 warning, 2 info
  - removed the optional property `data/items/User Active Status (0 equal inactive, 1 equal active)` from the response with the `200` status
  - removed the optional property `data/items/User Role Active Status (0 equal inactive, 1 equal active)` from the response with the `200` status
  - added the optional property `data/items/User Active Status` to the response with the `200` status
  - added the optional property `data/items/User Role Active Status` to the response with the `200` status
- **2026-09-09** `dcedb670a296`: 2 info
  - added the optional property `data/items/CreatedBy` to the response with the `200` status
  - added the optional property `data/items/ModifiedBy` to the response with the `200` status

[Operation history](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/changes/admin/user-to-roles/get.md)

---

[API](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api.md) - [All operations](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/revisions/310d3bb09dbe?raw)
