post/oauth2/authorize/consent

Grant OAuth2 consent

User grants permission for an OAuth2 application to access authorized scopes. Used in authorization code flow to complete the authorization process after user review.

provide_oauth2_consent

Request body

application/json

json
{
  "type": "object",
  "properties": {
    "response_type": {
      "type": "string",
      "description": "The OAuth2 response type"
    },
    "client_id": {
      "$ref": "#/components/schemas/SnowflakeType"
    },
    "redirect_uri": {
      "type": "string",
      "description": "The URI to redirect to after authorization"
    },
    "scope": {
      "type": "string",
      "description": "The space-separated list of requested scopes"
    },
    "state": {
      "type": "string",
      "description": "A random string for CSRF protection"
    },
    "permissions": {
      "type": "string",
      "description": "The bot permissions to request"
    },
    "guild_id": {
      "$ref": "#/components/schemas/SnowflakeType"
    },
    "channel_id": {
      "$ref": "#/components/schemas/SnowflakeType"
    },
    "code_challenge": {
      "type": "string",
      "description": "The PKCE code challenge"
    },
    "code_challenge_method": {
      "type": "string",
      "enum": [
        "S256",
        "plain"
      ],
      "x-enumNames": [
        "S256",
        "PLAIN"
      ],
      "x-enumDescriptions": [
        "SHA-256 hash of code verifier",
        "Plain text code verifier"
      ],
      "description": "The PKCE code challenge method"
    }
  },
  "required": [
    "client_id",
    "scope"
  ]
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "redirect_to": {
      "type": "string",
      "description": "The URL to redirect the user to after consent"
    }
  },
  "required": [
    "redirect_to"
  ]
}
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"
  ]
}