---
title: "Update a role"
method: PUT
path: "/api/roles/{id}"
tags: ["Roles & Permissions"]
---

# Update a role

`PUT /api/roles/{id}`

## Request

- Base URL: `https://api.sponsorunited.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sponsorunited.com/api/roles/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sponsorunited/apis/sponsorunited-api/docs/api/roles/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates a role's display name, description, permissions, and role level

## Path parameters

- `id` integer, required

## Request body

- UpdateRoleRequest
  - `display_name` string
  - `description` string
  - `permissions` string
  - `allow` boolean: When present and true, it will attach one or more permissions to the role.

## Response `200`

The updated role with its permissions.

- RoleStoreUpdateResource
  - `role` object
    - `id` integer
    - `name` string
    - `display_name` string
    - `description` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `permissions` PermissionsGroupedByLabel
      - `Label Name` Permission[]: The name of the label under which several permissions are grouped.
        - `id` integer
        - `name` string
        - `display_name` string
        - `description` string
        - `created_at` string, date-time
        - `updated_at` string, date-time
  - `all_permissions` PermissionsGroupedByLabel
    - `Label Name` Permission[]: The name of the label under which several permissions are grouped.
      - `id` integer
      - `name` string
      - `display_name` string
      - `description` string
      - `created_at` string, date-time
      - `updated_at` string, date-time

---

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