---
title: "Edit Role"
method: PATCH
path: "/servers/{target}/roles/{role_id}"
tags: ["Server Permissions"]
---

# Edit Role

`PATCH /servers/{target}/roles/{role_id}`

Edit a role by its id.

## Path parameters

- `target` string, required
- `role_id` string, required

## Headers

- `X-Audit-Log-Reason` string

## Request body

- DataEditRole — New role information
  - `name` string, nullable — Role name
  - `colour` string, nullable — Role colour
  - `hoist` boolean, nullable — Whether this role should be displayed separately
  - `rank` integer, nullable — Ranking position **Removed** - no effect, use the edit server role positions route
  - `icon` string, nullable — Role icon Provide an Autumn attachment Id.
  - `remove` FieldsRole[] — Fields to remove from role object

## Response `200`

- Role — Role
  - `_id` string, required — Unique Id
  - `name` string, required — Role name
  - `permissions` OverrideField, required — Representation of a single permission override as it appears on models and in the database
    - `a` integer, required — Allow bit flags
    - `d` integer, required — Disallow bit flags
  - `colour` string, nullable — Colour used for this role This can be any valid CSS colour
  - `hoist` boolean — Whether this role should be shown separately on the member sidebar
  - `rank` integer — Ranking of this role
  - `icon` File — File
    - `_id` string, required — Unique Id
    - `tag` string, required — Tag / bucket this file was uploaded to
    - `filename` string, required — Original filename
    - `metadata` union, required — Metadata associated with a file
      - object — File is just a generic uncategorised file
        - `type` 'File', required
      - object — File contains textual data and should be displayed as such
        - `type` 'Text', required
      - object — File is an image with specific dimensions, and may be animated
        - `type` 'Image', required
        - `width` integer, required
        - `height` integer, required
        - `thumbhash` integer[], nullable
        - `animated` boolean, nullable
      - object — File is a video with specific dimensions
        - `type` 'Video', required
        - `width` integer, required
        - `height` integer, required
      - object — File is audio
        - `type` 'Audio', required
    - `content_type` string, required — Raw content type of this file
    - `size` integer, required — Size of this file (in bytes)
    - `deleted` boolean, nullable — Whether this file was deleted
    - `reported` boolean, nullable — Whether this file was reported
    - `message_id` string, nullable
    - `user_id` string, nullable
    - `server_id` string, nullable
    - `object_id` string, nullable — Id of the object this file is associated with

## Other responses

- `default` — An error occurred.

---

[API](https://skmtc.net/revolt/apis/revolt-api.md) · [All operations](https://skmtc.net/revolt/apis/revolt-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/revolt/revolt-api/versions/a235e4654b18/schema)
