---
title: "Edits server roles ranks"
method: PATCH
path: "/servers/{target}/roles/ranks"
tags: ["Server Permissions"]
---

# Edits server roles ranks

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

Edit's server role's ranks.

## Path parameters

- `target` string, required

## Headers

- `X-Audit-Log-Reason` string

## Request body

- DataEditRoleRanks — New role positions
  - `ranks` string[], required

## Response `200`

- Server — Server
  - `_id` string, required — Unique Id
  - `owner` string, required — User id of the owner
  - `name` string, required — Name of the server
  - `description` string, nullable — Description for the server
  - `channels` string[], required — Channels within this server
  - `categories` Category[], nullable — Categories for this server
    - `id` string, required — Unique ID for this category
    - `title` string, required — Title for this category
    - `channels` string[], required — Channels in this category
  - `system_messages` SystemMessageChannels — System message channel assignments
    - `user_joined` string, nullable — ID of channel to send user join messages in
    - `user_left` string, nullable — ID of channel to send user left messages in
    - `user_kicked` string, nullable — ID of channel to send user kicked messages in
    - `user_banned` string, nullable — ID of channel to send user banned messages in
  - `roles` object — Roles for this server
  - `default_permissions` integer, required — Default set of server and channel permissions
  - `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
  - `banner` 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
  - `flags` integer — Bitfield of server flags
  - `nsfw` boolean — Whether this server is flagged as not safe for work
  - `analytics` boolean — Whether to enable analytics
  - `discoverable` boolean — Whether this server should be publicly discoverable
  - `approximate_member_count` integer, required — Approximate amount of members in the server

## 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)
