patch/guilds/{guild_id}/roles/{role_id}

Update guild role

Update guild role. Requires manage_roles permission. Modifies role name, permissions, color, and other settings.

update_guild_role

Parameters

NameInTypeDescription
guild_id*pathSnowflakeTypeThe ID of the guild
role_id*pathSnowflakeTypeThe ID of the role

Request body

application/json

json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the role (1-100 characters)"
    },
    "color": {
      "type": "integer",
      "minimum": 0,
      "maximum": 16777215,
      "format": "int32",
      "description": "The color of the role as an integer"
    },
    "permissions": {
      "$ref": "#/components/schemas/UnsignedInt64Type"
    },
    "hoist": {
      "type": "boolean",
      "description": "Whether the role should be displayed separately in the member list"
    },
    "hoist_position": {
      "anyOf": [
        {
          "type": "integer",
          "format": "int53"
        },
        {
          "type": "null"
        }
      ],
      "description": "The position of the role in the hoisted member list"
    },
    "mentionable": {
      "type": "boolean",
      "description": "Whether the role can be mentioned by anyone"
    }
  }
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$",
      "description": "The unique identifier for this role"
    },
    "name": {
      "type": "string",
      "description": "The name of the role"
    },
    "color": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "format": "int32",
      "description": "The colour of the role as an integer"
    },
    "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "format": "int32",
      "description": "The position of the role in the role hierarchy"
    },
    "hoist_position": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/Int32Type"
        },
        {
          "type": "null"
        }
      ],
      "description": "The position of the role in the hoisted member list"
    },
    "permissions": {
      "type": "string",
      "format": "int64",
      "pattern": "^[0-9]+$",
      "description": "The permissions bitfield for the role"
    },
    "hoist": {
      "type": "boolean",
      "description": "Whether this role is displayed separately in the member list"
    },
    "mentionable": {
      "type": "boolean",
      "description": "Whether this role can be mentioned by anyone"
    },
    "unicode_emoji": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The unicode emoji for this role"
    }
  },
  "required": [
    "id",
    "name",
    "color",
    "position",
    "permissions",
    "hoist",
    "mentionable"
  ]
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "enum": [
        "RATE_LIMITED"
      ]
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message",
    "retry_after"
  ]
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}