Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(api): find every live route when generating openapi.json (#2484)

Hampusea93ef5352b2
diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.json
index 56d906739..58cfa0258 100644
--- a/fluxer_api/src/api/openapi/openapi.json
+++ b/fluxer_api/src/api/openapi/openapi.json
@@ -5884,20 +5884,1757 @@
]
}
},
+ "/dl/desktop/{channel}/{plat}/{arch}/latest": {
+ "get": {
+ "operationId": "get_latest_desktop_version",
+ "summary": "Get latest desktop version",
+ "tags": ["Downloads"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VersionInfoResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get latest desktop version"}},
+ "description": "Returns metadata for the latest desktop version including download URLs and SHA-256 checksums for all available formats. Pass ?test=1 to resolve against unreleased test builds.",
+ "parameters": [
+ {
+ "name": "channel",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The channel"
+ },
+ {"name": "plat", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The plat"},
+ {"name": "arch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The arch"},
+ {
+ "name": "test",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "description": "When set to 1/true, resolve against the desktop-test/ bucket prefix instead of desktop/."
+ }
+ }
+ ]
+ }
+ },
+ "/dl/desktop/{channel}/{plat}/{arch}/latest/{format}": {
+ "get": {
+ "operationId": "download_latest_desktop_version",
+ "summary": "Download latest desktop version",
+ "tags": ["Downloads"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Download latest desktop version"}},
+ "description": "Streams the latest available desktop application version for the specified platform and architecture. Pass ?test=1 to download an unreleased test build.",
+ "parameters": [
+ {
+ "name": "channel",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The channel"
+ },
+ {"name": "plat", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The plat"},
+ {"name": "arch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The arch"},
+ {"name": "format", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The format"},
+ {
+ "name": "test",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "description": "When set to 1/true, resolve against the desktop-test/ bucket prefix instead of desktop/."
+ }
+ }
+ ]
+ }
+ },
+ "/dl/desktop/{channel}/{plat}/{arch}/versions": {
+ "get": {
+ "operationId": "list_desktop_versions",
+ "summary": "List desktop versions",
+ "tags": ["Downloads"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DesktopVersionsResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "List desktop versions"}},
+ "description": "Lists available desktop versions with pagination for the specified platform and architecture.",
+ "parameters": [
+ {
+ "name": "channel",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The channel"
+ },
+ {"name": "plat", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The plat"},
+ {"name": "arch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The arch"},
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 100,
+ "format": "int32",
+ "description": "Maximum number of versions to return"
+ }
+ },
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
+ "description": "Return versions before this version"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
+ "description": "Return versions after this version"
+ }
+ },
+ {
+ "name": "test",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "description": "When set to 1/true, resolve against the desktop-test/ bucket prefix instead of desktop/."
+ }
+ }
+ ]
+ }
+ },
+ "/dl/desktop/{channel}/{plat}/{arch}/{version}/{format}": {
+ "get": {
+ "operationId": "download_desktop_version",
+ "summary": "Download desktop version",
+ "tags": ["Downloads"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Download desktop version"}},
+ "description": "Streams a specific desktop application version for the given platform and architecture. Pass ?test=1 to download an unreleased test build.",
+ "parameters": [
+ {
+ "name": "channel",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The channel"
+ },
+ {"name": "plat", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The plat"},
+ {"name": "arch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The arch"},
+ {
+ "name": "version",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The version"
+ },
+ {"name": "format", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The format"},
+ {
+ "name": "test",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "string",
+ "description": "When set to 1/true, resolve against the desktop-test/ bucket prefix instead of desktop/."
+ }
+ }
+ ]
+ }
+ },
"/donations/checkout": {
"post": {
- "operationId": "create_donation_checkout",
- "summary": "Create donation checkout session",
- "tags": ["Donations"],
+ "operationId": "create_donation_checkout",
+ "summary": "Create donation checkout session",
+ "tags": ["Donations"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationCheckoutResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Create donation checkout session"}},
+ "description": "Creates a Stripe checkout session for a one-time or recurring donation.",
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationCheckoutRequest"}}}
+ }
+ }
+ },
+ "/donations/manage": {
+ "get": {
+ "operationId": "manage_donation",
+ "summary": "Manage donation subscription",
+ "tags": ["Donations"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Manage donation subscription"}},
+ "description": "Validates the magic link token and redirects to Stripe billing portal.",
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "minLength": 64,
+ "maxLength": 64,
+ "description": "Magic link token for donor authentication"
+ }
+ }
+ ]
+ }
+ },
+ "/donations/request-link": {
+ "post": {
+ "operationId": "request_donation_magic_link",
+ "summary": "Request donation management link",
+ "tags": ["Donations"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Request donation management link"}},
+ "description": "Sends a magic link email to the provided address for managing recurring donations.",
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationRequestLinkRequest"}}}
+ }
+ }
+ },
+ "/emojis/{emoji_id}/metadata": {
+ "get": {
+ "operationId": "get_emoji_metadata",
+ "summary": "Get emoji metadata",
+ "tags": ["Emojis"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiMetadataResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get emoji metadata"}},
+ "description": "Lookup minimal metadata for a custom emoji by id, including whether the source guild allows the in-app one-click clone shortcut. Does not require membership in the source guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "emoji_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the emoji"
+ }
+ ]
+ }
+ },
+ "/gateway/bot": {
+ "get": {
+ "operationId": "get_gateway_bot",
+ "summary": "Get gateway information",
+ "tags": ["Gateway"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GatewayBotResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get gateway information"}},
+ "description": "Retrieves gateway connection information and recommended shard count for establishing WebSocket connections."
+ }
+ },
+ "/gifs/featured": {
+ "get": {
+ "operationId": "get_featured_gifs",
+ "summary": "Get featured GIFs",
+ "tags": ["GIFs"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifFeaturedResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get featured GIFs"}},
+ "description": "Retrieves currently featured GIFs and category tags from the active provider.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
+ }
+ },
+ "/gifs/register-share": {
+ "post": {
+ "operationId": "register_gifs_share",
+ "summary": "Register a GIF share",
+ "tags": ["GIFs"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Register a GIF share"}},
+ "description": "Notifies the active GIF provider that the caller is sharing one of its GIFs.",
+ "security": [{"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifRegisterShareRequest"}}}
+ }
+ }
+ },
+ "/gifs/search": {
+ "get": {
+ "operationId": "search_gifs",
+ "summary": "Search GIFs",
+ "tags": ["GIFs"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
+ }
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Search GIFs"}},
+ "description": "Searches the active GIF provider for GIFs matching the given query. The provider name is returned in the X-Fluxer-GIF-Provider response header so clients can adapt without refetching .well-known.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "q",
+ "in": "query",
+ "required": true,
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
+ }
+ },
+ "/gifs/suggest": {
+ "get": {
+ "operationId": "get_gifs_search_suggestions",
+ "summary": "Get GIF search suggestions",
+ "tags": ["GIFs"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"type": "array", "items": {"type": "string"}}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get GIF search suggestions"}},
+ "description": "Returns search-term suggestions from the active GIF provider for the given partial query.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "q",
+ "in": "query",
+ "required": true,
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
+ }
+ },
+ "/gifs/trending": {
+ "get": {
+ "operationId": "get_trending_gifs",
+ "summary": "Get trending GIFs",
+ "tags": ["GIFs"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
+ }
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get trending GIFs"}},
+ "description": "Retrieves trending GIFs from the active provider.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
+ }
+ },
+ "/gifts/{code}": {
+ "get": {
+ "operationId": "get_gift_code",
+ "summary": "Get gift code",
+ "tags": ["Gifts"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GiftCodeResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get gift code"}},
+ "description": "Retrieves information about a gift code, including sender details and premium entitlements.",
+ "parameters": [
+ {"name": "code", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The code"}
+ ]
+ }
+ },
+ "/gifts/{code}/redeem": {
+ "post": {
+ "operationId": "redeem_gift_code",
+ "summary": "Redeem gift code",
+ "tags": ["Gifts"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Redeem gift code"}},
+ "description": "Redeems a gift code for the authenticated user, applying premium benefits.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "code", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The code"}
+ ]
+ }
+ },
+ "/guilds": {
+ "post": {
+ "operationId": "create_guild",
+ "summary": "Create guild",
+ "tags": ["Guilds"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Create guild"}},
+ "description": "Only claimed, email-verified non-bot users can create guilds.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildCreateRequest"}}}
+ }
+ }
+ },
+ "/guilds/{guild_id}": {
+ "get": {
+ "operationId": "get_guild",
+ "summary": "Get guild information",
+ "tags": ["Guilds"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get guild information"}},
+ "description": "User must be a member of the guild to access this endpoint. Requires guilds OAuth scope if using bearer token.",
+ "security": [{"botToken": []}, {"oauth2Token": ["guilds"]}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ]
+ },
+ "patch": {
+ "operationId": "update_guild",
+ "summary": "Update guild settings",
+ "tags": ["Guilds"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Update guild settings"}},
+ "description": "Requires manage_guild permission. Updates guild name, description, icon, banner, and other configuration options.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildUpdateRequest"}}}
+ }
+ }
+ },
+ "/guilds/{guild_id}/audit-logs": {
+ "get": {
+ "operationId": "list_guild_audit_logs",
+ "summary": "List guild audit logs",
+ "tags": ["Guilds"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildAuditLogListResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "List guild audit logs"}},
+ "description": "List guild audit logs. Requires view_audit_logs permission. Returns guild activity history with pagination and action filtering.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ },
+ {"name": "limit", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Int32Type"}},
+ {
+ "name": "before",
+ "in": "query",
+ "required": false,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"}
+ },
+ {"name": "after", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SnowflakeType"}},
+ {
+ "name": "user_id",
+ "in": "query",
+ "required": false,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"}
+ },
+ {
+ "name": "action_type",
+ "in": "query",
+ "required": false,
+ "schema": {"$ref": "#/components/schemas/AuditLogActionType"}
+ }
+ ]
+ }
+ },
+ "/guilds/{guild_id}/bans": {
+ "get": {
+ "operationId": "list_guild_bans",
+ "summary": "List guild bans",
+ "tags": ["Guilds"],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildBanResponse"}}
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "List guild bans"}},
+ "description": "List guild bans. Requires ban_members permission. Returns all banned users for the guild including ban reasons and expiry times.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ]
+ }
+ },
+ "/guilds/{guild_id}/bans/{user_id}": {
+ "put": {
+ "operationId": "ban_guild_member",
+ "summary": "Ban guild member",
+ "tags": ["Guilds"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Ban guild member"}},
+ "description": "Ban guild member. Requires ban_members permission. Prevents user from joining; optionally deletes recent messages and sets ban expiry duration.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ },
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the user"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildBanCreateRequest"}}}
+ }
+ },
+ "delete": {
+ "operationId": "unban_guild_member",
+ "summary": "Unban guild member",
+ "tags": ["Guilds"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Unban guild member"}},
+ "description": "Unban guild member. Requires ban_members permission. Removes ban and allows user to rejoin the guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ },
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the user"
+ }
+ ]
+ }
+ },
+ "/guilds/{guild_id}/channels": {
+ "get": {
+ "operationId": "list_guild_channels",
+ "summary": "List guild channels",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationCheckoutResponse"}}}
+ "content": {
+ "application/json": {
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/ChannelResponse"}}
+ }
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -5938,25 +7675,40 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create donation checkout session"}},
- "description": "Creates a Stripe checkout session for a one-time or recurring donation.",
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationCheckoutRequest"}}}
- }
- }
- },
- "/donations/manage": {
- "get": {
- "operationId": "manage_donation",
- "summary": "Manage donation subscription",
- "tags": ["Donations"],
+ "x-mint": {"metadata": {"title": "List guild channels"}},
+ "description": "List guild channels. Returns all channels in the guild that the user has access to view.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ]
+ },
+ "post": {
+ "operationId": "create_guild_channel",
+ "summary": "Create guild channel",
+ "tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -5997,34 +7749,41 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Manage donation subscription"}},
- "description": "Validates the magic link token and redirects to Stripe billing portal.",
+ "x-mint": {"metadata": {"title": "Create guild channel"}},
+ "description": "Create guild channel. Requires manage_channels permission. Creates a new text, voice, or category channel in the guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
- "name": "token",
- "in": "query",
+ "name": "guild_id",
+ "in": "path",
"required": true,
- "schema": {
- "type": "string",
- "minLength": 64,
- "maxLength": 64,
- "description": "Magic link token for donor authentication"
- }
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
}
- ]
- }
- },
- "/donations/request-link": {
- "post": {
- "operationId": "request_donation_magic_link",
- "summary": "Request donation management link",
- "tags": ["Donations"],
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelCreateRequest"}}}
+ }
+ },
+ "patch": {
+ "operationId": "update_guild_channel_positions",
+ "summary": "Update channel positions",
+ "tags": ["Guilds"],
"responses": {
"204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -6065,23 +7824,33 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Request donation management link"}},
- "description": "Sends a magic link email to the provided address for managing recurring donations.",
+ "x-mint": {"metadata": {"title": "Update channel positions"}},
+ "description": "Update channel positions. Requires manage_channels permission. Reorders channels and optionally changes parent categories and permission locks.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DonationRequestLinkRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelPositionUpdateRequest"}}}
}
}
},
- "/emojis/{emoji_id}/metadata": {
- "get": {
- "operationId": "get_emoji_metadata",
- "summary": "Get emoji metadata",
- "tags": ["Emojis"],
+ "/guilds/{guild_id}/clone-emoji-disabled": {
+ "patch": {
+ "operationId": "toggle_clone_emoji_disabled",
+ "summary": "Toggle emoji cloning disabled",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiMetadataResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6135,34 +7904,117 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get emoji metadata"}},
- "description": "Lookup minimal metadata for a custom emoji by id, including whether the source guild allows the in-app one-click clone shortcut. Does not require membership in the source guild.",
+ "x-mint": {"metadata": {"title": "Toggle emoji cloning disabled"}},
+ "description": "Requires manage_guild permission. When disabled, members of other guilds cannot use the in-app one-click clone shortcut for this guild's emojis. Note that this does not prevent users from saving and re-uploading the image manually.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
- "name": "emoji_id",
+ "name": "guild_id",
"in": "path",
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the emoji"
+ "description": "The ID of the guild"
}
- ]
+ ],
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
}
},
- "/gateway/bot": {
- "get": {
- "operationId": "get_gateway_bot",
- "summary": "Get gateway information",
- "tags": ["Gateway"],
+ "/guilds/{guild_id}/clone-sticker-disabled": {
+ "patch": {
+ "operationId": "toggle_clone_sticker_disabled",
+ "summary": "Toggle sticker cloning disabled",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GatewayBotResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
},
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Toggle sticker cloning disabled"}},
+ "description": "Requires manage_guild permission. When disabled, members of other guilds cannot use the in-app one-click clone shortcut for this guild's stickers. Note that this does not prevent users from saving and re-uploading the image manually.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
+ }
+ },
+ "/guilds/{guild_id}/delete": {
+ "post": {
+ "operationId": "delete_guild",
+ "summary": "Delete guild",
+ "tags": ["Guilds"],
+ "responses": {
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -6203,24 +8055,46 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get gateway information"}},
- "description": "Retrieves gateway connection information and recommended shard count for establishing WebSocket connections."
+ "x-mint": {"metadata": {"title": "Delete guild"}},
+ "description": "Only guild owner can delete. Requires sudo mode verification (MFA). Permanently deletes the guild and all associated data.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildDeleteRequest"}}}
+ }
}
},
- "/gifts/{code}": {
- "get": {
- "operationId": "get_gift_code",
- "summary": "Get gift code",
- "tags": ["Gifts"],
+ "/guilds/{guild_id}/detached-banner": {
+ "patch": {
+ "operationId": "toggle_detached_banner",
+ "summary": "Toggle detached banner",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GiftCodeResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -6261,20 +8135,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get gift code"}},
- "description": "Retrieves information about a gift code, including sender details and premium entitlements.",
+ "x-mint": {"metadata": {"title": "Toggle detached banner"}},
+ "description": "Requires manage_guild permission. Enables or disables independent banner display configuration.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
- {"name": "code", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The code"}
- ]
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
}
},
- "/gifts/{code}/redeem": {
+ "/guilds/{guild_id}/discovery": {
"post": {
- "operationId": "redeem_gift_code",
- "summary": "Redeem gift code",
- "tags": ["Gifts"],
+ "operationId": "apply_for_discovery",
+ "summary": "Apply for guild discovery",
+ "tags": ["Discovery"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -6327,23 +8212,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Redeem gift code"}},
- "description": "Redeems a gift code for the authenticated user, applying premium benefits.",
- "security": [{"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Apply for guild discovery"}},
+ "description": "Submit a discovery application for a guild. Requires MANAGE_GUILD permission.",
+ "security": [{"sessionToken": []}, {"botToken": []}],
"parameters": [
- {"name": "code", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The code"}
- ]
- }
- },
- "/guilds": {
- "post": {
- "operationId": "create_guild",
- "summary": "Create guild",
- "tags": ["Guilds"],
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationRequest"}}}
+ }
+ },
+ "patch": {
+ "operationId": "edit_discovery_application",
+ "summary": "Edit discovery application",
+ "tags": ["Discovery"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6397,25 +8290,29 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create guild"}},
- "description": "Only claimed, email-verified non-bot users can create guilds.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Edit discovery application"}},
+ "description": "Update the description or category of an existing discovery application. Requires MANAGE_GUILD permission.",
+ "security": [{"sessionToken": []}, {"botToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildCreateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationPatchRequest"}}}
}
- }
- },
- "/guilds/{guild_id}": {
- "get": {
- "operationId": "get_guild",
- "summary": "Get guild information",
- "tags": ["Guilds"],
+ },
+ "delete": {
+ "operationId": "withdraw_discovery_application",
+ "summary": "Withdraw discovery application",
+ "tags": ["Discovery"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -6468,9 +8365,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get guild information"}},
- "description": "User must be a member of the guild to access this endpoint. Requires guilds OAuth scope if using bearer token.",
- "security": [{"botToken": []}, {"oauth2Token": ["guilds"]}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Withdraw discovery application"}},
+ "description": "Withdraw a discovery application or remove a guild from discovery. Requires MANAGE_GUILD permission.",
+ "security": [{"sessionToken": []}, {"botToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -6481,14 +8378,14 @@
}
]
},
- "patch": {
- "operationId": "update_guild",
- "summary": "Update guild settings",
- "tags": ["Guilds"],
+ "get": {
+ "operationId": "get_discovery_status",
+ "summary": "Get discovery status",
+ "tags": ["Discovery"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryStatusResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6542,9 +8439,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild settings"}},
- "description": "Requires manage_guild permission. Updates guild name, description, icon, banner, and other configuration options.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Get discovery status"}},
+ "description": "Get the current discovery status and eligibility of a guild. Requires MANAGE_GUILD permission.",
+ "security": [{"sessionToken": []}, {"botToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -6553,22 +8450,18 @@
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildUpdateRequest"}}}
- }
+ ]
}
},
- "/guilds/{guild_id}/audit-logs": {
- "get": {
- "operationId": "list_guild_audit_logs",
- "summary": "List guild audit logs",
+ "/guilds/{guild_id}/emojis": {
+ "post": {
+ "operationId": "create_guild_emoji",
+ "summary": "Create guild emoji",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildAuditLogListResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6622,8 +8515,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild audit logs"}},
- "description": "List guild audit logs. Requires view_audit_logs permission. Returns guild activity history with pagination and action filtering.",
+ "x-mint": {"metadata": {"title": "Create guild emoji"}},
+ "description": "Create guild emoji. Requires manage_emojis permission. Uploads and registers a new custom emoji for the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -6632,43 +8525,21 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {"name": "limit", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Int32Type"}},
- {
- "name": "before",
- "in": "query",
- "required": false,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"}
- },
- {"name": "after", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SnowflakeType"}},
- {
- "name": "user_id",
- "in": "query",
- "required": false,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"}
- },
- {
- "name": "action_type",
- "in": "query",
- "required": false,
- "schema": {"$ref": "#/components/schemas/AuditLogActionType"}
}
- ]
- }
- },
- "/guilds/{guild_id}/bans": {
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiCreateRequest"}}}
+ }
+ },
"get": {
- "operationId": "list_guild_bans",
- "summary": "List guild bans",
+ "operationId": "list_guild_emojis",
+ "summary": "List guild emojis",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildBanResponse"}}
- }
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiWithUserListResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6722,8 +8593,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild bans"}},
- "description": "List guild bans. Requires ban_members permission. Returns all banned users for the guild including ban reasons and expiry times.",
+ "x-mint": {"metadata": {"title": "List guild emojis"}},
+ "description": "List guild emojis. Returns all custom emojis for the guild including metadata about creators and timestamps.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -6736,13 +8607,16 @@
]
}
},
- "/guilds/{guild_id}/bans/{user_id}": {
- "put": {
- "operationId": "ban_guild_member",
- "summary": "Ban guild member",
+ "/guilds/{guild_id}/emojis/bulk": {
+ "post": {
+ "operationId": "bulk_create_guild_emojis",
+ "summary": "Bulk create guild emojis",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiBulkCreateResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -6795,8 +8669,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Ban guild member"}},
- "description": "Ban guild member. Requires ban_members permission. Prevents user from joining; optionally deletes recent messages and sets ban expiry duration.",
+ "x-mint": {"metadata": {"title": "Bulk create guild emojis"}},
+ "description": "Bulk create guild emojis. Requires manage_emojis permission. Creates multiple emojis in a single request for efficiency.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -6805,26 +8679,24 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
}
],
"requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildBanCreateRequest"}}}
- }
- },
- "delete": {
- "operationId": "unban_guild_member",
- "summary": "Unban guild member",
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiBulkCreateRequest"}}}
+ }
+ }
+ },
+ "/guilds/{guild_id}/emojis/clone": {
+ "post": {
+ "operationId": "clone_guild_emoji",
+ "summary": "Clone guild emoji",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -6877,8 +8749,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Unban guild member"}},
- "description": "Unban guild member. Requires ban_members permission. Removes ban and allows user to rejoin the guild.",
+ "x-mint": {"metadata": {"title": "Clone guild emoji"}},
+ "description": "Clone an existing emoji into this guild by referencing its id. Copies the source image server-side, so the client does not need to re-upload it. Requires manage_emojis permission in the target guild, and the source guild must permit cloning.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -6887,30 +8759,23 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiCloneRequest"}}}
+ }
}
},
- "/guilds/{guild_id}/channels": {
- "get": {
- "operationId": "list_guild_channels",
- "summary": "List guild channels",
+ "/guilds/{guild_id}/emojis/{emoji_id}": {
+ "patch": {
+ "operationId": "update_guild_emoji",
+ "summary": "Update guild emoji",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/ChannelResponse"}}
- }
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -6964,8 +8829,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild channels"}},
- "description": "List guild channels. Returns all channels in the guild that the user has access to view.",
+ "x-mint": {"metadata": {"title": "Update guild emoji"}},
+ "description": "Update guild emoji. Requires manage_emojis permission. Renames or updates properties of an existing emoji.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -6974,18 +8839,26 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "emoji_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the emoji"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiUpdateRequest"}}}
+ }
},
- "post": {
- "operationId": "create_guild_channel",
- "summary": "Create guild channel",
+ "delete": {
+ "operationId": "delete_guild_emoji",
+ "summary": "Delete guild emoji",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7038,8 +8911,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create guild channel"}},
- "description": "Create guild channel. Requires manage_channels permission. Creates a new text, voice, or category channel in the guild.",
+ "x-mint": {"metadata": {"title": "Delete guild emoji"}},
+ "description": "Delete guild emoji. Requires manage_emojis permission. Removes a custom emoji from the guild; optionally purges all references.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7048,19 +8921,33 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "emoji_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the emoji"
+ },
+ {
+ "name": "purge",
+ "in": "query",
+ "required": false,
+ "schema": {"type": "string", "description": "Whether to also purge the asset from storage"}
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelCreateRequest"}}}
- }
- },
+ ]
+ }
+ },
+ "/guilds/{guild_id}/hide-owner-crown": {
"patch": {
- "operationId": "update_guild_channel_positions",
- "summary": "Update channel positions",
+ "operationId": "toggle_hide_owner_crown",
+ "summary": "Toggle hide community owner crown",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7113,8 +9000,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update channel positions"}},
- "description": "Update channel positions. Requires manage_channels permission. Reorders channels and optionally changes parent categories and permission locks.",
+ "x-mint": {"metadata": {"title": "Toggle hide community owner crown"}},
+ "description": "Requires manage_guild permission. When enabled, the community owner crown icon is hidden across the UI for this guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7125,19 +9012,23 @@
"description": "The ID of the guild"
}
],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChannelPositionUpdateRequest"}}}
- }
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
}
},
- "/guilds/{guild_id}/delete": {
- "post": {
- "operationId": "delete_guild",
- "summary": "Delete guild",
- "tags": ["Guilds"],
+ "/guilds/{guild_id}/invites": {
+ "get": {
+ "operationId": "list_guild_invites",
+ "summary": "List guild invites",
+ "tags": ["Invites"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/InviteMetadataResponseSchema"}}
+ }
+ }
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7190,8 +9081,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete guild"}},
- "description": "Only guild owner can delete. Requires sudo mode verification (MFA). Permanently deletes the guild and all associated data.",
+ "x-mint": {"metadata": {"title": "List guild invites"}},
+ "description": "Retrieves all currently active invites across all channels in the specified guild, including invite codes, creators, expiration times, and usage statistics. The authenticated user must have permission to manage invites for the guild. Returns an array of invite metadata objects.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7201,22 +9092,18 @@
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildDeleteRequest"}}}
- }
+ ]
}
},
- "/guilds/{guild_id}/discovery": {
- "post": {
- "operationId": "apply_for_discovery",
- "summary": "Apply for guild discovery",
- "tags": ["Discovery"],
+ "/guilds/{guild_id}/invites-disabled": {
+ "patch": {
+ "operationId": "toggle_invites_disabled",
+ "summary": "Toggle invites disabled",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7270,9 +9157,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Apply for guild discovery"}},
- "description": "Submit a discovery application for a guild. Requires MANAGE_GUILD permission.",
- "security": [{"sessionToken": []}, {"botToken": []}],
+ "x-mint": {"metadata": {"title": "Toggle invites disabled"}},
+ "description": "Requires manage_guild permission. Pauses or resumes invite-link joins for this guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -7282,19 +9169,22 @@
"description": "The ID of the guild"
}
],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationRequest"}}}
- }
- },
- "patch": {
- "operationId": "edit_discovery_application",
- "summary": "Edit discovery application",
- "tags": ["Discovery"],
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
+ }
+ },
+ "/guilds/{guild_id}/members": {
+ "get": {
+ "operationId": "list_guild_members",
+ "summary": "List guild members",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationResponse"}}}
+ "content": {
+ "application/json": {
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildMemberResponse"}}
+ }
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7348,9 +9238,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Edit discovery application"}},
- "description": "Update the description or category of an existing discovery application. Requires MANAGE_GUILD permission.",
- "security": [{"sessionToken": []}, {"botToken": []}],
+ "x-mint": {"metadata": {"title": "List guild members"}},
+ "description": "List guild members. Supports pagination with limit and after cursor. Returns member information for the specified guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -7358,19 +9248,33 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- }
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryApplicationPatchRequest"}}}
- }
- },
- "delete": {
- "operationId": "withdraw_discovery_application",
- "summary": "Withdraw discovery application",
- "tags": ["Discovery"],
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 1000,
+ "format": "int32",
+ "description": "Maximum number of members to return (1-1000, default 1)"
+ }
+ },
+ {"name": "after", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SnowflakeType"}}
+ ]
+ }
+ },
+ "/guilds/{guild_id}/members-search": {
+ "post": {
+ "operationId": "search_guild_members",
+ "summary": "Search guild members",
+ "tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberSearchResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7423,9 +9327,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Withdraw discovery application"}},
- "description": "Withdraw a discovery application or remove a guild from discovery. Requires MANAGE_GUILD permission.",
- "security": [{"sessionToken": []}, {"botToken": []}],
+ "x-mint": {"metadata": {"title": "Search guild members"}},
+ "description": "Search and filter guild members with pagination support.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -7434,16 +9338,22 @@
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
}
- ]
- },
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberSearchRequest"}}}
+ }
+ }
+ },
+ "/guilds/{guild_id}/members/@me": {
"get": {
- "operationId": "get_discovery_status",
- "summary": "Get discovery status",
- "tags": ["Discovery"],
+ "operationId": "get_current_guild_member",
+ "summary": "Get current user guild member",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryStatusResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7497,9 +9407,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get discovery status"}},
- "description": "Get the current discovery status and eligibility of a guild. Requires MANAGE_GUILD permission.",
- "security": [{"sessionToken": []}, {"botToken": []}],
+ "x-mint": {"metadata": {"title": "Get current user guild member"}},
+ "description": "Get current user guild member. Returns the member information for the authenticated user in the specified guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -7509,17 +9419,15 @@
"description": "The ID of the guild"
}
]
- }
- },
- "/guilds/{guild_id}/emojis": {
- "post": {
- "operationId": "create_guild_emoji",
- "summary": "Create guild emoji",
+ },
+ "patch": {
+ "operationId": "update_current_guild_member",
+ "summary": "Update current user guild member",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7573,8 +9481,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create guild emoji"}},
- "description": "Create guild emoji. Requires manage_emojis permission. Uploads and registers a new custom emoji for the guild.",
+ "x-mint": {"metadata": {"title": "Update current user guild member"}},
+ "description": "Update current user guild member. User can modify their own nickname within the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7587,17 +9495,19 @@
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiCreateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MyGuildMemberUpdateRequest"}}}
}
- },
+ }
+ },
+ "/guilds/{guild_id}/members/{user_id}": {
"get": {
- "operationId": "list_guild_emojis",
- "summary": "List guild emojis",
+ "operationId": "get_guild_member",
+ "summary": "Get guild member by user ID",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiWithUserListResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7651,8 +9561,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild emojis"}},
- "description": "List guild emojis. Returns all custom emojis for the guild including metadata about creators and timestamps.",
+ "x-mint": {"metadata": {"title": "Get guild member by user ID"}},
+ "description": "Get guild member by user ID. Returns member information including roles, nickname, and join date for the specified user in the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7661,19 +9571,24 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the user"
}
]
- }
- },
- "/guilds/{guild_id}/emojis/bulk": {
- "post": {
- "operationId": "bulk_create_guild_emojis",
- "summary": "Bulk create guild emojis",
+ },
+ "patch": {
+ "operationId": "update_guild_member",
+ "summary": "Update guild member",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiBulkCreateResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -7727,8 +9642,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Bulk create guild emojis"}},
- "description": "Bulk create guild emojis. Requires manage_emojis permission. Creates multiple emojis in a single request for efficiency.",
+ "x-mint": {"metadata": {"title": "Update guild member"}},
+ "description": "Update guild member. Requires manage_members permission. Can modify member nickname, voice state, and other member properties.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7737,24 +9652,26 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the user"
}
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiBulkCreateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberUpdateRequest"}}}
}
- }
- },
- "/guilds/{guild_id}/emojis/clone": {
- "post": {
- "operationId": "clone_guild_emoji",
- "summary": "Clone guild emoji",
+ },
+ "delete": {
+ "operationId": "remove_guild_member",
+ "summary": "Remove guild member",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7807,8 +9724,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Clone guild emoji"}},
- "description": "Clone an existing emoji into this guild by referencing its id. Copies the source image server-side, so the client does not need to re-upload it. Requires manage_emojis permission in the target guild, and the source guild must permit cloning.",
+ "x-mint": {"metadata": {"title": "Remove guild member"}},
+ "description": "Remove guild member. Requires kick_members permission. Removes the specified user from the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7817,24 +9734,24 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the user"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiCloneRequest"}}}
- }
+ ]
}
},
- "/guilds/{guild_id}/emojis/{emoji_id}": {
- "patch": {
- "operationId": "update_guild_emoji",
- "summary": "Update guild emoji",
+ "/guilds/{guild_id}/members/{user_id}/roles/{role_id}": {
+ "put": {
+ "operationId": "add_guild_member_role",
+ "summary": "Add role to guild member",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -7887,8 +9804,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild emoji"}},
- "description": "Update guild emoji. Requires manage_emojis permission. Renames or updates properties of an existing emoji.",
+ "x-mint": {"metadata": {"title": "Add role to guild member"}},
+ "description": "Add role to guild member. Requires manage_roles permission. Grants the specified role to the user in the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7899,21 +9816,24 @@
"description": "The ID of the guild"
},
{
- "name": "emoji_id",
+ "name": "user_id",
"in": "path",
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the emoji"
+ "description": "The ID of the user"
+ },
+ {
+ "name": "role_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the role"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildEmojiUpdateRequest"}}}
- }
+ ]
},
"delete": {
- "operationId": "delete_guild_emoji",
- "summary": "Delete guild emoji",
+ "operationId": "remove_guild_member_role",
+ "summary": "Remove role from guild member",
"tags": ["Guilds"],
"responses": {
"204": {"description": "No Content"},
@@ -7969,8 +9889,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete guild emoji"}},
- "description": "Delete guild emoji. Requires manage_emojis permission. Removes a custom emoji from the guild; optionally purges all references.",
+ "x-mint": {"metadata": {"title": "Remove role from guild member"}},
+ "description": "Remove role from guild member. Requires manage_roles permission. Revokes the specified role from the user in the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -7981,32 +9901,33 @@
"description": "The ID of the guild"
},
{
- "name": "emoji_id",
+ "name": "user_id",
"in": "path",
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the emoji"
+ "description": "The ID of the user"
},
{
- "name": "purge",
- "in": "query",
- "required": false,
- "schema": {"type": "string", "description": "Whether to also purge the asset from storage"}
+ "name": "role_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the role"
}
]
}
},
- "/guilds/{guild_id}/invites": {
+ "/guilds/{guild_id}/roles": {
"get": {
- "operationId": "list_guild_invites",
- "summary": "List guild invites",
- "tags": ["Invites"],
+ "operationId": "list_guild_roles",
+ "summary": "List guild roles",
+ "tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/InviteMetadataResponseSchema"}}
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildRoleResponse"}}
}
}
},
@@ -8062,9 +9983,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild invites"}},
- "description": "Retrieves all currently active invites across all channels in the specified guild, including invite codes, creators, expiration times, and usage statistics. The authenticated user must have permission to manage invites for the guild. Returns an array of invite metadata objects.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "List guild roles"}},
+ "description": "List guild roles. Requires guilds OAuth scope if using bearer token. Returns all roles defined in the guild including their permissions and settings.",
+ "security": [{"botToken": []}, {"oauth2Token": ["guilds"]}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -8074,21 +9995,15 @@
"description": "The ID of the guild"
}
]
- }
- },
- "/guilds/{guild_id}/members": {
- "get": {
- "operationId": "list_guild_members",
- "summary": "List guild members",
+ },
+ "post": {
+ "operationId": "create_guild_role",
+ "summary": "Create guild role",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildMemberResponse"}}
- }
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -8142,8 +10057,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild members"}},
- "description": "List guild members. Supports pagination with limit and after cursor. Returns member information for the specified guild.",
+ "x-mint": {"metadata": {"title": "Create guild role"}},
+ "description": "Create guild role. Requires manage_roles permission. Creates a new role with specified name, permissions, and color.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8152,33 +10067,96 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleCreateRequest"}}}
+ }
+ },
+ "patch": {
+ "operationId": "update_guild_role_positions",
+ "summary": "Update role positions",
+ "tags": ["Guilds"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- {
- "name": "limit",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "maximum": 1000,
- "format": "int32",
- "description": "Maximum number of members to return (1-1000, default 1)"
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {
+ "application/json": {
+ "schema": {
+ "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"]
+ }
+ }
+ },
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
}
},
- {"name": "after", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/SnowflakeType"}}
- ]
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "x-mint": {"metadata": {"title": "Update role positions"}},
+ "description": "Update role positions. Requires manage_roles permission. Reorders roles to change their hierarchy and permission precedence.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "guild_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the guild"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRolePositionsRequest"}}}
+ }
}
},
- "/guilds/{guild_id}/members-search": {
- "post": {
- "operationId": "search_guild_members",
- "summary": "Search guild members",
+ "/guilds/{guild_id}/roles/hoist-positions": {
+ "patch": {
+ "operationId": "update_role_hoist_positions",
+ "summary": "Update role hoist positions",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberSearchResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8231,8 +10209,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Search guild members"}},
- "description": "Search and filter guild members with pagination support.",
+ "x-mint": {"metadata": {"title": "Update role hoist positions"}},
+ "description": "Update role hoist positions. Requires manage_roles permission. Sets the display priority for hoisted (separated) roles in the member list.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8245,20 +10223,15 @@
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberSearchRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleHoistPositionsRequest"}}}
}
- }
- },
- "/guilds/{guild_id}/members/@me": {
- "get": {
- "operationId": "get_current_guild_member",
- "summary": "Get current user guild member",
+ },
+ "delete": {
+ "operationId": "reset_role_hoist_positions",
+ "summary": "Reset role hoist positions",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8311,8 +10284,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get current user guild member"}},
- "description": "Get current user guild member. Returns the member information for the authenticated user in the specified guild.",
+ "x-mint": {"metadata": {"title": "Reset role hoist positions"}},
+ "description": "Reset role hoist positions. Requires manage_roles permission. Clears all hoist position assignments for roles in the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8323,15 +10296,17 @@
"description": "The ID of the guild"
}
]
- },
+ }
+ },
+ "/guilds/{guild_id}/roles/{role_id}": {
"patch": {
- "operationId": "update_current_guild_member",
- "summary": "Update current user guild member",
+ "operationId": "update_guild_role",
+ "summary": "Update guild role",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -8385,8 +10360,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update current user guild member"}},
- "description": "Update current user guild member. User can modify their own nickname within the guild.",
+ "x-mint": {"metadata": {"title": "Update guild role"}},
+ "description": "Update guild role. Requires manage_roles permission. Modifies role name, permissions, color, and other settings.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8395,24 +10370,26 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "role_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the role"
}
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MyGuildMemberUpdateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleUpdateRequest"}}}
}
- }
- },
- "/guilds/{guild_id}/members/{user_id}": {
- "get": {
- "operationId": "get_guild_member",
- "summary": "Get guild member by user ID",
+ },
+ "delete": {
+ "operationId": "delete_guild_role",
+ "summary": "Delete guild role",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8465,8 +10442,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get guild member by user ID"}},
- "description": "Get guild member by user ID. Returns member information including roles, nickname, and join date for the specified user in the guild.",
+ "x-mint": {"metadata": {"title": "Delete guild role"}},
+ "description": "Delete guild role. Requires manage_roles permission. Permanently removes the role from the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8477,22 +10454,24 @@
"description": "The ID of the guild"
},
{
- "name": "user_id",
+ "name": "role_id",
"in": "path",
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
+ "description": "The ID of the role"
}
]
- },
- "patch": {
- "operationId": "update_guild_member",
- "summary": "Update guild member",
+ }
+ },
+ "/guilds/{guild_id}/stickers": {
+ "post": {
+ "operationId": "create_guild_sticker",
+ "summary": "Create guild sticker",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -8546,8 +10525,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild member"}},
- "description": "Update guild member. Requires manage_members permission. Can modify member nickname, voice state, and other member properties.",
+ "x-mint": {"metadata": {"title": "Create guild sticker"}},
+ "description": "Create guild sticker. Requires manage_emojis permission. Uploads a new sticker with name, description, and tags.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8556,26 +10535,24 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
}
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildMemberUpdateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerCreateRequest"}}}
}
},
- "delete": {
- "operationId": "remove_guild_member",
- "summary": "Remove guild member",
+ "get": {
+ "operationId": "list_guild_stickers",
+ "summary": "List guild stickers",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerWithUserListResponse"}}
+ }
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8628,8 +10605,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Remove guild member"}},
- "description": "Remove guild member. Requires kick_members permission. Removes the specified user from the guild.",
+ "x-mint": {"metadata": {"title": "List guild stickers"}},
+ "description": "List guild stickers. Returns all custom stickers for the guild including metadata about creators, descriptions, and tags.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8638,24 +10615,20 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
}
]
}
},
- "/guilds/{guild_id}/members/{user_id}/roles/{role_id}": {
- "put": {
- "operationId": "add_guild_member_role",
- "summary": "Add role to guild member",
+ "/guilds/{guild_id}/stickers/bulk": {
+ "post": {
+ "operationId": "bulk_create_guild_stickers",
+ "summary": "Bulk create guild stickers",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerBulkCreateResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8708,8 +10681,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Add role to guild member"}},
- "description": "Add role to guild member. Requires manage_roles permission. Grants the specified role to the user in the guild.",
+ "x-mint": {"metadata": {"title": "Bulk create guild stickers"}},
+ "description": "Bulk create guild stickers. Requires manage_emojis permission. Creates multiple stickers in a single request for efficiency.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8718,29 +10691,24 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
- },
- {
- "name": "role_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the role"
}
- ]
- },
- "delete": {
- "operationId": "remove_guild_member_role",
- "summary": "Remove role from guild member",
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerBulkCreateRequest"}}}
+ }
+ }
+ },
+ "/guilds/{guild_id}/stickers/clone": {
+ "post": {
+ "operationId": "clone_guild_sticker",
+ "summary": "Clone guild sticker",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8793,8 +10761,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Remove role from guild member"}},
- "description": "Remove role from guild member. Requires manage_roles permission. Revokes the specified role from the user in the guild.",
+ "x-mint": {"metadata": {"title": "Clone guild sticker"}},
+ "description": "Clone an existing sticker into this guild by referencing its id. Copies the source image server-side, so the client does not need to re-upload it. Requires manage_emojis permission in the target guild, and the source guild must permit cloning.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8803,37 +10771,23 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "user_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the user"
- },
- {
- "name": "role_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the role"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerCloneRequest"}}}
+ }
}
},
- "/guilds/{guild_id}/roles": {
- "get": {
- "operationId": "list_guild_roles",
- "summary": "List guild roles",
+ "/guilds/{guild_id}/stickers/{sticker_id}": {
+ "patch": {
+ "operationId": "update_guild_sticker",
+ "summary": "Update guild sticker",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/GuildRoleResponse"}}
- }
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -8887,9 +10841,9 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild roles"}},
- "description": "List guild roles. Requires guilds OAuth scope if using bearer token. Returns all roles defined in the guild including their permissions and settings.",
- "security": [{"botToken": []}, {"oauth2Token": ["guilds"]}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Update guild sticker"}},
+ "description": "Update guild sticker. Requires manage_emojis permission. Updates sticker name, description, or tags.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
"name": "guild_id",
@@ -8897,18 +10851,26 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "sticker_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the sticker"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerUpdateRequest"}}}
+ }
},
- "post": {
- "operationId": "create_guild_role",
- "summary": "Create guild role",
+ "delete": {
+ "operationId": "delete_guild_sticker",
+ "summary": "Delete guild sticker",
"tags": ["Guilds"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -8961,8 +10923,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create guild role"}},
- "description": "Create guild role. Requires manage_roles permission. Creates a new role with specified name, permissions, and color.",
+ "x-mint": {"metadata": {"title": "Delete guild sticker"}},
+ "description": "Delete guild sticker. Requires manage_emojis permission. Removes a sticker from the guild; optionally purges all references.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -8971,19 +10933,33 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
+ },
+ {
+ "name": "sticker_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the sticker"
+ },
+ {
+ "name": "purge",
+ "in": "query",
+ "required": false,
+ "schema": {"type": "string", "description": "Whether to also purge the asset from storage"}
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleCreateRequest"}}}
- }
- },
+ ]
+ }
+ },
+ "/guilds/{guild_id}/text-channel-flexible-names": {
"patch": {
- "operationId": "update_guild_role_positions",
- "summary": "Update role positions",
+ "operationId": "toggle_text_channel_flexible_names",
+ "summary": "Toggle text channel flexible names",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9036,8 +11012,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update role positions"}},
- "description": "Update role positions. Requires manage_roles permission. Reorders roles to change their hierarchy and permission precedence.",
+ "x-mint": {"metadata": {"title": "Toggle text channel flexible names"}},
+ "description": "Requires manage_guild permission. Allows or disables flexible naming for text channels.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -9048,19 +11024,19 @@
"description": "The ID of the guild"
}
],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRolePositionsRequest"}}}
- }
+ "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}
}
},
- "/guilds/{guild_id}/roles/hoist-positions": {
- "patch": {
- "operationId": "update_role_hoist_positions",
- "summary": "Update role hoist positions",
+ "/guilds/{guild_id}/transfer-ownership": {
+ "post": {
+ "operationId": "transfer_guild_ownership",
+ "summary": "Transfer guild ownership",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9113,8 +11089,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update role hoist positions"}},
- "description": "Update role hoist positions. Requires manage_roles permission. Sets the display priority for hoisted (separated) roles in the member list.",
+ "x-mint": {"metadata": {"title": "Transfer guild ownership"}},
+ "description": "Transfer guild ownership. Only current owner can transfer. Requires sudo mode verification (MFA). Transfers all guild permissions to a new owner.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -9127,15 +11103,20 @@
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleHoistPositionsRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildTransferOwnershipRequest"}}}
}
- },
- "delete": {
- "operationId": "reset_role_hoist_positions",
- "summary": "Reset role hoist positions",
+ }
+ },
+ "/guilds/{guild_id}/vanity-url": {
+ "get": {
+ "operationId": "get_guild_vanity_url",
+ "summary": "Get guild vanity URL",
"tags": ["Guilds"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9188,8 +11169,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Reset role hoist positions"}},
- "description": "Reset role hoist positions. Requires manage_roles permission. Clears all hoist position assignments for roles in the guild.",
+ "x-mint": {"metadata": {"title": "Get guild vanity URL"}},
+ "description": "Returns the custom invite code for the guild if configured.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -9200,17 +11181,15 @@
"description": "The ID of the guild"
}
]
- }
- },
- "/guilds/{guild_id}/roles/{role_id}": {
+ },
"patch": {
- "operationId": "update_guild_role",
- "summary": "Update guild role",
+ "operationId": "update_guild_vanity_url",
+ "summary": "Update guild vanity URL",
"tags": ["Guilds"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLUpdateResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -9264,8 +11243,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild role"}},
- "description": "Update guild role. Requires manage_roles permission. Modifies role name, permissions, color, and other settings.",
+ "x-mint": {"metadata": {"title": "Update guild vanity URL"}},
+ "description": "Requires manage_guild permission. Sets or removes a custom invite code.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -9274,26 +11253,28 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "role_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the role"
}
],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildRoleUpdateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLUpdateRequest"}}}
}
- },
- "delete": {
- "operationId": "delete_guild_role",
- "summary": "Delete guild role",
- "tags": ["Guilds"],
+ }
+ },
+ "/guilds/{guild_id}/webhooks": {
+ "get": {
+ "operationId": "list_guild_webhooks",
+ "summary": "List guild webhooks",
+ "tags": ["Webhooks"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookResponse"}}
+ }
+ }
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9346,8 +11327,8 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete guild role"}},
- "description": "Delete guild role. Requires manage_roles permission. Permanently removes the role from the guild.",
+ "x-mint": {"metadata": {"title": "List guild webhooks"}},
+ "description": "Returns a list of all webhooks configured in the specified guild. Requires the user to have appropriate permissions to view webhooks in the guild.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
@@ -9356,39 +11337,21 @@
"required": true,
"schema": {"$ref": "#/components/schemas/SnowflakeType"},
"description": "The ID of the guild"
- },
- {
- "name": "role_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the role"
}
]
}
},
- "/guilds/{guild_id}/stickers": {
- "post": {
- "operationId": "create_guild_sticker",
- "summary": "Create guild sticker",
- "tags": ["Guilds"],
+ "/harvest-downloads/{harvestId}": {
+ "get": {
+ "operationId": "download_data_harvest_archive",
+ "summary": "Download data harvest archive",
+ "tags": ["Users"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -9429,46 +11392,33 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create guild sticker"}},
- "description": "Create guild sticker. Requires manage_emojis permission. Uploads a new sticker with name, description, and tags.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Download data harvest archive"}},
+ "description": "Streams a completed data harvest archive. Authorised by a signed, expiring token rather than a session, so the link works from the harvest completion email. Only active when presigned harvest downloads are disabled.",
"parameters": [
{
- "name": "guild_id",
+ "name": "harvestId",
"in": "path",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
+ "schema": {"type": "string"},
+ "description": "The harvestId"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerCreateRequest"}}}
- }
- },
+ ]
+ }
+ },
+ "/invites/{invite_code}": {
"get": {
- "operationId": "list_guild_stickers",
- "summary": "List guild stickers",
- "tags": ["Guilds"],
+ "operationId": "get_invite",
+ "summary": "Get invite information",
+ "tags": ["Invites"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerWithUserListResponse"}}
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InviteResponseSchema"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -9509,29 +11459,26 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild stickers"}},
- "description": "List guild stickers. Returns all custom stickers for the guild including metadata about creators, descriptions, and tags.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Get invite information"}},
+ "description": "Fetches detailed information about an invite using its code, including the guild or channel it belongs to and metadata such as expiration and usage limits. This endpoint does not require authentication and does not consume the invite.",
"parameters": [
{
- "name": "guild_id",
+ "name": "invite_code",
"in": "path",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
+ "schema": {"type": "string"},
+ "description": "The invite code"
}
]
- }
- },
- "/guilds/{guild_id}/stickers/bulk": {
+ },
"post": {
- "operationId": "bulk_create_guild_stickers",
- "summary": "Bulk create guild stickers",
- "tags": ["Guilds"],
+ "operationId": "accept_invite",
+ "summary": "Accept invite",
+ "tags": ["Invites"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerBulkCreateResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InviteResponseSchema"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -9585,34 +11532,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Bulk create guild stickers"}},
- "description": "Bulk create guild stickers. Requires manage_emojis permission. Creates multiple stickers in a single request for efficiency.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Accept invite"}},
+ "description": "Accepts an invite using its code, adding the authenticated user to the corresponding guild or other entity. The invite usage count is incremented, and if it reaches its maximum usage limit or expiration, the invite is automatically revoked. Returns the accepted invite details.",
+ "security": [{"sessionToken": []}],
"parameters": [
{
- "name": "guild_id",
+ "name": "invite_code",
"in": "path",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
+ "schema": {"type": "string"},
+ "description": "The invite code"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerBulkCreateRequest"}}}
- }
- }
- },
- "/guilds/{guild_id}/stickers/clone": {
- "post": {
- "operationId": "clone_guild_sticker",
- "summary": "Clone guild sticker",
- "tags": ["Guilds"],
+ ]
+ },
+ "delete": {
+ "operationId": "delete_invite",
+ "summary": "Delete invite",
+ "tags": ["Invites"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9665,46 +11603,34 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Clone guild sticker"}},
- "description": "Clone an existing sticker into this guild by referencing its id. Copies the source image server-side, so the client does not need to re-upload it. Requires manage_emojis permission in the target guild, and the source guild must permit cloning.",
+ "x-mint": {"metadata": {"title": "Delete invite"}},
+ "description": "Permanently deletes an invite by its code, preventing any further usage. The authenticated user must have permission to manage invites for the guild or channel associated with the invite. This action can be logged in the audit log if an X-Audit-Log-Reason header is provided.",
"security": [{"botToken": []}, {"sessionToken": []}],
"parameters": [
{
- "name": "guild_id",
+ "name": "invite_code",
"in": "path",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
+ "schema": {"type": "string"},
+ "description": "The invite code"
}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerCloneRequest"}}}
- }
+ ]
}
},
- "/guilds/{guild_id}/stickers/{sticker_id}": {
- "patch": {
- "operationId": "update_guild_sticker",
- "summary": "Update guild sticker",
- "tags": ["Guilds"],
+ "/ip": {
+ "get": {
+ "operationId": "get_client_geolocation",
+ "summary": "Get client geolocation",
+ "tags": ["Geolocation"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeolocationResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -9745,36 +11671,20 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild sticker"}},
- "description": "Update guild sticker. Requires manage_emojis permission. Updates sticker name, description, or tags.",
- "security": [{"botToken": []}, {"sessionToken": []}],
- "parameters": [
- {
- "name": "guild_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- },
- {
- "name": "sticker_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the sticker"
- }
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerUpdateRequest"}}}
- }
- },
- "delete": {
- "operationId": "delete_guild_sticker",
- "summary": "Delete guild sticker",
- "tags": ["Guilds"],
+ "x-mint": {"metadata": {"title": "Get client geolocation"}},
+ "description": "Resolves the approximate location of the requesting client from its IP address, together with the locations where age restricted content is gated or unavailable."
+ }
+ },
+ "/klipy/featured": {
+ "get": {
+ "operationId": "get_featured_klipy",
+ "summary": "Get featured GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifFeaturedResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9827,43 +11737,21 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete guild sticker"}},
- "description": "Delete guild sticker. Requires manage_emojis permission. Removes a sticker from the guild; optionally purges all references.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Get featured GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/featured.",
+ "security": [{"sessionToken": []}],
"parameters": [
- {
- "name": "guild_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- },
- {
- "name": "sticker_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the sticker"
- },
- {
- "name": "purge",
- "in": "query",
- "required": false,
- "schema": {"type": "string", "description": "Whether to also purge the asset from storage"}
- }
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
]
}
},
- "/guilds/{guild_id}/transfer-ownership": {
+ "/klipy/register-share": {
"post": {
- "operationId": "transfer_guild_ownership",
- "summary": "Transfer guild ownership",
- "tags": ["Guilds"],
+ "operationId": "register_klipy_share",
+ "summary": "Register a GIF share (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -9916,33 +11804,26 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Transfer guild ownership"}},
- "description": "Transfer guild ownership. Only current owner can transfer. Requires sudo mode verification (MFA). Transfers all guild permissions to a new owner.",
- "security": [{"botToken": []}, {"sessionToken": []}],
- "parameters": [
- {
- "name": "guild_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- }
- ],
+ "x-mint": {"metadata": {"title": "Register a GIF share (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/register-share.",
+ "security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildTransferOwnershipRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifRegisterShareRequest"}}}
}
}
},
- "/guilds/{guild_id}/vanity-url": {
+ "/klipy/search": {
"get": {
- "operationId": "get_guild_vanity_url",
- "summary": "Get guild vanity URL",
- "tags": ["Guilds"],
+ "operationId": "search_klipy",
+ "summary": "Search GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLResponse"}}}
+ "content": {
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -9996,27 +11877,29 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get guild vanity URL"}},
- "description": "Returns the custom invite code for the guild if configured.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Search GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/search.",
+ "security": [{"sessionToken": []}],
"parameters": [
{
- "name": "guild_id",
- "in": "path",
+ "name": "q",
+ "in": "query",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- }
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
]
- },
- "patch": {
- "operationId": "update_guild_vanity_url",
- "summary": "Update guild vanity URL",
- "tags": ["Guilds"],
+ }
+ },
+ "/klipy/suggest": {
+ "get": {
+ "operationId": "get_klipy_search_suggestions",
+ "summary": "Get GIF search suggestions (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLUpdateResponse"}}}
+ "content": {"application/json": {"schema": {"type": "array", "items": {"type": "string"}}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -10070,36 +11953,30 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update guild vanity URL"}},
- "description": "Requires manage_guild permission. Sets or removes a custom invite code.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Get GIF search suggestions (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/suggest.",
+ "security": [{"sessionToken": []}],
"parameters": [
{
- "name": "guild_id",
- "in": "path",
+ "name": "q",
+ "in": "query",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- }
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildVanityURLUpdateRequest"}}}
- }
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
}
},
- "/guilds/{guild_id}/webhooks": {
+ "/klipy/trending-gifs": {
"get": {
- "operationId": "list_guild_webhooks",
- "summary": "List guild webhooks",
- "tags": ["Webhooks"],
+ "operationId": "get_trending_klipy",
+ "summary": "Get trending GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
"content": {
- "application/json": {
- "schema": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookResponse"}}
- }
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
}
},
"400": {
@@ -10154,31 +12031,36 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List guild webhooks"}},
- "description": "Returns a list of all webhooks configured in the specified guild. Requires the user to have appropriate permissions to view webhooks in the guild.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Get trending GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/trending.",
+ "security": [{"sessionToken": []}],
"parameters": [
- {
- "name": "guild_id",
- "in": "path",
- "required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the guild"
- }
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
]
}
},
- "/harvest-downloads/{harvestId}": {
+ "/oauth2/@me": {
"get": {
- "operationId": "download_data_harvest_archive",
- "summary": "Download data harvest archive",
- "tags": ["Users"],
+ "operationId": "get_current_user_oauth2",
+ "summary": "Get current OAuth2 user",
+ "tags": ["OAuth2"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2MeResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -10219,33 +12101,35 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Download data harvest archive"}},
- "description": "Streams a completed data harvest archive. Authorised by a signed, expiring token rather than a session, so the link works from the harvest completion email. Only active when presigned harvest downloads are disabled.",
- "parameters": [
- {
- "name": "harvestId",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The harvestId"
- }
- ]
+ "x-mint": {"metadata": {"title": "Get current OAuth2 user"}},
+ "description": "Retrieves current authorization details for a valid OAuth2 bearer token. Includes OAuth2 metadata and user details when identify is present.",
+ "security": [{"oauth2Token": []}]
}
},
- "/invites/{invite_code}": {
+ "/oauth2/@me/authorizations": {
"get": {
- "operationId": "get_invite",
- "summary": "Get invite information",
- "tags": ["Invites"],
+ "operationId": "list_user_oauth2_authorizations",
+ "summary": "List user OAuth2 authorizations",
+ "tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InviteResponseSchema"}}}
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/OAuth2AuthorizationsListResponse"}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -10285,28 +12169,19 @@
"description": "Internal Server Error - An unexpected error occurred",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
- },
- "x-mint": {"metadata": {"title": "Get invite information"}},
- "description": "Fetches detailed information about an invite using its code, including the guild or channel it belongs to and metadata such as expiration and usage limits. This endpoint does not require authentication and does not consume the invite.",
- "parameters": [
- {
- "name": "invite_code",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The invite code"
- }
- ]
- },
+ },
+ "x-mint": {"metadata": {"title": "List user OAuth2 authorizations"}},
+ "description": "Lists all third-party applications the user has authorized. Shows granted scopes and authorization metadata. Allows user to review and manage delegated access.",
+ "security": [{"sessionToken": []}]
+ }
+ },
+ "/oauth2/@me/authorizations/revoke": {
"post": {
- "operationId": "accept_invite",
- "summary": "Accept invite",
- "tags": ["Invites"],
+ "operationId": "bulk_delete_user_oauth2_authorizations",
+ "summary": "Bulk revoke OAuth2 authorizations",
+ "tags": ["OAuth2"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InviteResponseSchema"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -10359,23 +12234,22 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Accept invite"}},
- "description": "Accepts an invite using its code, adding the authenticated user to the corresponding guild or other entity. The invite usage count is incremented, and if it reaches its maximum usage limit or expiration, the invite is automatically revoked. Returns the accepted invite details.",
+ "x-mint": {"metadata": {"title": "Bulk revoke OAuth2 authorizations"}},
+ "description": "Revokes user authorizations for multiple third-party applications. Immediately invalidates all tokens issued to those applications.",
"security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "invite_code",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The invite code"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/OAuth2AuthorizationsBulkRevokeRequest"}}
}
- ]
- },
+ }
+ }
+ },
+ "/oauth2/@me/authorizations/{applicationId}": {
"delete": {
- "operationId": "delete_invite",
- "summary": "Delete invite",
- "tags": ["Invites"],
+ "operationId": "delete_user_oauth2_authorization",
+ "summary": "Revoke OAuth2 authorization",
+ "tags": ["OAuth2"],
"responses": {
"204": {"description": "No Content"},
"400": {
@@ -10430,34 +12304,42 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete invite"}},
- "description": "Permanently deletes an invite by its code, preventing any further usage. The authenticated user must have permission to manage invites for the guild or channel associated with the invite. This action can be logged in the audit log if an X-Audit-Log-Reason header is provided.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Revoke OAuth2 authorization"}},
+ "description": "Revokes user authorization for a third-party application. Immediately invalidates all tokens issued to that application. User regains control of delegated access.",
+ "security": [{"sessionToken": []}],
"parameters": [
{
- "name": "invite_code",
+ "name": "applicationId",
"in": "path",
"required": true,
"schema": {"type": "string"},
- "description": "The invite code"
+ "description": "The applicationId"
}
]
}
},
- "/ip": {
- "get": {
- "operationId": "get_client_geolocation",
- "summary": "Get client geolocation",
- "tags": ["Geolocation"],
+ "/oauth2/applications": {
+ "post": {
+ "operationId": "create_oauth_application",
+ "summary": "Create OAuth2 application",
+ "tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeolocationResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -10498,19 +12380,24 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get client geolocation"}},
- "description": "Resolves the approximate location of the requesting client from its IP address, together with the locations where age restricted content is gated or unavailable."
+ "x-mint": {"metadata": {"title": "Create OAuth2 application"}},
+ "description": "Creates a new bot-backed OAuth2 application (client). Requires CAPTCHA verification. Returns client credentials including ID and secret. Application can be used for authorization flows and API access.",
+ "security": [{"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationCreateRequest"}}}
+ }
}
},
- "/oauth2/@me": {
+ "/oauth2/applications/@me": {
"get": {
- "operationId": "get_current_user_oauth2",
- "summary": "Get current OAuth2 user",
+ "operationId": "get_oauth_applications_me",
+ "summary": "Get current applications endpoint",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2MeResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2ApplicationsMeResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -10564,22 +12451,20 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get current OAuth2 user"}},
- "description": "Retrieves current authorization details for a valid OAuth2 bearer token. Includes OAuth2 metadata and user details when identify is present.",
- "security": [{"oauth2Token": []}]
+ "x-mint": {"metadata": {"title": "Get current applications endpoint"}},
+ "description": "For user tokens, lists all OAuth2 applications owned by the authenticated user. For bot tokens, returns the bot application object.",
+ "security": [{"botToken": []}, {"sessionToken": []}]
}
},
- "/oauth2/@me/authorizations": {
+ "/oauth2/applications/{id}": {
"get": {
- "operationId": "list_user_oauth2_authorizations",
- "summary": "List user OAuth2 authorizations",
+ "operationId": "get_oauth_application",
+ "summary": "Get application",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/OAuth2AuthorizationsListResponse"}}
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -10633,18 +12518,22 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "List user OAuth2 authorizations"}},
- "description": "Lists all third-party applications the user has authorized. Shows granted scopes and authorization metadata. Allows user to review and manage delegated access.",
- "security": [{"sessionToken": []}]
- }
- },
- "/oauth2/@me/authorizations/revoke": {
- "post": {
- "operationId": "bulk_delete_user_oauth2_authorizations",
- "summary": "Bulk revoke OAuth2 authorizations",
+ "x-mint": {"metadata": {"title": "Get application"}},
+ "description": "Retrieves details of a specific OAuth2 application owned by the user. Returns full application configuration and credentials.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
+ ]
+ },
+ "patch": {
+ "operationId": "update_oauth_application",
+ "summary": "Update application",
"tags": ["OAuth2"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -10697,21 +12586,20 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Bulk revoke OAuth2 authorizations"}},
- "description": "Revokes user authorizations for multiple third-party applications. Immediately invalidates all tokens issued to those applications.",
+ "x-mint": {"metadata": {"title": "Update application"}},
+ "description": "Modifies OAuth2 application configuration such as name, description, and redirect URIs. Does not rotate credentials.",
"security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
+ ],
"requestBody": {
"required": true,
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/OAuth2AuthorizationsBulkRevokeRequest"}}
- }
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationUpdateRequest"}}}
}
- }
- },
- "/oauth2/@me/authorizations/{applicationId}": {
+ },
"delete": {
- "operationId": "delete_user_oauth2_authorization",
- "summary": "Revoke OAuth2 authorization",
+ "operationId": "delete_oauth_application",
+ "summary": "Delete application",
"tags": ["OAuth2"],
"responses": {
"204": {"description": "No Content"},
@@ -10767,29 +12655,27 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Revoke OAuth2 authorization"}},
- "description": "Revokes user authorization for a third-party application. Immediately invalidates all tokens issued to that application. User regains control of delegated access.",
+ "x-mint": {"metadata": {"title": "Delete application"}},
+ "description": "Permanently deletes an OAuth2 application. Requires sudo mode authentication. Invalidates all issued tokens and revokes all user authorizations.",
"security": [{"sessionToken": []}],
"parameters": [
- {
- "name": "applicationId",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The applicationId"
- }
- ]
+ {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ }
}
},
- "/oauth2/applications": {
- "post": {
- "operationId": "create_oauth_application",
- "summary": "Create OAuth2 application",
+ "/oauth2/applications/{id}/bot": {
+ "patch": {
+ "operationId": "update_bot_profile",
+ "summary": "Update bot profile",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotProfileResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -10843,24 +12729,27 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create OAuth2 application"}},
- "description": "Creates a new bot-backed OAuth2 application (client). Requires CAPTCHA verification. Returns client credentials including ID and secret. Application can be used for authorization flows and API access.",
+ "x-mint": {"metadata": {"title": "Update bot profile"}},
+ "description": "Modifies bot profile information such as name, avatar, and status. Changes apply to the bot account associated with this OAuth2 application.",
"security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
+ ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationCreateRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotProfileUpdateRequest"}}}
}
}
},
- "/oauth2/applications/@me": {
- "get": {
- "operationId": "get_oauth_applications_me",
- "summary": "Get current applications endpoint",
+ "/oauth2/applications/{id}/bot/reset-token": {
+ "post": {
+ "operationId": "reset_bot_token",
+ "summary": "Reset bot token",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2ApplicationsMeResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotTokenResetResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -10914,15 +12803,22 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get current applications endpoint"}},
- "description": "For user tokens, lists all OAuth2 applications owned by the authenticated user. For bot tokens, returns the bot application object.",
- "security": [{"botToken": []}, {"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Reset bot token"}},
+ "description": "Rotates the bot token for an OAuth2 application. Requires sudo mode authentication. Invalidates all previously issued bot tokens. Used for security rotation and compromise mitigation.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ }
}
},
- "/oauth2/applications/{id}": {
- "get": {
- "operationId": "get_oauth_application",
- "summary": "Get application",
+ "/oauth2/applications/{id}/client-secret/reset": {
+ "post": {
+ "operationId": "reset_client_secret",
+ "summary": "Reset client secret",
"tags": ["OAuth2"],
"responses": {
"200": {
@@ -10981,34 +12877,32 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get application"}},
- "description": "Retrieves details of a specific OAuth2 application owned by the user. Returns full application configuration and credentials.",
+ "x-mint": {"metadata": {"title": "Reset client secret"}},
+ "description": "Rotates the client secret for an OAuth2 application. Requires sudo mode authentication. Essential security operation for protecting client credentials. Existing access tokens remain valid.",
"security": [{"sessionToken": []}],
"parameters": [
{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ]
- },
- "patch": {
- "operationId": "update_oauth_application",
- "summary": "Update application",
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ }
+ }
+ },
+ "/oauth2/applications/{id}/public": {
+ "get": {
+ "operationId": "get_public_application",
+ "summary": "Get public application",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationPublicResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11047,25 +12941,25 @@
"500": {
"description": "Internal Server Error - An unexpected error occurred",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- }
- },
- "x-mint": {"metadata": {"title": "Update application"}},
- "description": "Modifies OAuth2 application configuration such as name, description, and redirect URIs. Does not rotate credentials.",
- "security": [{"sessionToken": []}],
+ }
+ },
+ "x-mint": {"metadata": {"title": "Get public application"}},
+ "description": "Retrieves public information about an OAuth2 application without authentication. Allows clients to discover application metadata before initiating authorization.",
"parameters": [
{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationUpdateRequest"}}}
- }
- },
- "delete": {
- "operationId": "delete_oauth_application",
- "summary": "Delete application",
+ ]
+ }
+ },
+ "/oauth2/authorize/consent": {
+ "post": {
+ "operationId": "provide_oauth2_consent",
+ "summary": "Grant OAuth2 consent",
"tags": ["OAuth2"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2ConsentResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -11118,40 +13012,29 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete application"}},
- "description": "Permanently deletes an OAuth2 application. Requires sudo mode authentication. Invalidates all issued tokens and revokes all user authorizations.",
+ "x-mint": {"metadata": {"title": "Grant OAuth2 consent"}},
+ "description": "User grants permission for an OAuth2 application to access authorized scopes. Used in authorization code flow to complete the authorization process after user review.",
"security": [{"sessionToken": []}],
- "parameters": [
- {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthorizeConsentRequest"}}}
}
}
},
- "/oauth2/applications/{id}/bot": {
- "patch": {
- "operationId": "update_bot_profile",
- "summary": "Update bot profile",
+ "/oauth2/introspect": {
+ "post": {
+ "operationId": "introspect_oauth2_token",
+ "summary": "Introspect OAuth2 token",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotProfileResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2IntrospectResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11192,40 +13075,28 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update bot profile"}},
- "description": "Modifies bot profile information such as name, avatar, and status. Changes apply to the bot account associated with this OAuth2 application.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ],
+ "x-mint": {"metadata": {"title": "Introspect OAuth2 token"}},
+ "description": "Verifies token validity and retrieves metadata. Returns active status, scope, expiration, and user information. Client authentication via authorization header or client credentials.",
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotProfileUpdateRequest"}}}
+ "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/IntrospectRequestForm"}}}
}
}
},
- "/oauth2/applications/{id}/bot/reset-token": {
+ "/oauth2/token": {
"post": {
- "operationId": "reset_bot_token",
- "summary": "Reset bot token",
+ "operationId": "exchange_oauth2_token",
+ "summary": "Exchange OAuth2 token",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BotTokenResetResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2TokenResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11266,40 +13137,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Reset bot token"}},
- "description": "Rotates the bot token for an OAuth2 application. Requires sudo mode authentication. Invalidates all previously issued bot tokens. Used for security rotation and compromise mitigation.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ],
+ "x-mint": {"metadata": {"title": "Exchange OAuth2 token"}},
+ "description": "Exchanges authorization code or other grant type for access tokens. Supports authorization code, refresh token, and client credentials flows. Client authentication via authorization header or client credentials.",
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/TokenRequest"}}}
}
}
},
- "/oauth2/applications/{id}/client-secret/reset": {
+ "/oauth2/token/revoke": {
"post": {
- "operationId": "reset_client_secret",
- "summary": "Reset client secret",
+ "operationId": "revoke_oauth2_token",
+ "summary": "Revoke OAuth2 token",
"tags": ["OAuth2"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11340,27 +13196,23 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Reset client secret"}},
- "description": "Rotates the client secret for an OAuth2 application. Requires sudo mode authentication. Essential security operation for protecting client credentials. Existing access tokens remain valid.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ],
+ "x-mint": {"metadata": {"title": "Revoke OAuth2 token"}},
+ "description": "Revokes an access or refresh token, immediately invalidating it. Client authentication required via authorization header or client credentials. Returns 200 on success.",
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SudoVerificationSchema"}}}
+ "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/RevokeRequestForm"}}}
}
}
},
- "/oauth2/applications/{id}/public": {
+ "/oauth2/userinfo": {
"get": {
- "operationId": "get_public_application",
- "summary": "Get public application",
+ "operationId": "get_oauth2_userinfo",
+ "summary": "Get OAuth2 user information",
"tags": ["OAuth2"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApplicationPublicResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2UserInfoResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -11406,23 +13258,18 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get public application"}},
- "description": "Retrieves public information about an OAuth2 application without authentication. Allows clients to discover application metadata before initiating authorization.",
- "parameters": [
- {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The id"}
- ]
+ "x-mint": {"metadata": {"title": "Get OAuth2 user information"}},
+ "description": "Retrieves authenticated user information using a valid access token. Requires identify scope and supports email scope for email fields.",
+ "security": [{"oauth2Token": ["identify"]}]
}
},
- "/oauth2/authorize/consent": {
+ "/premium/cancel-pending-subscription-change": {
"post": {
- "operationId": "provide_oauth2_consent",
- "summary": "Grant OAuth2 consent",
- "tags": ["OAuth2"],
+ "operationId": "cancel_pending_subscription_change",
+ "summary": "Cancel pending subscription billing cycle change",
+ "tags": ["Premium"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2ConsentResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -11475,29 +13322,30 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Grant OAuth2 consent"}},
- "description": "User grants permission for an OAuth2 application to access authorized scopes. Used in authorization code flow to complete the authorization process after user review.",
- "security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuthorizeConsentRequest"}}}
- }
+ "x-mint": {"metadata": {"title": "Cancel pending subscription billing cycle change"}},
+ "description": "Cancels the authenticated user's pending premium billing cycle change without cancelling the active subscription.",
+ "security": [{"sessionToken": []}]
}
},
- "/oauth2/introspect": {
+ "/premium/cancel-subscription": {
"post": {
- "operationId": "introspect_oauth2_token",
- "summary": "Introspect OAuth2 token",
- "tags": ["OAuth2"],
+ "operationId": "cancel_subscription",
+ "summary": "Cancel subscription",
+ "tags": ["Premium"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2IntrospectResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11538,28 +13386,30 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Introspect OAuth2 token"}},
- "description": "Verifies token validity and retrieves metadata. Returns active status, scope, expiration, and user information. Client authentication via authorization header or client credentials.",
- "requestBody": {
- "required": true,
- "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/IntrospectRequestForm"}}}
- }
+ "x-mint": {"metadata": {"title": "Cancel subscription"}},
+ "description": "Cancels the authenticated user's premium subscription at the end of the current billing period.",
+ "security": [{"sessionToken": []}]
}
},
- "/oauth2/token": {
+ "/premium/change-subscription": {
"post": {
- "operationId": "exchange_oauth2_token",
- "summary": "Exchange OAuth2 token",
- "tags": ["OAuth2"],
+ "operationId": "change_subscription_billing_cycle",
+ "summary": "Change subscription billing cycle",
+ "tags": ["Premium"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2TokenResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11600,25 +13450,39 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Exchange OAuth2 token"}},
- "description": "Exchanges authorization code or other grant type for access tokens. Supports authorization code, refresh token, and client credentials flows. Client authentication via authorization header or client credentials.",
+ "x-mint": {"metadata": {"title": "Change subscription billing cycle"}},
+ "description": "Switches the authenticated user between monthly and yearly billing for their active premium subscription.",
+ "security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/TokenRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangeSubscriptionRequest"}}}
}
}
},
- "/oauth2/token/revoke": {
- "post": {
- "operationId": "revoke_oauth2_token",
- "summary": "Revoke OAuth2 token",
- "tags": ["OAuth2"],
+ "/premium/current-subscription-price": {
+ "get": {
+ "operationId": "get_current_subscription_price",
+ "summary": "Get current subscription price",
+ "tags": ["Premium"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/CurrentSubscriptionPriceResponse"}}
+ }
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11659,28 +13523,33 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Revoke OAuth2 token"}},
- "description": "Revokes an access or refresh token, immediately invalidating it. Client authentication required via authorization header or client credentials. Returns 200 on success.",
- "requestBody": {
- "required": true,
- "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/RevokeRequestForm"}}}
- }
+ "x-mint": {"metadata": {"title": "Get current subscription price"}},
+ "description": "Returns the exact price the authenticated user is being billed for their active Stripe subscription, including whether they are on a grandfathered legacy rate.",
+ "security": [{"sessionToken": []}]
}
},
- "/oauth2/userinfo": {
- "get": {
- "operationId": "get_oauth2_userinfo",
- "summary": "Get OAuth2 user information",
- "tags": ["OAuth2"],
+ "/premium/customer-portal": {
+ "post": {
+ "operationId": "create_customer_portal",
+ "summary": "Create customer portal",
+ "tags": ["Premium"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuth2UserInfoResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11721,18 +13590,21 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get OAuth2 user information"}},
- "description": "Retrieves authenticated user information using a valid access token. Requires identify scope and supports email scope for email fields.",
- "security": [{"oauth2Token": ["identify"]}]
+ "x-mint": {"metadata": {"title": "Create customer portal"}},
+ "description": "Creates a session URL for the authenticated user to manage their Stripe subscription via the customer portal.",
+ "security": [{"sessionToken": []}]
}
},
- "/premium/cancel-pending-subscription-change": {
+ "/premium/grace/end": {
"post": {
- "operationId": "cancel_pending_subscription_change",
- "summary": "Cancel pending subscription billing cycle change",
+ "operationId": "end_premium_grace_period",
+ "summary": "End premium grace period now",
"tags": ["Premium"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -11785,18 +13657,21 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Cancel pending subscription billing cycle change"}},
- "description": "Cancels the authenticated user's pending premium billing cycle change without cancelling the active subscription.",
+ "x-mint": {"metadata": {"title": "End premium grace period now"}},
+ "description": "Ends the post-cancel grace period immediately, downgrading the user from premium and clearing premium_since. Idempotent and safe to call when not in grace; returns success in either case. Use this when the user explicitly opts out of the 3-day recovery window.",
"security": [{"sessionToken": []}]
}
},
- "/premium/cancel-subscription": {
- "post": {
- "operationId": "cancel_subscription",
- "summary": "Cancel subscription",
+ "/premium/perks-disabled": {
+ "patch": {
+ "operationId": "set_premium_perks_disabled",
+ "summary": "Set premium perks disabled",
"tags": ["Premium"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PremiumStateResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -11849,30 +13724,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Cancel subscription"}},
- "description": "Cancels the authenticated user's premium subscription at the end of the current billing period.",
- "security": [{"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Set premium perks disabled"}},
+ "description": "Temporarily disables or restores premium perks for the authenticated user while preserving actual subscription and billing state.",
+ "security": [{"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/UpdatePremiumPerksDisabledRequest"}}
+ }
+ }
}
},
- "/premium/change-subscription": {
- "post": {
- "operationId": "change_subscription_billing_cycle",
- "summary": "Change subscription billing cycle",
+ "/premium/price-ids": {
+ "get": {
+ "operationId": "get_price_ids",
+ "summary": "Get Stripe price IDs",
"tags": ["Premium"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PriceIdsResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -11913,27 +13789,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Change subscription billing cycle"}},
- "description": "Switches the authenticated user between monthly and yearly billing for their active premium subscription.",
- "security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangeSubscriptionRequest"}}}
- }
+ "x-mint": {"metadata": {"title": "Get Stripe price IDs"}},
+ "description": "Retrieves Stripe price IDs for premium subscriptions based on geographic location.",
+ "parameters": [
+ {
+ "name": "country_code",
+ "in": "query",
+ "required": false,
+ "schema": {"type": "string", "description": "Two-letter country code for regional pricing"}
+ },
+ {
+ "name": "pricing_mode",
+ "in": "query",
+ "required": false,
+ "schema": {"$ref": "#/components/schemas/PricingModeEnum"}
+ }
+ ]
}
},
- "/premium/current-subscription-price": {
- "get": {
- "operationId": "get_current_subscription_price",
- "summary": "Get current subscription price",
+ "/premium/reactivate-subscription": {
+ "post": {
+ "operationId": "reactivate_subscription",
+ "summary": "Reactivate subscription",
"tags": ["Premium"],
"responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/CurrentSubscriptionPriceResponse"}}
- }
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -11986,20 +13866,22 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get current subscription price"}},
- "description": "Returns the exact price the authenticated user is being billed for their active Stripe subscription, including whether they are on a grandfathered legacy rate.",
+ "x-mint": {"metadata": {"title": "Reactivate subscription"}},
+ "description": "Reactivates a previously cancelled premium subscription for the authenticated user.",
"security": [{"sessionToken": []}]
}
},
- "/premium/customer-portal": {
- "post": {
- "operationId": "create_customer_portal",
- "summary": "Create customer portal",
- "tags": ["Premium"],
+ "/premium/refund-eligibility": {
+ "get": {
+ "operationId": "get_self_serve_refund_eligibility",
+ "summary": "Get self-serve refund eligibility",
+ "tags": ["Billing"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/SelfServeRefundEligibilityResponse"}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -12053,20 +13935,20 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create customer portal"}},
- "description": "Creates a session URL for the authenticated user to manage their Stripe subscription via the customer portal.",
+ "x-mint": {"metadata": {"title": "Get self-serve refund eligibility"}},
+ "description": "Returns whether the authenticated user can self-serve refund their most recent purchase, including the refund window and cooldown timestamps.",
"security": [{"sessionToken": []}]
}
},
- "/premium/grace/end": {
+ "/premium/refund-latest": {
"post": {
- "operationId": "end_premium_grace_period",
- "summary": "End premium grace period now",
- "tags": ["Premium"],
+ "operationId": "self_serve_refund_latest_purchase",
+ "summary": "Refund latest purchase",
+ "tags": ["Billing"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SelfServeRefundResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -12120,15 +14002,15 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "End premium grace period now"}},
- "description": "Ends the post-cancel grace period immediately, downgrading the user from premium and clearing premium_since. Idempotent and safe to call when not in grace; returns success in either case. Use this when the user explicitly opts out of the 3-day recovery window.",
+ "x-mint": {"metadata": {"title": "Refund latest purchase"}},
+ "description": "Refunds the authenticated user's most recent paid invoice if it is within 3 days and the user is not in a 30-day cooldown. If the invoice was tied to a subscription, the subscription is cancelled immediately.",
"security": [{"sessionToken": []}]
}
},
- "/premium/perks-disabled": {
- "patch": {
- "operationId": "set_premium_perks_disabled",
- "summary": "Set premium perks disabled",
+ "/premium/state": {
+ "get": {
+ "operationId": "get_premium_state",
+ "summary": "Get premium state",
"tags": ["Premium"],
"responses": {
"200": {
@@ -12187,31 +14069,38 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Set premium perks disabled"}},
- "description": "Temporarily disables or restores premium perks for the authenticated user while preserving actual subscription and billing state.",
+ "x-mint": {"metadata": {"title": "Get premium state"}},
+ "description": "Returns the authenticated user actual premium entitlement, effective perk state, and mirrored billing data. When Stripe is enabled, missing payment-method mirror data may be repaired lazily.",
"security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/UpdatePremiumPerksDisabledRequest"}}
+ "parameters": [
+ {
+ "name": "country_code",
+ "in": "query",
+ "required": false,
+ "schema": {"type": "string", "description": "Two-letter country code for regional pricing"}
}
- }
+ ]
}
},
- "/premium/price-ids": {
- "get": {
- "operationId": "get_price_ids",
- "summary": "Get Stripe price IDs",
+ "/premium/visionary/rejoin": {
+ "post": {
+ "operationId": "rejoin_visionary_guild",
+ "summary": "Rejoin visionary guild",
"tags": ["Premium"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PriceIdsResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12252,31 +14141,21 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get Stripe price IDs"}},
- "description": "Retrieves Stripe price IDs for premium subscriptions based on geographic location.",
- "parameters": [
- {
- "name": "country_code",
- "in": "query",
- "required": false,
- "schema": {"type": "string", "description": "Two-letter country code for regional pricing"}
- },
- {
- "name": "pricing_mode",
- "in": "query",
- "required": false,
- "schema": {"$ref": "#/components/schemas/PricingModeEnum"}
- }
- ]
+ "x-mint": {"metadata": {"title": "Rejoin visionary guild"}},
+ "description": "Adds the authenticated user back to the visionary community guild after premium re-subscription.",
+ "security": [{"sessionToken": []}]
}
},
- "/premium/reactivate-subscription": {
+ "/read-states/ack": {
"post": {
- "operationId": "reactivate_subscription",
- "summary": "Reactivate subscription",
- "tags": ["Premium"],
+ "operationId": "ack_read_states",
+ "summary": "Acknowledge read states",
+ "tags": ["Read States"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -12329,23 +14208,22 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Reactivate subscription"}},
- "description": "Reactivates a previously cancelled premium subscription for the authenticated user.",
- "security": [{"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Acknowledge read states"}},
+ "description": "Applies one or more read-state acknowledgements and returns the authoritative read states after the write.",
+ "security": [{"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckRequest"}}}
+ }
}
},
- "/premium/refund-eligibility": {
- "get": {
- "operationId": "get_self_serve_refund_eligibility",
- "summary": "Get self-serve refund eligibility",
- "tags": ["Billing"],
- "responses": {
- "200": {
- "description": "Success",
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/SelfServeRefundEligibilityResponse"}}
- }
- },
+ "/read-states/ack-bulk": {
+ "post": {
+ "operationId": "ack_bulk_messages",
+ "summary": "Mark channels as read",
+ "tags": ["Read States"],
+ "responses": {
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -12398,33 +14276,29 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get self-serve refund eligibility"}},
- "description": "Returns whether the authenticated user can self-serve refund their most recent purchase, including the refund window and cooldown timestamps.",
- "security": [{"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Mark channels as read"}},
+ "description": "Marks multiple channels as read for the authenticated user in bulk.",
+ "security": [{"sessionToken": []}],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckBulkRequest"}}}
+ }
}
},
- "/premium/refund-latest": {
+ "/reports/dsa": {
"post": {
- "operationId": "self_serve_refund_latest_purchase",
- "summary": "Refund latest purchase",
- "tags": ["Billing"],
+ "operationId": "create_dsa_report",
+ "summary": "Create DSA report",
+ "tags": ["Reports"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SelfServeRefundResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12465,33 +14339,28 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Refund latest purchase"}},
- "description": "Refunds the authenticated user's most recent paid invoice if it is within 3 days and the user is not in a 30-day cooldown. If the invoice was tied to a subscription, the subscription is cancelled immediately.",
- "security": [{"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Create DSA report"}},
+ "description": "Creates a DSA complaint report with verified email for Digital Services Act compliance.",
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportRequest"}}}
+ }
}
},
- "/premium/state": {
- "get": {
- "operationId": "get_premium_state",
- "summary": "Get premium state",
- "tags": ["Premium"],
+ "/reports/dsa/email/send": {
+ "post": {
+ "operationId": "send_dsa_report_email",
+ "summary": "Send DSA report email",
+ "tags": ["Reports"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PremiumStateResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OkResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12532,38 +14401,28 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get premium state"}},
- "description": "Returns the authenticated user actual premium entitlement, effective perk state, and mirrored billing data. When Stripe is enabled, missing payment-method mirror data may be repaired lazily.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "country_code",
- "in": "query",
- "required": false,
- "schema": {"type": "string", "description": "Two-letter country code for regional pricing"}
- }
- ]
+ "x-mint": {"metadata": {"title": "Send DSA report email"}},
+ "description": "Initiates DSA (Digital Services Act) report submission by sending verification email to reporter.",
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportEmailSendRequest"}}}
+ }
}
},
- "/premium/visionary/rejoin": {
+ "/reports/dsa/email/verify": {
"post": {
- "operationId": "rejoin_visionary_guild",
- "summary": "Rejoin visionary guild",
- "tags": ["Premium"],
+ "operationId": "verify_dsa_report_email",
+ "summary": "Verify DSA report email",
+ "tags": ["Reports"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TicketResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12604,20 +14463,23 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Rejoin visionary guild"}},
- "description": "Adds the authenticated user back to the visionary community guild after premium re-subscription.",
- "security": [{"sessionToken": []}]
+ "x-mint": {"metadata": {"title": "Verify DSA report email"}},
+ "description": "Verifies the DSA report email and creates a report ticket for legal compliance.",
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportEmailVerifyRequest"}}}
+ }
}
},
- "/read-states/ack": {
+ "/reports/guild": {
"post": {
- "operationId": "ack_read_states",
- "summary": "Acknowledge read states",
- "tags": ["Read States"],
+ "operationId": "report_guild",
+ "summary": "Report guild",
+ "tags": ["Reports"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -12671,22 +14533,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Acknowledge read states"}},
- "description": "Applies one or more read-state acknowledgements and returns the authoritative read states after the write.",
+ "x-mint": {"metadata": {"title": "Report guild"}},
+ "description": "Submits a report about a guild to moderators for policy violation review.",
"security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportGuildRequest"}}}
}
}
},
- "/read-states/ack-bulk": {
+ "/reports/message": {
"post": {
- "operationId": "ack_bulk_messages",
- "summary": "Mark channels as read",
- "tags": ["Read States"],
+ "operationId": "report_message",
+ "summary": "Report message",
+ "tags": ["Reports"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -12739,19 +14604,19 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Mark channels as read"}},
- "description": "Marks multiple channels as read for the authenticated user in bulk.",
+ "x-mint": {"metadata": {"title": "Report message"}},
+ "description": "Submits a report about a message to moderators for content violation review. The reporter must be able to access the channel and target message.",
"security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReadStateAckBulkRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportMessageRequest"}}}
}
}
},
- "/reports/dsa": {
+ "/reports/user": {
"post": {
- "operationId": "create_dsa_report",
- "summary": "Create DSA report",
+ "operationId": "report_user",
+ "summary": "Report user",
"tags": ["Reports"],
"responses": {
"200": {
@@ -12762,6 +14627,14 @@
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12802,28 +14675,37 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create DSA report"}},
- "description": "Creates a DSA complaint report with verified email for Digital Services Act compliance.",
+ "x-mint": {"metadata": {"title": "Report user"}},
+ "description": "Submits a report about a user to moderators for content violation or behaviour review.",
+ "security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportUserRequest"}}}
}
}
},
- "/reports/dsa/email/send": {
+ "/search/messages": {
"post": {
- "operationId": "send_dsa_report_email",
- "summary": "Send DSA report email",
- "tags": ["Reports"],
+ "operationId": "search_messages",
+ "summary": "Search messages",
+ "tags": ["Search"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OkResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageSearchResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12864,28 +14746,37 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Send DSA report email"}},
- "description": "Initiates DSA (Digital Services Act) report submission by sending verification email to reporter.",
+ "x-mint": {"metadata": {"title": "Search messages"}},
+ "description": "Searches for messages across guilds and channels accessible to the authenticated user. Bots must supply a context guild or channel and may only use the current scope.",
+ "security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportEmailSendRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GlobalSearchMessagesRequest"}}}
}
}
},
- "/reports/dsa/email/verify": {
- "post": {
- "operationId": "verify_dsa_report_email",
- "summary": "Verify DSA report email",
- "tags": ["Reports"],
+ "/stickers/{sticker_id}/metadata": {
+ "get": {
+ "operationId": "get_sticker_metadata",
+ "summary": "Get sticker metadata",
+ "tags": ["Stickers"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TicketResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerMetadataResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -12926,24 +14817,27 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Verify DSA report email"}},
- "description": "Verifies the DSA report email and creates a report ticket for legal compliance.",
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DsaReportEmailVerifyRequest"}}}
- }
+ "x-mint": {"metadata": {"title": "Get sticker metadata"}},
+ "description": "Lookup minimal metadata for a custom sticker by id, including whether the source guild allows the in-app one-click clone shortcut. Does not require membership in the source guild.",
+ "security": [{"botToken": []}, {"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "sticker_id",
+ "in": "path",
+ "required": true,
+ "schema": {"$ref": "#/components/schemas/SnowflakeType"},
+ "description": "The ID of the sticker"
+ }
+ ]
}
},
- "/reports/guild": {
- "post": {
- "operationId": "report_guild",
- "summary": "Report guild",
- "tags": ["Reports"],
+ "/streams/{stream_key}/preview": {
+ "get": {
+ "operationId": "get_stream_preview",
+ "summary": "Get stream preview image",
+ "tags": ["Channels"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -12996,25 +14890,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Report guild"}},
- "description": "Submits a report about a guild to moderators for policy violation review.",
+ "x-mint": {"metadata": {"title": "Get stream preview image"}},
+ "description": "Retrieves the current preview thumbnail for a stream. Returns the image with no-store cache headers to ensure freshness.",
"security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportGuildRequest"}}}
- }
- }
- },
- "/reports/message": {
+ "parameters": [
+ {
+ "name": "stream_key",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The stream key"
+ }
+ ]
+ },
"post": {
- "operationId": "report_message",
- "summary": "Report message",
- "tags": ["Reports"],
+ "operationId": "upload_stream_preview",
+ "summary": "Upload stream preview image",
+ "tags": ["Channels"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13067,25 +14961,29 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Report message"}},
- "description": "Submits a report about a message to moderators for content violation review. The reporter must be able to access the channel and target message.",
+ "x-mint": {"metadata": {"title": "Upload stream preview image"}},
+ "description": "Uploads a custom thumbnail image for the stream. The image is scanned for content policy violations and stored securely.",
"security": [{"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "stream_key",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The stream key"
+ }
+ ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportMessageRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadBodySchema"}}}
}
- }
- },
- "/reports/user": {
- "post": {
- "operationId": "report_user",
- "summary": "Report user",
- "tags": ["Reports"],
+ },
+ "delete": {
+ "operationId": "delete_stream_preview",
+ "summary": "Delete stream preview image",
+ "tags": ["Channels"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13138,24 +15036,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Report user"}},
- "description": "Submits a report about a user to moderators for content violation or behaviour review.",
+ "x-mint": {"metadata": {"title": "Delete stream preview image"}},
+ "description": "Removes the thumbnail preview for a stream. Used when the owner opts into \"hide preview\" so viewers no longer see a stale thumbnail.",
"security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportUserRequest"}}}
- }
+ "parameters": [
+ {
+ "name": "stream_key",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The stream key"
+ }
+ ]
}
},
- "/search/messages": {
+ "/streams/{stream_key}/preview/upload-url": {
"post": {
- "operationId": "search_messages",
- "summary": "Search messages",
- "tags": ["Search"],
+ "operationId": "create_stream_preview_upload_url",
+ "summary": "Create stream preview upload URL",
+ "tags": ["Channels"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageSearchResponse"}}}
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadUrlResponseSchema"}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -13209,25 +15114,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Search messages"}},
- "description": "Searches for messages across guilds and channels accessible to the authenticated user. Bots must supply a context guild or channel and may only use the current scope.",
+ "x-mint": {"metadata": {"title": "Create stream preview upload URL"}},
+ "description": "Creates a reusable PUT upload URL for updating the current thumbnail image for the stream.",
"security": [{"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "stream_key",
+ "in": "path",
+ "required": true,
+ "schema": {"type": "string"},
+ "description": "The stream key"
+ }
+ ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GlobalSearchMessagesRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadUrlBodySchema"}}}
}
}
},
- "/stickers/{sticker_id}/metadata": {
- "get": {
- "operationId": "get_sticker_metadata",
- "summary": "Get sticker metadata",
- "tags": ["Stickers"],
+ "/streams/{stream_key}/stream": {
+ "patch": {
+ "operationId": "update_stream_region",
+ "summary": "Update stream region",
+ "tags": ["Channels"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GuildStickerMetadataResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13280,27 +15191,34 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get sticker metadata"}},
- "description": "Lookup minimal metadata for a custom sticker by id, including whether the source guild allows the in-app one-click clone shortcut. Does not require membership in the source guild.",
- "security": [{"botToken": []}, {"sessionToken": []}],
+ "x-mint": {"metadata": {"title": "Update stream region"}},
+ "description": "Changes the media server region for an active stream. Used to optimise bandwidth and latency for streaming.",
+ "security": [{"sessionToken": []}],
"parameters": [
{
- "name": "sticker_id",
+ "name": "stream_key",
"in": "path",
"required": true,
- "schema": {"$ref": "#/components/schemas/SnowflakeType"},
- "description": "The ID of the sticker"
+ "schema": {"type": "string"},
+ "description": "The stream key"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamUpdateBodySchema"}}}
+ }
}
},
- "/streams/{stream_key}/preview": {
- "get": {
- "operationId": "get_stream_preview",
- "summary": "Get stream preview image",
- "tags": ["Channels"],
+ "/stripe/checkout/gift": {
+ "post": {
+ "operationId": "create_gift_checkout_session",
+ "summary": "Create gift checkout session",
+ "tags": ["Billing"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13353,25 +15271,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Get stream preview image"}},
- "description": "Retrieves the current preview thumbnail for a stream. Returns the image with no-store cache headers to ensure freshness.",
+ "x-mint": {"metadata": {"title": "Create gift checkout session"}},
+ "description": "Creates a checkout session for purchasing premium gifts to send to other users.",
"security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "stream_key",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The stream key"
- }
- ]
- },
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
+ }
+ }
+ },
+ "/stripe/checkout/subscription": {
"post": {
- "operationId": "upload_stream_preview",
- "summary": "Upload stream preview image",
- "tags": ["Channels"],
+ "operationId": "create_checkout_session",
+ "summary": "Create checkout session",
+ "tags": ["Billing"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13424,29 +15342,25 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Upload stream preview image"}},
- "description": "Uploads a custom thumbnail image for the stream. The image is scanned for content policy violations and stored securely.",
+ "x-mint": {"metadata": {"title": "Create checkout session"}},
+ "description": "Initiates a Stripe checkout session for user subscription purchases.",
"security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "stream_key",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The stream key"
- }
- ],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadBodySchema"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
}
- },
- "delete": {
- "operationId": "delete_stream_preview",
- "summary": "Delete stream preview image",
- "tags": ["Channels"],
+ }
+ },
+ "/stripe/checkout/subscription/preapproval": {
+ "post": {
+ "operationId": "create_localized_card_preapproval_session",
+ "summary": "Create localized card preapproval session",
+ "tags": ["Billing"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13499,44 +15413,31 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Delete stream preview image"}},
- "description": "Removes the thumbnail preview for a stream. Used when the owner opts into \"hide preview\" so viewers no longer see a stale thumbnail.",
+ "x-mint": {"metadata": {"title": "Create localized card preapproval session"}},
+ "description": "Initiates a Stripe Checkout setup-mode session to preapprove a local card before continuing to paid localized checkout.",
"security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "stream_key",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The stream key"
- }
- ]
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
+ }
}
},
- "/streams/{stream_key}/preview/upload-url": {
+ "/stripe/checkout/subscription/preapproval/continue": {
"post": {
- "operationId": "create_stream_preview_upload_url",
- "summary": "Create stream preview upload URL",
- "tags": ["Channels"],
+ "operationId": "continue_localized_card_preapproval_session",
+ "summary": "Continue localized card preapproval session",
+ "tags": ["Billing"],
"responses": {
"200": {
"description": "Success",
"content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadUrlResponseSchema"}}
+ "application/json": {"schema": {"$ref": "#/components/schemas/LocalizedCardPreapprovalContinueResponse"}}
}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -13571,49 +15472,36 @@
"schema": {"type": "integer"}
}
}
- },
- "500": {
- "description": "Internal Server Error - An unexpected error occurred",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- }
- },
- "x-mint": {"metadata": {"title": "Create stream preview upload URL"}},
- "description": "Creates a reusable PUT upload URL for updating the current thumbnail image for the stream.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "stream_key",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The stream key"
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
- ],
+ },
+ "x-mint": {"metadata": {"title": "Continue localized card preapproval session"}},
+ "description": "Checks the status of a localized card preapproval flow and returns the paid Stripe Checkout URL when it is ready.",
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamPreviewUploadUrlBodySchema"}}}
+ "content": {
+ "application/json": {"schema": {"$ref": "#/components/schemas/LocalizedCardPreapprovalContinueRequest"}}
+ }
}
}
},
- "/streams/{stream_key}/stream": {
- "patch": {
- "operationId": "update_stream_region",
- "summary": "Update stream region",
- "tags": ["Channels"],
+ "/stripe/webhook": {
+ "post": {
+ "operationId": "process_stripe_webhook",
+ "summary": "Process Stripe webhook",
+ "tags": ["Billing"],
"responses": {
- "204": {"description": "No Content"},
+ "200": {
+ "description": "Success",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookReceivedResponse"}}}
+ },
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
- "401": {
- "description": "Unauthorized - Authentication is required or the token is invalid",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
- "403": {
- "description": "Forbidden - You do not have permission to perform this action",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
- },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -13654,33 +15542,19 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Update stream region"}},
- "description": "Changes the media server region for an active stream. Used to optimise bandwidth and latency for streaming.",
- "security": [{"sessionToken": []}],
- "parameters": [
- {
- "name": "stream_key",
- "in": "path",
- "required": true,
- "schema": {"type": "string"},
- "description": "The stream key"
- }
- ],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StreamUpdateBodySchema"}}}
- }
+ "x-mint": {"metadata": {"title": "Process Stripe webhook"}},
+ "description": "Handles incoming Stripe webhook events for payment processing and subscription management."
}
},
- "/stripe/checkout/gift": {
- "post": {
- "operationId": "create_gift_checkout_session",
- "summary": "Create gift checkout session",
- "tags": ["Billing"],
+ "/tenor/featured": {
+ "get": {
+ "operationId": "get_featured_tenor",
+ "summary": "Get featured GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifFeaturedResponse"}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -13734,25 +15608,21 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create gift checkout session"}},
- "description": "Creates a checkout session for purchasing premium gifts to send to other users.",
+ "x-mint": {"metadata": {"title": "Get featured GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/featured.",
"security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
- }
+ "parameters": [
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
}
},
- "/stripe/checkout/subscription": {
+ "/tenor/register-share": {
"post": {
- "operationId": "create_checkout_session",
- "summary": "Create checkout session",
- "tags": ["Billing"],
+ "operationId": "register_tenor_share",
+ "summary": "Register a GIF share (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
- "200": {
- "description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
- },
+ "204": {"description": "No Content"},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
@@ -13805,24 +15675,26 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create checkout session"}},
- "description": "Initiates a Stripe checkout session for user subscription purchases.",
+ "x-mint": {"metadata": {"title": "Register a GIF share (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/register-share.",
"security": [{"sessionToken": []}],
"requestBody": {
"required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GifRegisterShareRequest"}}}
}
}
},
- "/stripe/checkout/subscription/preapproval": {
- "post": {
- "operationId": "create_localized_card_preapproval_session",
- "summary": "Create localized card preapproval session",
- "tags": ["Billing"],
+ "/tenor/search": {
+ "get": {
+ "operationId": "search_tenor",
+ "summary": "Search GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UrlResponse"}}}
+ "content": {
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
@@ -13876,31 +15748,42 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Create localized card preapproval session"}},
- "description": "Initiates a Stripe Checkout setup-mode session to preapprove a local card before continuing to paid localized checkout.",
+ "x-mint": {"metadata": {"title": "Search GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/search.",
"security": [{"sessionToken": []}],
- "requestBody": {
- "required": true,
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateCheckoutSessionRequest"}}}
- }
+ "parameters": [
+ {
+ "name": "q",
+ "in": "query",
+ "required": true,
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
}
},
- "/stripe/checkout/subscription/preapproval/continue": {
- "post": {
- "operationId": "continue_localized_card_preapproval_session",
- "summary": "Continue localized card preapproval session",
- "tags": ["Billing"],
+ "/tenor/suggest": {
+ "get": {
+ "operationId": "get_tenor_search_suggestions",
+ "summary": "Get GIF search suggestions (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/LocalizedCardPreapprovalContinueResponse"}}
- }
+ "content": {"application/json": {"schema": {"type": "array", "items": {"type": "string"}}}}
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -13941,30 +15824,44 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Continue localized card preapproval session"}},
- "description": "Checks the status of a localized card preapproval flow and returns the paid Stripe Checkout URL when it is ready.",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {"schema": {"$ref": "#/components/schemas/LocalizedCardPreapprovalContinueRequest"}}
- }
- }
+ "x-mint": {"metadata": {"title": "Get GIF search suggestions (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/suggest.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {
+ "name": "q",
+ "in": "query",
+ "required": true,
+ "schema": {"type": "string", "description": "The search query"}
+ },
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
}
},
- "/stripe/webhook": {
- "post": {
- "operationId": "process_stripe_webhook",
- "summary": "Process Stripe webhook",
- "tags": ["Billing"],
+ "/tenor/trending-gifs": {
+ "get": {
+ "operationId": "get_trending_tenor",
+ "summary": "Get trending GIFs (deprecated alias)",
+ "tags": ["GIFs (Deprecated)"],
"responses": {
"200": {
"description": "Success",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookReceivedResponse"}}}
+ "content": {
+ "application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/GifResponse"}}}
+ }
},
"400": {
"description": "Bad Request - The request was malformed or contained invalid data",
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
},
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
"429": {
"description": "Too Many Requests - You are being rate limited",
"content": {
@@ -14005,8 +15902,12 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "x-mint": {"metadata": {"title": "Process Stripe webhook"}},
- "description": "Handles incoming Stripe webhook events for payment processing and subscription management."
+ "x-mint": {"metadata": {"title": "Get trending GIFs (deprecated alias)"}},
+ "description": "Use /gifs/* instead - these vendor-specific paths are deprecated and will be removed. Routes to the active provider; identical behaviour to /gifs/trending.",
+ "security": [{"sessionToken": []}],
+ "parameters": [
+ {"name": "locale", "in": "query", "required": false, "schema": {"$ref": "#/components/schemas/Locale"}}
+ ]
}
},
"/unfurl": {
@@ -27658,6 +29559,49 @@
},
"required": ["guilds", "total", "category_counts"]
},
+ "VersionInfoResponse": {
+ "type": "object",
+ "properties": {
+ "version": {"type": "string", "description": "Semantic version string (e.g., 1.0.0)"},
+ "pub_date": {"type": "string", "description": "ISO 8601 date when this version was published"},
+ "minimum_system_version": {
+ "anyOf": [{"type": "string"}, {"type": "null"}],
+ "description": "Minimum operating system version required by this release, when applicable"
+ },
+ "files": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "properties": {
+ "url": {"type": "string", "description": "Download URL for this file"},
+ "sha256": {
+ "anyOf": [{"type": "string"}, {"type": "null"}],
+ "description": "SHA-256 hash of the file for verification"
+ },
+ "checksum_url": {
+ "anyOf": [{"type": "string"}, {"type": "null"}],
+ "description": "Plain text .sha256 checksum file URL for this file"
+ }
+ },
+ "required": ["url", "sha256", "checksum_url"]
+ },
+ "description": "Map of package format to download files"
+ }
+ },
+ "required": ["version", "pub_date", "files"]
+ },
+ "DesktopVersionsResponse": {
+ "type": "object",
+ "properties": {
+ "versions": {
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/VersionInfoResponse"},
+ "description": "Array of available versions"
+ },
+ "has_more": {"type": "boolean", "description": "Whether more versions are available to fetch"}
+ },
+ "required": ["versions", "has_more"]
+ },
"DonationCheckoutResponse": {
"type": "object",
"properties": {
@@ -27726,38 +29670,245 @@
"description": "Whether the source guild allows non-members to use the in-app clone shortcut"
}
},
- "required": ["id", "guild_id", "name", "animated", "allow_cloning"]
+ "required": ["id", "guild_id", "name", "animated", "allow_cloning"]
+ },
+ "GatewayBotResponse": {
+ "type": "object",
+ "properties": {
+ "url": {"type": "string", "description": "WebSocket URL to connect to the gateway"},
+ "shards": {
+ "type": "integer",
+ "format": "int53",
+ "description": "Recommended number of shards to use when connecting"
+ },
+ "session_start_limit": {
+ "type": "object",
+ "properties": {
+ "total": {"type": "integer", "format": "int53", "description": "Total number of session starts allowed"},
+ "remaining": {"type": "integer", "format": "int53", "description": "Remaining number of session starts"},
+ "reset_after": {
+ "type": "integer",
+ "format": "int53",
+ "description": "Milliseconds until the limit resets"
+ },
+ "max_concurrency": {
+ "type": "integer",
+ "format": "int53",
+ "description": "Maximum number of concurrent IDENTIFY requests"
+ }
+ },
+ "required": ["total", "remaining", "reset_after", "max_concurrency"],
+ "description": "Session start rate limit information"
+ }
+ },
+ "required": ["url", "shards", "session_start_limit"]
+ },
+ "GifFeaturedResponse": {
+ "type": "object",
+ "properties": {
+ "gifs": {
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/GifResponse"},
+ "description": "Array of featured GIFs."
+ },
+ "categories": {
+ "type": "array",
+ "items": {"$ref": "#/components/schemas/GifCategoryTagResponse"},
+ "description": "Array of GIF categories."
+ }
+ },
+ "required": ["gifs", "categories"]
+ },
+ "GifResponse": {
+ "type": "object",
+ "properties": {
+ "id": {"type": "string", "description": "Provider-stable identifier for this GIF."},
+ "slug": {
+ "type": "string",
+ "description": "Canonical slug (or slug-id token) used to share / re-resolve this GIF."
+ },
+ "provider": {"type": "string", "description": "Name of the provider that produced this GIF."},
+ "title": {"type": "string", "description": "Title or description of the GIF."},
+ "url": {"type": "string", "description": "Provider page URL for the GIF."},
+ "src": {
+ "type": "string",
+ "description": "Direct URL to the GIF media file (best format chosen by the server)."
+ },
+ "proxy_src": {
+ "type": "string",
+ "description": "Proxied URL to the GIF media file (best format chosen by the server)."
+ },
+ "width": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 2147483647,
+ "format": "int32",
+ "description": "Width of the GIF in pixels (best format)."
+ },
+ "height": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 2147483647,
+ "format": "int32",
+ "description": "Height of the GIF in pixels (best format)."
+ },
+ "media": {
+ "type": "object",
+ "additionalProperties": {"$ref": "#/components/schemas/GifMediaFormat"},
+ "description": "Map of format-name → media descriptor. Keys are a size prefix (none for full size, \"medium\", \"tiny\", \"nano\") joined to a codec name (\"webm\", \"mp4\", \"webp\", \"gif\"), plus \"loopedmp4\". Video keys are \"webm\" / \"mp4\" / \"loopedmp4\" / \"mediumwebm\" / \"mediummp4\" / \"tinywebm\" / \"tinymp4\" / \"nanowebm\" / \"nanomp4\"; image keys are \"webp\" / \"gif\" / \"mediumwebp\" / \"mediumgif\" / \"tinywebp\" / \"tinygif\" / \"nanowebp\" / \"nanogif\". Every key is optional, so clients must walk a priority list rather than index a single key. Clients that cannot decode the video keys should prefer \"tinywebp\" / \"tinygif\" / \"mediumwebp\" / \"mediumgif\" / \"webp\" / \"gif\" / \"nanowebp\" / \"nanogif\" in that order."
+ },
+ "placeholder": {
+ "anyOf": [{"type": "string"}, {"type": "null"}],
+ "description": "Compact thumbhash placeholder produced by the media proxy. Clients render it as a low-res preview while the GIF loads, and persist it on favourites so the picker has a fallback if the source URL later disappears."
+ }
+ },
+ "required": ["id", "slug", "provider", "title", "url", "src", "proxy_src", "width", "height", "media"]
+ },
+ "GifCategoryTagResponse": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Category search term (locale-translated label suitable for display)."
+ },
+ "src": {
+ "type": "string",
+ "description": "Category preview image URL from the top GIF for this category search term."
+ },
+ "proxy_src": {
+ "type": "string",
+ "description": "Proxied category preview image URL from the top GIF for this category search term."
+ },
+ "gif": {
+ "anyOf": [{"$ref": "#/components/schemas/GifResponse"}, {"type": "null"}],
+ "description": "Enriched category preview GIF from the top search result for this category. Null only when no preview GIF was available."
+ }
+ },
+ "required": ["name", "src", "proxy_src", "gif"]
},
- "GatewayBotResponse": {
+ "Locale": {
+ "type": "string",
+ "enum": [
+ "ar",
+ "bg",
+ "cs",
+ "da",
+ "de",
+ "el",
+ "en-GB",
+ "en-US",
+ "es-ES",
+ "es-419",
+ "fi",
+ "fr",
+ "he",
+ "hi",
+ "hr",
+ "hu",
+ "id",
+ "it",
+ "ja",
+ "ko",
+ "lt",
+ "nl",
+ "no",
+ "pl",
+ "pt-BR",
+ "ro",
+ "ru",
+ "sv-SE",
+ "th",
+ "tr",
+ "uk",
+ "vi",
+ "zh-CN",
+ "zh-TW"
+ ],
+ "x-enumNames": [
+ "AR",
+ "BG",
+ "CS",
+ "DA",
+ "DE",
+ "EL",
+ "EN_GB",
+ "EN_US",
+ "ES_ES",
+ "ES_419",
+ "FI",
+ "FR",
+ "HE",
+ "HI",
+ "HR",
+ "HU",
+ "ID",
+ "IT",
+ "JA",
+ "KO",
+ "LT",
+ "NL",
+ "NO",
+ "PL",
+ "PT_BR",
+ "RO",
+ "RU",
+ "SV_SE",
+ "TH",
+ "TR",
+ "UK",
+ "VI",
+ "ZH_CN",
+ "ZH_TW"
+ ],
+ "x-enumDescriptions": [
+ "Arabic",
+ "Bulgarian",
+ "Czech",
+ "Danish",
+ "German",
+ "Greek",
+ "English (United Kingdom)",
+ "English (United States)",
+ "Spanish (Spain)",
+ "Spanish (Latin America)",
+ "Finnish",
+ "French",
+ "Hebrew",
+ "Hindi",
+ "Croatian",
+ "Hungarian",
+ "Indonesian",
+ "Italian",
+ "Japanese",
+ "Korean",
+ "Lithuanian",
+ "Dutch",
+ "Norwegian",
+ "Polish",
+ "Portuguese (Brazil)",
+ "Romanian",
+ "Russian",
+ "Swedish",
+ "Thai",
+ "Turkish",
+ "Ukrainian",
+ "Vietnamese",
+ "Chinese (Simplified)",
+ "Chinese (Traditional)"
+ ],
+ "description": "The locale code for the user interface language"
+ },
+ "GifRegisterShareRequest": {
"type": "object",
"properties": {
- "url": {"type": "string", "description": "WebSocket URL to connect to the gateway"},
- "shards": {
- "type": "integer",
- "format": "int53",
- "description": "Recommended number of shards to use when connecting"
+ "id": {"type": "string", "description": "Provider-issued share identifier (slug or slug-id token)."},
+ "q": {
+ "anyOf": [{"type": "string"}, {"type": "null"}],
+ "description": "Optional search query that produced the GIF."
},
- "session_start_limit": {
- "type": "object",
- "properties": {
- "total": {"type": "integer", "format": "int53", "description": "Total number of session starts allowed"},
- "remaining": {"type": "integer", "format": "int53", "description": "Remaining number of session starts"},
- "reset_after": {
- "type": "integer",
- "format": "int53",
- "description": "Milliseconds until the limit resets"
- },
- "max_concurrency": {
- "type": "integer",
- "format": "int53",
- "description": "Maximum number of concurrent IDENTIFY requests"
- }
- },
- "required": ["total", "remaining", "reset_after", "max_concurrency"],
- "description": "Session start rate limit information"
- }
+ "locale": {"$ref": "#/components/schemas/Locale"}
},
- "required": ["url", "shards", "session_start_limit"]
+ "required": ["id"]
},
"GiftCodeResponse": {
"type": "object",
@@ -34591,118 +36742,6 @@
"default_share_voice_activity"
]
},
- "Locale": {
- "type": "string",
- "enum": [
- "ar",
- "bg",
- "cs",
- "da",
- "de",
- "el",
- "en-GB",
- "en-US",
- "es-ES",
- "es-419",
- "fi",
- "fr",
- "he",
- "hi",
- "hr",
- "hu",
- "id",
- "it",
- "ja",
- "ko",
- "lt",
- "nl",
- "no",
- "pl",
- "pt-BR",
- "ro",
- "ru",
- "sv-SE",
- "th",
- "tr",
- "uk",
- "vi",
- "zh-CN",
- "zh-TW"
- ],
- "x-enumNames": [
- "AR",
- "BG",
- "CS",
- "DA",
- "DE",
- "EL",
- "EN_GB",
- "EN_US",
- "ES_ES",
- "ES_419",
- "FI",
- "FR",
- "HE",
- "HI",
- "HR",
- "HU",
- "ID",
- "IT",
- "JA",
- "KO",
- "LT",
- "NL",
- "NO",
- "PL",
- "PT_BR",
- "RO",
- "RU",
- "SV_SE",
- "TH",
- "TR",
- "UK",
- "VI",
- "ZH_CN",
- "ZH_TW"
- ],
- "x-enumDescriptions": [
- "Arabic",
- "Bulgarian",
- "Czech",
- "Danish",
- "German",
- "Greek",
- "English (United Kingdom)",
- "English (United States)",
- "Spanish (Spain)",
- "Spanish (Latin America)",
- "Finnish",
- "French",
- "Hebrew",
- "Hindi",
- "Croatian",
- "Hungarian",
- "Indonesian",
- "Italian",
- "Japanese",
- "Korean",
- "Lithuanian",
- "Dutch",
- "Norwegian",
- "Polish",
- "Portuguese (Brazil)",
- "Romanian",
- "Russian",
- "Swedish",
- "Thai",
- "Turkish",
- "Ukrainian",
- "Vietnamese",
- "Chinese (Simplified)",
- "Chinese (Traditional)"
- ],
- "description": "The locale code for the user interface language"
- },
"StickerAnimationOptions": {
"type": "integer",
"format": "int32",
@@ -36088,6 +38127,7 @@
{"name": "Read States", "description": "Message read state tracking"},
{"name": "Saved Media", "description": "User saved media management"},
{"name": "Themes", "description": "User interface themes"},
+ {"name": "Downloads", "description": "App downloads"},
{"name": "Reports", "description": "Content reporting"},
{"name": "Instance", "description": "Instance configuration and info"},
{"name": "Billing", "description": "Subscription and payment management via Stripe"},
@@ -36097,6 +38137,8 @@
{"name": "Messages"},
{"name": "Donations"},
{"name": "Geolocation"},
+ {"name": "GIFs"},
+ {"name": "GIFs (Deprecated)"},
{"name": "Discovery"},
{"name": "Emojis"},
{"name": "Stickers"},
diff --git a/packages/openapi/package.json b/packages/openapi/package.json
index 49d4a4c9b..87aa6ee20 100644
--- a/packages/openapi/package.json
+++ b/packages/openapi/package.json
@@ -8,6 +8,7 @@
},
"scripts": {
"generate": "tsx src/scripts/GenerateSpec.ts",
+ "test": "vitest run",
"typecheck": "tsgo --noEmit",
"validate": "tsx src/scripts/GenerateSpec.ts --validate-only"
},
@@ -21,6 +22,8 @@
"@types/node": "catalog:",
"@typescript/native-preview": "catalog:",
"prettier": "^3.8.3",
- "tsx": "catalog:"
+ "tsx": "catalog:",
+ "vite-tsconfig-paths": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/openapi/src/OpenAPIGenerationTypes.ts b/packages/openapi/src/OpenAPIGenerationTypes.ts
index 2f4af12f5..d4022ebd8 100644
--- a/packages/openapi/src/OpenAPIGenerationTypes.ts
+++ b/packages/openapi/src/OpenAPIGenerationTypes.ts
@@ -9,11 +9,19 @@ export interface OpenAPIGeneratorOptions {
readonly serverUrl?: string;
readonly routeScope?: OpenAPIRouteScope;
}
+export interface SkippedRoute {
+ readonly method: string;
+ readonly path: string;
+ readonly source: string;
+ readonly reason: string;
+}
export interface OpenAPIGenerationStats {
readonly controllerCount: number;
readonly routeCount: number;
readonly operationCount: number;
readonly skippedRouteCount: number;
+ readonly skippedRoutes: ReadonlyArray<SkippedRoute>;
+ readonly untemplatableRoutes: ReadonlyArray<SkippedRoute>;
readonly registeredSchemaCount: number;
readonly publishedSchemaCount: number;
readonly tagCount: number;
diff --git a/packages/openapi/src/OpenAPIGenerator.ts b/packages/openapi/src/OpenAPIGenerator.ts
index e48414c04..71c5fd319 100644
--- a/packages/openapi/src/OpenAPIGenerator.ts
+++ b/packages/openapi/src/OpenAPIGenerator.ts
@@ -8,6 +8,7 @@ import type {
OpenAPIGenerationResult,
OpenAPIGeneratorOptions,
OpenAPIRouteScope,
+ SkippedRoute,
} from '@fluxer/openapi/src/OpenAPIGenerationTypes';
import type {ExtractedRoute, OpenAPIDocument, OpenAPIPathItem, OpenAPISchema} from '@fluxer/openapi/src/OpenAPITypes';
import {convertPathToOpenAPI} from '@fluxer/openapi/src/registry/ParameterRegistry';
@@ -16,7 +17,11 @@ import {SchemaRegistry} from '@fluxer/openapi/src/registry/SchemaRegistry';
interface PathBuildResult {
readonly paths: Record<string, OpenAPIPathItem>;
readonly operationCount: number;
- readonly skippedRouteCount: number;
+ readonly skippedRoutes: ReadonlyArray<SkippedRoute>;
+ readonly untemplatableRoutes: ReadonlyArray<SkippedRoute>;
+}
+function hasOpenAPIPathTemplate(routePath: string): boolean {
+ return !routePath.includes('*') && !routePath.includes('{');
}
interface GeneratorSettings {
readonly basePath: string;
@@ -36,6 +41,14 @@ function createGeneratorSettings(options: OpenAPIGeneratorOptions): GeneratorSet
routeScope: options.routeScope ?? 'public',
};
}
+function describeRoute(route: ExtractedRoute, reason: string): SkippedRoute {
+ return {
+ method: route.method.toUpperCase(),
+ path: route.path,
+ source: `${route.controllerFile}:${route.lineNumber.toString()}`,
+ reason,
+ };
+}
function isAdminRoute(route: ExtractedRoute): boolean {
return route.path === '/admin' || route.path.startsWith('/admin/');
}
@@ -102,7 +115,9 @@ export class OpenAPIGenerator {
controllerCount: controllerFiles.length,
routeCount: routes.length,
operationCount: pathBuildResult.operationCount,
- skippedRouteCount: pathBuildResult.skippedRouteCount,
+ skippedRouteCount: pathBuildResult.skippedRoutes.length,
+ skippedRoutes: pathBuildResult.skippedRoutes,
+ untemplatableRoutes: pathBuildResult.untemplatableRoutes,
registeredSchemaCount,
publishedSchemaCount: Object.keys(publishedSchemas).length,
tagCount: tags.length,
@@ -122,13 +137,18 @@ export class OpenAPIGenerator {
private buildPaths(routes: Array<ExtractedRoute>, operationBuilder: OpenAPIOperationBuilder): PathBuildResult {
const paths: Record<string, OpenAPIPathItem> = {};
let operationCount = 0;
- let skippedRouteCount = 0;
+ const skippedRoutes: Array<SkippedRoute> = [];
+ const untemplatableRoutes: Array<SkippedRoute> = [];
for (const route of routes) {
if (isExcludedRoutePath(route.path)) {
continue;
}
if (!route.responseSchemaName && !route.hasNoContent) {
- skippedRouteCount++;
+ skippedRoutes.push(describeRoute(route, 'no responseSchema and no NoContent()'));
+ continue;
+ }
+ if (!hasOpenAPIPathTemplate(route.path)) {
+ untemplatableRoutes.push(describeRoute(route, 'the Hono path has no OpenAPI path template'));
continue;
}
const openApiPath = convertPathToOpenAPI(route.path);
@@ -143,7 +163,8 @@ export class OpenAPIGenerator {
return {
paths: sortedPaths,
operationCount,
- skippedRouteCount,
+ skippedRoutes,
+ untemplatableRoutes,
};
}
private filterPublishedSchemas(
diff --git a/packages/openapi/src/extractors/RouteExtractor.ts b/packages/openapi/src/extractors/RouteExtractor.ts
index 7b925a98e..8800be9b6 100644
--- a/packages/openapi/src/extractors/RouteExtractor.ts
+++ b/packages/openapi/src/extractors/RouteExtractor.ts
@@ -1,6 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {
+ EMPTY_SCOPE,
+ type Scope,
+ StaticPathResolver,
+ type StaticValue,
+ UNRESOLVED,
+} from '@fluxer/openapi/src/extractors/StaticPathResolver';
import type {ExtractedRoute, ExtractedValidator, HttpMethod, ValidatorTarget} from '@fluxer/openapi/src/Types';
-import {type CallExpression, Node, Project, type SourceFile} from 'ts-morph';
+import {type CallExpression, type FunctionDeclaration, Node, Project, type SourceFile} from 'ts-morph';
const HTTP_METHODS: ReadonlySet<string> = new Set(['get', 'post', 'put', 'patch', 'delete']);
function isHttpMethod(method: string): method is HttpMethod {
@@ -45,10 +52,24 @@ function extractOAuth2ScopeArgs(args: ReadonlyArray<Node>): Array<string> | null
}
return scopes.length > 0 ? scopes : null;
}
-function extractObjectLiteralValue(node: Node): unknown {
+interface MetadataContext {
+ readonly resolver: StaticPathResolver;
+ readonly scope: Scope;
+}
+function resolveMetadataText(node: Node, context: MetadataContext | null): string | null {
+ if (context == null) {
+ return null;
+ }
+ const value = context.resolver.resolve(node, context.scope);
+ return typeof value === 'string' ? value : null;
+}
+function extractObjectLiteralValue(node: Node, context: MetadataContext | null): unknown {
if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {
return node.getLiteralValue();
}
+ if (Node.isTemplateExpression(node) || Node.isConditionalExpression(node)) {
+ return resolveMetadataText(node, context);
+ }
if (Node.isNumericLiteral(node)) {
return Number.parseFloat(node.getText());
}
@@ -65,13 +86,26 @@ function extractObjectLiteralValue(node: Node): unknown {
return node.getText();
}
if (Node.isPropertyAccessExpression(node)) {
- return node.getText();
+ return resolveMetadataText(node, context) ?? node.getText();
}
if (Node.isCallExpression(node)) {
return node.getText();
}
if (Node.isArrayLiteralExpression(node)) {
- return node.getElements().map((el) => extractObjectLiteralValue(el));
+ const values: Array<unknown> = [];
+ for (const element of node.getElements()) {
+ if (Node.isSpreadElement(element)) {
+ const spread = context?.resolver.resolve(element.getExpression(), context.scope);
+ if (spread == null || spread === UNRESOLVED || !Array.isArray(spread)) {
+ values.push(null);
+ continue;
+ }
+ values.push(...spread);
+ continue;
+ }
+ values.push(extractObjectLiteralValue(element, context));
+ }
+ return values;
}
if (Node.isObjectLiteralExpression(node)) {
const result: Record<string, unknown> = {};
@@ -80,7 +114,7 @@ function extractObjectLiteralValue(node: Node): unknown {
const key = prop.getName();
const initializer = prop.getInitializer();
if (initializer) {
- result[key] = extractObjectLiteralValue(initializer);
+ result[key] = extractObjectLiteralValue(initializer, context);
}
}
}
@@ -88,9 +122,9 @@ function extractObjectLiteralValue(node: Node): unknown {
}
return null;
}
-function parseObjectLiteralMetadata(objLiteral: Node): Record<string, unknown> {
+function parseObjectLiteralMetadata(objLiteral: Node, context: MetadataContext | null): Record<string, unknown> {
if (!Node.isObjectLiteralExpression(objLiteral)) return {};
- return extractObjectLiteralValue(objLiteral) as Record<string, unknown>;
+ return extractObjectLiteralValue(objLiteral, context) as Record<string, unknown>;
}
function extractValidatorInfo(callExpr: CallExpression): ExtractedValidator | null {
const expression = callExpr.getExpression();
@@ -162,7 +196,7 @@ interface MiddlewareInfo {
description?: string;
} | null;
}
-function extractMiddlewareInfo(callExpr: CallExpression): MiddlewareInfo | null {
+function extractMiddlewareInfo(callExpr: CallExpression, context: MetadataContext | null): MiddlewareInfo | null {
const expression = callExpr.getExpression();
if (Node.isIdentifier(expression)) {
const name = expression.getText();
@@ -245,7 +279,7 @@ function extractMiddlewareInfo(callExpr: CallExpression): MiddlewareInfo | null
if (args.length === 0) return null;
const firstArg = args[0];
if (Node.isObjectLiteralExpression(firstArg)) {
- const metadata = parseObjectLiteralMetadata(firstArg);
+ const metadata = parseObjectLiteralMetadata(firstArg, context);
const operationId = typeof metadata.operationId === 'string' ? metadata.operationId : null;
const summary = typeof metadata.summary === 'string' ? metadata.summary : null;
const description = typeof metadata.description === 'string' ? metadata.description : null;
@@ -479,24 +513,142 @@ function extractSuccessStatusCodes(handler: Node): Array<number> {
});
return Array.from(codes).sort((a, b) => a - b);
}
-function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile): ExtractedRoute | null {
+interface RegistrationCall {
+ readonly call: CallExpression;
+ readonly methods: ReadonlyArray<HttpMethod>;
+ readonly pathArgument: Node;
+ readonly middlewareArguments: ReadonlyArray<Node>;
+}
+interface UnresolvedRegistration {
+ readonly filePath: string;
+ readonly lineNumber: number;
+ readonly methods: string;
+ readonly expression: string;
+}
+function methodsFromOnArgument(node: Node, resolver: StaticPathResolver, scope: Scope): Array<HttpMethod> | null {
+ const value = resolver.resolve(node, scope);
+ if (value === UNRESOLVED) {
+ return null;
+ }
+ const entries: Array<StaticValue> = Array.isArray(value) ? [...value] : [value];
+ const methods: Array<HttpMethod> = [];
+ for (const entry of entries) {
+ if (typeof entry !== 'string') {
+ return null;
+ }
+ const lowered = entry.toLowerCase();
+ if (lowered === 'head') {
+ continue;
+ }
+ if (!isHttpMethod(lowered)) {
+ return null;
+ }
+ methods.push(lowered);
+ }
+ return methods.length > 0 ? methods : null;
+}
+const HONO_TYPE_PATTERN = /\bHono(App|Env)?\b/u;
+function isHonoReceiver(receiver: Node): boolean {
+ if (!Node.isIdentifier(receiver)) {
+ return false;
+ }
+ const name = receiver.getText();
+ for (const ancestor of receiver.getAncestors()) {
+ if (
+ Node.isFunctionDeclaration(ancestor) ||
+ Node.isArrowFunction(ancestor) ||
+ Node.isFunctionExpression(ancestor) ||
+ Node.isMethodDeclaration(ancestor)
+ ) {
+ for (const parameter of ancestor.getParameters()) {
+ const nameNode = parameter.getNameNode();
+ if (Node.isIdentifier(nameNode) && nameNode.getText() === name) {
+ return HONO_TYPE_PATTERN.test(parameter.getTypeNode()?.getText() ?? '');
+ }
+ }
+ }
+ if (Node.isBlock(ancestor) || Node.isSourceFile(ancestor)) {
+ for (const statement of ancestor.getStatements()) {
+ if (!Node.isVariableStatement(statement)) {
+ continue;
+ }
+ for (const declaration of statement.getDeclarations()) {
+ const nameNode = declaration.getNameNode();
+ if (Node.isIdentifier(nameNode) && nameNode.getText() === name) {
+ const annotation = declaration.getTypeNode()?.getText() ?? '';
+ const initializer = declaration.getInitializer()?.getText() ?? '';
+ return HONO_TYPE_PATTERN.test(`${annotation} ${initializer}`);
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+function isRegistrationCall(callExpr: CallExpression): boolean {
const expression = callExpr.getExpression();
if (!Node.isPropertyAccessExpression(expression)) {
- return null;
+ return false;
+ }
+ if (!isHonoReceiver(expression.getExpression())) {
+ return false;
}
- const method = expression.getName().toLowerCase();
- if (!isHttpMethod(method)) {
+ const name = expression.getName().toLowerCase();
+ const args = callExpr.getArguments();
+ if (isHttpMethod(name)) {
+ return args.length >= 2;
+ }
+ return name === 'on' && args.length >= 3;
+}
+function pathArgumentOf(callExpr: CallExpression): Node | null {
+ const expression = callExpr.getExpression();
+ if (!Node.isPropertyAccessExpression(expression)) {
return null;
}
const args = callExpr.getArguments();
- if (args.length < 2) {
+ return expression.getName().toLowerCase() === 'on' ? (args[1] ?? null) : (args[0] ?? null);
+}
+function readRegistrationCall(
+ callExpr: CallExpression,
+ resolver: StaticPathResolver,
+ scope: Scope,
+): RegistrationCall | null {
+ if (!isRegistrationCall(callExpr)) {
+ return null;
+ }
+ const expression = callExpr.getExpression();
+ if (!Node.isPropertyAccessExpression(expression)) {
return null;
}
- const pathArg = args[0];
- const path = extractStringLiteral(pathArg);
- if (!path) {
+ const name = expression.getName().toLowerCase();
+ const args = callExpr.getArguments();
+ if (isHttpMethod(name)) {
+ return {
+ call: callExpr,
+ methods: [name],
+ pathArgument: args[0],
+ middlewareArguments: args.slice(1),
+ };
+ }
+ const methods = methodsFromOnArgument(args[0], resolver, scope);
+ if (methods == null) {
return null;
}
+ return {
+ call: callExpr,
+ methods,
+ pathArgument: args[1],
+ middlewareArguments: args.slice(2),
+ };
+}
+function buildRoute(
+ registration: RegistrationCall,
+ method: HttpMethod,
+ routePath: string,
+ sourceFile: SourceFile,
+ resolver: StaticPathResolver,
+ scope: Scope,
+): ExtractedRoute {
const validators: Array<ExtractedValidator> = [];
const middlewares: Array<string> = [];
let hasLoginRequired = false;
@@ -525,8 +677,7 @@ function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile):
url: string;
description?: string;
} | null = null;
- for (let i = 1; i < args.length; i++) {
- const arg = args[i];
+ for (const arg of registration.middlewareArguments) {
if (Node.isIdentifier(arg)) {
const name = arg.getText();
middlewares.push(name);
@@ -544,7 +695,7 @@ function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile):
if (validatorInfo) {
validators.push(validatorInfo);
} else {
- const middlewareInfo = extractMiddlewareInfo(arg);
+ const middlewareInfo = extractMiddlewareInfo(arg, {resolver, scope});
if (middlewareInfo) {
middlewares.push(middlewareInfo.middlewareName);
if (middlewareInfo.rateLimitConfig) {
@@ -580,7 +731,7 @@ function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile):
if (middlewareInfo.oauth2RequiredScopes && middlewareInfo.oauth2ScopeMode) {
if (oauth2ScopeMode && oauth2ScopeMode !== middlewareInfo.oauth2ScopeMode) {
throw new Error(
- `Cannot combine OAuth2 scope middleware modes on ${method.toUpperCase()} ${path} in ${sourceFile.getFilePath()}:${callExpr.getStartLineNumber()}`,
+ `Cannot combine OAuth2 scope middleware modes on ${method.toUpperCase()} ${routePath} in ${sourceFile.getFilePath()}:${registration.call.getStartLineNumber()}`,
);
}
oauth2ScopeMode = middlewareInfo.oauth2ScopeMode;
@@ -615,9 +766,9 @@ function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile):
}
return {
method,
- path,
+ path: routePath,
controllerFile: sourceFile.getFilePath(),
- lineNumber: callExpr.getStartLineNumber(),
+ lineNumber: registration.call.getStartLineNumber(),
validators,
middlewares,
hasLoginRequired,
@@ -645,16 +796,194 @@ function extractRouteFromCall(callExpr: CallExpression, sourceFile: SourceFile):
explicitExternalDocs,
};
}
-function findRoutesInSourceFile(sourceFile: SourceFile): Array<ExtractedRoute> {
- const routes: Array<ExtractedRoute> = [];
+function owningFunction(node: Node): FunctionDeclaration | null {
+ for (const ancestor of node.getAncestors()) {
+ if (Node.isFunctionDeclaration(ancestor)) {
+ return ancestor;
+ }
+ }
+ return null;
+}
+function bindParameters(
+ fn: FunctionDeclaration,
+ args: ReadonlyArray<Node>,
+ callerScope: Scope,
+ resolver: StaticPathResolver,
+): Scope {
+ const scope = new Map<string, StaticValue>();
+ fn.getParameters().forEach((parameter, index) => {
+ const arg = args[index];
+ if (arg == null) {
+ return;
+ }
+ const value = resolver.resolve(arg, callerScope);
+ if (value === UNRESOLVED) {
+ return;
+ }
+ const nameNode = parameter.getNameNode();
+ if (Node.isIdentifier(nameNode)) {
+ scope.set(nameNode.getText(), value);
+ return;
+ }
+ if (Node.isObjectBindingPattern(nameNode) && typeof value === 'object' && value !== null && !Array.isArray(value)) {
+ const record = value as {readonly [key: string]: StaticValue};
+ for (const element of nameNode.getElements()) {
+ const key = element.getPropertyNameNode()?.getText() ?? element.getName();
+ if (key in record) {
+ scope.set(element.getName(), record[key]);
+ }
+ }
+ }
+ });
+ return scope;
+}
+function scopesForFunction(
+ fn: FunctionDeclaration,
+ sourceFile: SourceFile,
+ resolver: StaticPathResolver,
+ visiting: Set<FunctionDeclaration>,
+): Array<Scope> {
+ if (visiting.has(fn)) {
+ return [EMPTY_SCOPE];
+ }
+ const name = fn.getName();
+ if (name == null) {
+ return [EMPTY_SCOPE];
+ }
+ visiting.add(fn);
+ try {
+ const scopes: Array<Scope> = [];
+ sourceFile.forEachDescendant((node) => {
+ if (!Node.isCallExpression(node)) {
+ return;
+ }
+ const callee = node.getExpression();
+ if (!Node.isIdentifier(callee) || callee.getText() !== name) {
+ return;
+ }
+ const enclosing = owningFunction(node);
+ const outerScopes =
+ enclosing == null || enclosing === fn
+ ? [EMPTY_SCOPE]
+ : scopesForFunction(enclosing, sourceFile, resolver, visiting);
+ for (const outerScope of outerScopes) {
+ for (const loopScope of expandLoops(node, enclosing, outerScope, resolver)) {
+ scopes.push(bindParameters(fn, node.getArguments(), loopScope, resolver));
+ }
+ }
+ });
+ return scopes.length > 0 ? scopes : [EMPTY_SCOPE];
+ } finally {
+ visiting.delete(fn);
+ }
+}
+function expandLoops(
+ node: Node,
+ stopAt: FunctionDeclaration | null,
+ baseScope: Scope,
+ resolver: StaticPathResolver,
+): Array<Scope> {
+ const loops: Array<Node> = [];
+ for (const ancestor of node.getAncestors()) {
+ if (ancestor === stopAt || Node.isSourceFile(ancestor)) {
+ break;
+ }
+ if (Node.isForOfStatement(ancestor)) {
+ loops.push(ancestor);
+ }
+ }
+ let scopes: Array<Scope> = [baseScope];
+ for (const loop of loops.reverse()) {
+ if (!Node.isForOfStatement(loop)) {
+ continue;
+ }
+ const initializer = loop.getInitializer();
+ if (!Node.isVariableDeclarationList(initializer)) {
+ return scopes;
+ }
+ const declaration = initializer.getDeclarations()[0];
+ const nameNode = declaration?.getNameNode();
+ if (nameNode == null || !Node.isIdentifier(nameNode)) {
+ return scopes;
+ }
+ const expanded: Array<Scope> = [];
+ for (const scope of scopes) {
+ const iterated = resolver.resolve(loop.getExpression(), scope);
+ if (!Array.isArray(iterated)) {
+ return scopes;
+ }
+ for (const element of iterated) {
+ const next = new Map(scope);
+ next.set(nameNode.getText(), element);
+ expanded.push(next);
+ }
+ }
+ scopes = expanded;
+ }
+ return scopes;
+}
+function findRoutesInSourceFile(
+ sourceFile: SourceFile,
+ resolver: StaticPathResolver,
+ unresolved: Array<UnresolvedRegistration>,
+): Array<ExtractedRoute> {
+ const registrations: Array<CallExpression> = [];
sourceFile.forEachDescendant((node) => {
if (Node.isCallExpression(node)) {
- const route = extractRouteFromCall(node, sourceFile);
- if (route) {
- routes.push(route);
- }
+ registrations.push(node);
}
});
+ const byOwner = new Map<FunctionDeclaration | null, Array<CallExpression>>();
+ for (const call of registrations) {
+ if (!isRegistrationCall(call)) {
+ continue;
+ }
+ const owner = owningFunction(call);
+ const bucket = byOwner.get(owner);
+ if (bucket == null) {
+ byOwner.set(owner, [call]);
+ } else {
+ bucket.push(call);
+ }
+ }
+ const routes: Array<ExtractedRoute> = [];
+ for (const [owner, calls] of byOwner) {
+ const scopes = owner == null ? [EMPTY_SCOPE] : scopesForFunction(owner, sourceFile, resolver, new Set());
+ for (const call of calls) {
+ const seen = new Set<string>();
+ let resolvedAny = false;
+ for (const scope of scopes) {
+ const registration = readRegistrationCall(call, resolver, scope);
+ if (registration == null) {
+ continue;
+ }
+ const routePath = resolver.resolveString(registration.pathArgument, scope);
+ if (routePath == null) {
+ continue;
+ }
+ resolvedAny = true;
+ for (const method of registration.methods) {
+ const key = `${method} ${routePath}`;
+ if (seen.has(key)) {
+ continue;
+ }
+ seen.add(key);
+ routes.push(buildRoute(registration, method, routePath, sourceFile, resolver, scope));
+ }
+ }
+ if (!resolvedAny) {
+ const expression = call.getExpression();
+ const methodName = Node.isPropertyAccessExpression(expression) ? expression.getName().toUpperCase() : '?';
+ const pathArgument = pathArgumentOf(call);
+ unresolved.push({
+ filePath: sourceFile.getFilePath(),
+ lineNumber: call.getStartLineNumber(),
+ methods: methodName === 'ON' ? `ON ${call.getArguments()[0].getText()}` : methodName,
+ expression: (pathArgument ?? call).getText().replace(/\s+/gu, ' '),
+ });
+ }
+ }
+ }
return routes;
}
export function extractRoutesFromControllers(controllerPaths: Array<string>): Array<ExtractedRoute> {
@@ -662,16 +991,32 @@ export function extractRoutesFromControllers(controllerPaths: Array<string>): Ar
skipAddingFilesFromTsConfig: true,
skipFileDependencyResolution: true,
});
+ const resolver = new StaticPathResolver(project);
const routes: Array<ExtractedRoute> = [];
+ const unresolved: Array<UnresolvedRegistration> = [];
for (const controllerPath of controllerPaths) {
try {
const sourceFile = project.addSourceFileAtPath(controllerPath);
- const fileRoutes = findRoutesInSourceFile(sourceFile);
+ const fileRoutes = findRoutesInSourceFile(sourceFile, resolver, unresolved);
routes.push(...fileRoutes);
} catch (error) {
console.warn(`Warning: Could not parse ${controllerPath}:`, error);
}
}
+ if (unresolved.length > 0) {
+ const lines = unresolved.map(
+ (entry) => ` ${entry.filePath}:${entry.lineNumber.toString()} ${entry.methods} ${entry.expression}`,
+ );
+ throw new Error(
+ [
+ `The route extractor could not read ${unresolved.length.toString()} route path(s). A path it cannot read is a route`,
+ 'that would vanish from openapi.json and from the docs coverage gate without a trace, so extraction',
+ 'stops here instead. Give the path a literal, or a const the resolver can follow, or teach',
+ 'packages/openapi/src/extractors/StaticPathResolver.ts to read the expression.',
+ ...lines,
+ ].join('\n'),
+ );
+ }
return routes;
}
export function discoverControllerFiles(apiPackagePath: string): Array<string> {
@@ -679,6 +1024,10 @@ export function discoverControllerFiles(apiPackagePath: string): Array<string> {
tsConfigFilePath: `${apiPackagePath}/tsconfig.json`,
skipAddingFilesFromTsConfig: true,
});
- const sourceFiles = project.addSourceFilesAtPaths([`${apiPackagePath}/src/**/*Controller.ts`]);
+ const sourceFiles = project.addSourceFilesAtPaths([
+ `${apiPackagePath}/src/**/*.ts`,
+ `!${apiPackagePath}/src/**/*.test.ts`,
+ `!${apiPackagePath}/src/**/tests/**`,
+ ]);
return sourceFiles.map((sf) => sf.getFilePath());
}
diff --git a/packages/openapi/src/extractors/StaticPathResolver.ts b/packages/openapi/src/extractors/StaticPathResolver.ts
new file mode 100644
index 000000000..d89ddcaba
--- /dev/null
+++ b/packages/openapi/src/extractors/StaticPathResolver.ts
@@ -0,0 +1,405 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import * as path from 'node:path';
+import {Node, type Project, type SourceFile, SyntaxKind} from 'ts-morph';
+
+export const UNRESOLVED = Symbol('unresolved');
+
+export type StaticValue =
+ | string
+ | number
+ | boolean
+ | null
+ | ReadonlyArray<StaticValue>
+ | {readonly [key: string]: StaticValue};
+
+type Resolved = StaticValue | typeof UNRESOLVED;
+
+export type Scope = ReadonlyMap<string, StaticValue>;
+
+export const EMPTY_SCOPE: Scope = new Map<string, StaticValue>();
+
+const MAX_DEPTH = 48;
+
+function isPlainObject(value: Resolved): value is {readonly [key: string]: StaticValue} {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+function isTruthy(value: StaticValue): boolean {
+ if (Array.isArray(value)) return true;
+ if (isPlainObject(value)) return true;
+ return Boolean(value);
+}
+
+function unwrap(node: Node): Node {
+ let current = node;
+ while (
+ Node.isParenthesizedExpression(current) ||
+ Node.isAsExpression(current) ||
+ Node.isSatisfiesExpression(current) ||
+ Node.isNonNullExpression(current) ||
+ Node.isTypeAssertion(current)
+ ) {
+ current = current.getExpression();
+ }
+ return current;
+}
+
+export class StaticPathResolver {
+ private readonly moduleConstants = new Map<SourceFile, Map<string, Node>>();
+ private readonly inFlight = new Set<Node>();
+
+ constructor(private readonly project: Project) {}
+
+ public resolve(node: Node, scope: Scope): Resolved {
+ return this.evaluate(node, scope, 0);
+ }
+
+ public resolveString(node: Node, scope: Scope): string | null {
+ const value = this.evaluate(node, scope, 0);
+ return typeof value === 'string' ? value : null;
+ }
+
+ private evaluate(rawNode: Node, scope: Scope, depth: number): Resolved {
+ if (depth > MAX_DEPTH) {
+ return UNRESOLVED;
+ }
+ const node = unwrap(rawNode);
+ if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {
+ return node.getLiteralValue();
+ }
+ if (Node.isNumericLiteral(node)) {
+ return node.getLiteralValue();
+ }
+ if (Node.isTrueLiteral(node)) {
+ return true;
+ }
+ if (Node.isFalseLiteral(node)) {
+ return false;
+ }
+ if (Node.isNullLiteral(node)) {
+ return null;
+ }
+ if (Node.isTemplateExpression(node)) {
+ let text = node.getHead().getLiteralText();
+ for (const span of node.getTemplateSpans()) {
+ const value = this.evaluate(span.getExpression(), scope, depth + 1);
+ if (value === UNRESOLVED || Array.isArray(value) || isPlainObject(value)) {
+ return UNRESOLVED;
+ }
+ text += String(value);
+ text += span.getLiteral().getLiteralText();
+ }
+ return text;
+ }
+ if (Node.isIdentifier(node)) {
+ return this.evaluateIdentifier(node, scope, depth);
+ }
+ if (Node.isPropertyAccessExpression(node)) {
+ const target = this.evaluate(node.getExpression(), scope, depth + 1);
+ if (!isPlainObject(target)) {
+ return UNRESOLVED;
+ }
+ const name = node.getName();
+ return name in target ? target[name] : UNRESOLVED;
+ }
+ if (Node.isElementAccessExpression(node)) {
+ const target = this.evaluate(node.getExpression(), scope, depth + 1);
+ const argument = node.getArgumentExpression();
+ if (argument == null || target === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ const key = this.evaluate(argument, scope, depth + 1);
+ if (typeof key !== 'string' && typeof key !== 'number') {
+ return UNRESOLVED;
+ }
+ if (Array.isArray(target)) {
+ const index = typeof key === 'number' ? key : Number.parseInt(key, 10);
+ return Number.isInteger(index) && index >= 0 && index < target.length ? target[index] : UNRESOLVED;
+ }
+ if (isPlainObject(target)) {
+ const name = String(key);
+ return name in target ? target[name] : UNRESOLVED;
+ }
+ return UNRESOLVED;
+ }
+ if (Node.isArrayLiteralExpression(node)) {
+ const values: Array<StaticValue> = [];
+ for (const element of node.getElements()) {
+ if (Node.isSpreadElement(element)) {
+ return UNRESOLVED;
+ }
+ const value = this.evaluate(element, scope, depth + 1);
+ if (value === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ values.push(value);
+ }
+ return values;
+ }
+ if (Node.isObjectLiteralExpression(node)) {
+ const result: Record<string, StaticValue> = {};
+ for (const property of node.getProperties()) {
+ if (Node.isPropertyAssignment(property)) {
+ const initializer = property.getInitializer();
+ if (initializer == null) {
+ return UNRESOLVED;
+ }
+ const value = this.evaluate(initializer, scope, depth + 1);
+ if (value === UNRESOLVED) {
+ continue;
+ }
+ result[property.getName()] = value;
+ continue;
+ }
+ if (Node.isShorthandPropertyAssignment(property)) {
+ const value = this.evaluate(property.getNameNode(), scope, depth + 1);
+ if (value === UNRESOLVED) {
+ continue;
+ }
+ result[property.getName()] = value;
+ continue;
+ }
+ return UNRESOLVED;
+ }
+ return result;
+ }
+ if (Node.isConditionalExpression(node)) {
+ const condition = this.evaluate(node.getCondition(), scope, depth + 1);
+ if (condition === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ return this.evaluate(isTruthy(condition) ? node.getWhenTrue() : node.getWhenFalse(), scope, depth + 1);
+ }
+ if (Node.isPrefixUnaryExpression(node)) {
+ if (node.getOperatorToken() !== SyntaxKind.ExclamationToken) {
+ return UNRESOLVED;
+ }
+ const operand = this.evaluate(node.getOperand(), scope, depth + 1);
+ return operand === UNRESOLVED ? UNRESOLVED : !isTruthy(operand);
+ }
+ if (Node.isBinaryExpression(node)) {
+ return this.evaluateBinary(node, scope, depth);
+ }
+ return UNRESOLVED;
+ }
+
+ private evaluateBinary(node: Node, scope: Scope, depth: number): Resolved {
+ if (!Node.isBinaryExpression(node)) {
+ return UNRESOLVED;
+ }
+ const operator = node.getOperatorToken().getText();
+ const left = this.evaluate(node.getLeft(), scope, depth + 1);
+ if (left === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ if (operator === '&&') {
+ return isTruthy(left) ? this.evaluate(node.getRight(), scope, depth + 1) : left;
+ }
+ if (operator === '||') {
+ return isTruthy(left) ? left : this.evaluate(node.getRight(), scope, depth + 1);
+ }
+ if (operator === '??') {
+ return left === null ? this.evaluate(node.getRight(), scope, depth + 1) : left;
+ }
+ const right = this.evaluate(node.getRight(), scope, depth + 1);
+ if (right === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ if (operator === '+') {
+ if (typeof left === 'string' && (typeof right === 'string' || typeof right === 'number')) {
+ return left + String(right);
+ }
+ if (typeof left === 'number' && typeof right === 'number') {
+ return left + right;
+ }
+ return UNRESOLVED;
+ }
+ const comparable =
+ (typeof left === 'string' || typeof left === 'number' || typeof left === 'boolean' || left === null) &&
+ (typeof right === 'string' || typeof right === 'number' || typeof right === 'boolean' || right === null);
+ if (!comparable) {
+ return UNRESOLVED;
+ }
+ if (operator === '===' || operator === '==') {
+ return left === right;
+ }
+ if (operator === '!==' || operator === '!=') {
+ return left !== right;
+ }
+ return UNRESOLVED;
+ }
+
+ private evaluateIdentifier(node: Node, scope: Scope, depth: number): Resolved {
+ if (!Node.isIdentifier(node)) {
+ return UNRESOLVED;
+ }
+ const name = node.getText();
+ if (name === 'undefined') {
+ return UNRESOLVED;
+ }
+ const bound = scope.get(name);
+ if (bound !== undefined) {
+ return bound;
+ }
+ const local = this.findBindingInScopeChain(node, name);
+ if (local != null) {
+ return this.evaluateBinding(local, scope, depth);
+ }
+ return this.evaluateImportedConstant(node.getSourceFile(), name, depth);
+ }
+
+ private findBindingInScopeChain(from: Node, name: string): Node | null {
+ for (const ancestor of from.getAncestors()) {
+ if (!Node.isBlock(ancestor) && !Node.isSourceFile(ancestor) && !Node.isCaseClause(ancestor)) {
+ continue;
+ }
+ for (const statement of ancestor.getStatements()) {
+ if (!Node.isVariableStatement(statement)) {
+ continue;
+ }
+ if (statement.getDeclarationKind() !== 'const') {
+ continue;
+ }
+ for (const declaration of statement.getDeclarations()) {
+ const nameNode = declaration.getNameNode();
+ if (Node.isIdentifier(nameNode)) {
+ if (nameNode.getText() === name) {
+ return declaration;
+ }
+ continue;
+ }
+ if (Node.isObjectBindingPattern(nameNode) || Node.isArrayBindingPattern(nameNode)) {
+ for (const element of nameNode.getElements()) {
+ if (Node.isBindingElement(element) && element.getName() === name) {
+ return element;
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private evaluateBinding(binding: Node, scope: Scope, depth: number): Resolved {
+ if (this.inFlight.has(binding)) {
+ return UNRESOLVED;
+ }
+ this.inFlight.add(binding);
+ try {
+ if (Node.isVariableDeclaration(binding)) {
+ const initializer = binding.getInitializer();
+ return initializer == null ? UNRESOLVED : this.evaluate(initializer, scope, depth + 1);
+ }
+ if (!Node.isBindingElement(binding)) {
+ return UNRESOLVED;
+ }
+ if (binding.getDotDotDotToken() != null) {
+ return UNRESOLVED;
+ }
+ const pattern = binding.getParent();
+ const declaration = pattern.getParent();
+ if (!Node.isVariableDeclaration(declaration)) {
+ return UNRESOLVED;
+ }
+ const initializer = declaration.getInitializer();
+ if (initializer == null) {
+ return UNRESOLVED;
+ }
+ const source = this.evaluate(initializer, scope, depth + 1);
+ if (source === UNRESOLVED) {
+ return UNRESOLVED;
+ }
+ if (Node.isObjectBindingPattern(pattern)) {
+ if (!isPlainObject(source)) {
+ return UNRESOLVED;
+ }
+ const key = binding.getPropertyNameNode()?.getText() ?? binding.getName();
+ return key in source ? source[key] : UNRESOLVED;
+ }
+ if (Node.isArrayBindingPattern(pattern)) {
+ if (!Array.isArray(source)) {
+ return UNRESOLVED;
+ }
+ const index = pattern.getElements().indexOf(binding);
+ return index >= 0 && index < source.length ? source[index] : UNRESOLVED;
+ }
+ return UNRESOLVED;
+ } finally {
+ this.inFlight.delete(binding);
+ }
+ }
+
+ private evaluateImportedConstant(sourceFile: SourceFile, name: string, depth: number): Resolved {
+ const target = this.resolveImportTarget(sourceFile, name);
+ if (target == null) {
+ return UNRESOLVED;
+ }
+ const constants = this.constantsOf(target.sourceFile);
+ const initializer = constants.get(target.exportedName);
+ if (initializer == null) {
+ return UNRESOLVED;
+ }
+ return this.evaluate(initializer, EMPTY_SCOPE, depth + 1);
+ }
+
+ private resolveImportTarget(
+ sourceFile: SourceFile,
+ name: string,
+ ): {sourceFile: SourceFile; exportedName: string} | null {
+ for (const declaration of sourceFile.getImportDeclarations()) {
+ for (const named of declaration.getNamedImports()) {
+ const localName = named.getAliasNode()?.getText() ?? named.getName();
+ if (localName !== name) {
+ continue;
+ }
+ const resolved = this.resolveModule(sourceFile, declaration.getModuleSpecifierValue());
+ if (resolved == null) {
+ return null;
+ }
+ return {sourceFile: resolved, exportedName: named.getName()};
+ }
+ }
+ return null;
+ }
+
+ private resolveModule(from: SourceFile, specifier: string): SourceFile | null {
+ if (!specifier.startsWith('.')) {
+ return null;
+ }
+ const base = path.resolve(path.dirname(from.getFilePath()), specifier);
+ for (const candidate of [`${base}.ts`, `${base}.tsx`, `${base}/index.ts`, base]) {
+ const existing = this.project.getSourceFile(candidate);
+ if (existing != null) {
+ return existing;
+ }
+ const added = this.project.addSourceFileAtPathIfExists(candidate);
+ if (added != null) {
+ return added;
+ }
+ }
+ return null;
+ }
+
+ private constantsOf(sourceFile: SourceFile): Map<string, Node> {
+ const cached = this.moduleConstants.get(sourceFile);
+ if (cached != null) {
+ return cached;
+ }
+ const constants = new Map<string, Node>();
+ for (const statement of sourceFile.getVariableStatements()) {
+ if (statement.getDeclarationKind() !== 'const') {
+ continue;
+ }
+ for (const declaration of statement.getDeclarations()) {
+ const nameNode = declaration.getNameNode();
+ const initializer = declaration.getInitializer();
+ if (Node.isIdentifier(nameNode) && initializer != null) {
+ constants.set(nameNode.getText(), initializer);
+ }
+ }
+ }
+ this.moduleConstants.set(sourceFile, constants);
+ return constants;
+ }
+}
diff --git a/packages/openapi/src/extractors/__tests__/RouteDiscovery.test.ts b/packages/openapi/src/extractors/__tests__/RouteDiscovery.test.ts
new file mode 100644
index 000000000..26c8df792
--- /dev/null
+++ b/packages/openapi/src/extractors/__tests__/RouteDiscovery.test.ts
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
+import {discoverControllerFiles, extractRoutesFromControllers} from '@fluxer/openapi/src/extractors/RouteExtractor';
+import {beforeAll, describe, expect, it} from 'vitest';
+
+const API_PACKAGE_PATH = path.join(fileURLToPath(new URL('../../../../../', import.meta.url)), 'fluxer_api');
+
+describe('discoverControllerFiles', () => {
+ let files: Array<string>;
+ let shapes: Set<string>;
+ beforeAll(() => {
+ files = discoverControllerFiles(API_PACKAGE_PATH);
+ shapes = new Set(extractRoutesFromControllers(files).map((route) => `${route.method.toUpperCase()} ${route.path}`));
+ });
+ it('leaves test sources out of the discovered set', () => {
+ expect(files.filter((file) => file.endsWith('.test.ts'))).toEqual([]);
+ expect(files.filter((file) => file.includes('/tests/'))).toEqual([]);
+ });
+ it('reads routes registered in a *Controller.ts file', () => {
+ expect(shapes).toContain('GET /gifs/search');
+ expect(shapes).toContain('GET /gifs/featured');
+ });
+ it('reads routes registered outside a *Controller.ts file', () => {
+ expect(shapes).toContain('POST /webhooks/twilio/sms');
+ expect(shapes).toContain('GET /_metrics');
+ expect(shapes).toContain('GET /_health');
+ });
+});
diff --git a/packages/openapi/src/scripts/GenerateSpec.ts b/packages/openapi/src/scripts/GenerateSpec.ts
index 4316a8e3d..3fbeddb76 100644
--- a/packages/openapi/src/scripts/GenerateSpec.ts
+++ b/packages/openapi/src/scripts/GenerateSpec.ts
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import * as fs from 'node:fs';
import * as path from 'node:path';
-import type {OpenAPIRouteScope} from '@fluxer/openapi/src/OpenAPIGenerationTypes';
+import type {OpenAPIGenerationStats, OpenAPIRouteScope, SkippedRoute} from '@fluxer/openapi/src/OpenAPIGenerationTypes';
import {OpenAPIGenerator} from '@fluxer/openapi/src/OpenAPIGenerator';
import {transformAdminOpenAPISpec} from '@fluxer/openapi/src/output/AdminSpecTransform';
import {printValidationResult, validateSpec} from '@fluxer/openapi/src/output/SpecValidator';
@@ -62,6 +62,21 @@ function getTargetOutputPath(basePath: string, target: GenerateTarget, customOut
function getRouteScope(target: GenerateTarget): OpenAPIRouteScope {
return target === 'admin' ? 'admin' : 'public';
}
+function reportRoutesLeftOut(target: GenerateTarget, stats: OpenAPIGenerationStats): void {
+ const groups: Array<[string, ReadonlyArray<SkippedRoute>]> = [
+ ['registered but not written to the spec', stats.skippedRoutes],
+ ['registered but not expressible as an OpenAPI path', stats.untemplatableRoutes],
+ ];
+ for (const [title, routes] of groups) {
+ if (routes.length === 0) {
+ continue;
+ }
+ console.log(`${target} routes ${title}: ${routes.length.toString()}`);
+ for (const route of [...routes].sort((a, b) => `${a.path} ${a.method}`.localeCompare(`${b.path} ${b.method}`))) {
+ console.log(` ${route.method} ${route.path} ${route.reason} (${route.source})`);
+ }
+ }
+}
async function buildTargetSpec(basePath: string, target: GenerateTarget): Promise<WritableOpenAPISpec> {
const generator = new OpenAPIGenerator({
basePath,
@@ -71,11 +86,12 @@ async function buildTargetSpec(basePath: string, target: GenerateTarget): Promis
serverUrl: 'https://api.fluxer.app/v1',
routeScope: getRouteScope(target),
});
- const spec = await generator.generate();
+ const {document, stats} = await generator.generateWithStats();
+ reportRoutesLeftOut(target, stats);
if (target === 'admin') {
- return transformAdminOpenAPISpec(spec);
+ return transformAdminOpenAPISpec(document);
}
- return spec;
+ return document;
}
function validateTargetSpec(target: GenerateTarget, spec: WritableOpenAPISpec): boolean {
const validationResult = validateSpec(spec, {
diff --git a/packages/openapi/vitest.config.ts b/packages/openapi/vitest.config.ts
new file mode 100644
index 000000000..2505b9fe6
--- /dev/null
+++ b/packages/openapi/vitest.config.ts
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
+import tsconfigPaths from 'vite-tsconfig-paths';
+import {defineConfig} from 'vitest/config';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+export default defineConfig({
+ plugins: [
+ tsconfigPaths({
+ root: path.resolve(__dirname, '../..'),
+ }),
+ ],
+ test: {
+ globals: true,
+ environment: 'node',
+ include: ['**/*.{test,spec}.{ts,tsx}'],
+ exclude: ['node_modules', 'dist'],
+ testTimeout: 60000,
+ coverage: {
+ provider: 'v8',
+ reporter: ['text', 'json', 'html'],
+ exclude: ['**/*.test.tsx', '**/*.spec.tsx', 'node_modules/'],
+ },
+ },
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1b5976fa3..cbf86399c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2109,6 +2109,12 @@ importers:
tsx:
specifier: 'catalog:'
version: 4.21.0
+ vite-tsconfig-paths:
+ specifier: 'catalog:'
+ vitest:
+ specifier: 'catalog:'
packages/schema:
dependencies:
@@ -10446,10 +10452,6 @@ packages:
resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
- engines: {node: '>=12.0.0'}
-
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
engines: {node: '>=12.0.0'}
@@ -20076,11 +20078,6 @@ snapshots:
- dependencies:
- fdir: 6.5.0([email protected])
- picomatch: 4.0.7
-
dependencies:
fdir: 6.5.0([email protected])
@@ -20376,7 +20373,7 @@ snapshots:
std-env: 4.2.0
tinybench: 2.9.0
tinyexec: 1.0.2
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
tinyrainbow: 3.1.1
why-is-node-running: 2.3.0
@@ -20407,7 +20404,7 @@ snapshots:
std-env: 4.2.0
tinybench: 2.9.0
tinyexec: 1.0.2
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.17
tinyrainbow: 3.1.1
why-is-node-running: 2.3.0