{
    "openapi": "3.1.2",
    "info": {
        "title": "MutexAI Studio API",
        "version": "1.0.0",
        "description": "Live keys (`mx_live_\u2026`) spend credits; test keys (`mx_test_\u2026`) run in the sandbox and never spend real credits or call real providers. Errors are RFC 9457 Problem Details (`application/problem+json`). Writes accept an `Idempotency-Key` header. Outbound webhooks are signed per the Standard Webhooks spec."
    },
    "servers": [
        {
            "url": "https://studio-api.mutexai.net"
        }
    ],
    "security": [
        {
            "apiKey": []
        }
    ],
    "paths": {
        "/v1/balance": {
            "get": {
                "operationId": "v1.balance",
                "description": "Available credits for the key's mode. Test keys see the sandbox wallet (refilled to 1,000\neach day), never the live balance. Needs the `balance:read` scope.",
                "summary": "Get the credit balance",
                "tags": [
                    "Credits",
                    "Balance"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "balance"
                                        },
                                        "available": {
                                            "type": "integer"
                                        },
                                        "livemode": {
                                            "type": "boolean"
                                        },
                                        "as_of": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "available",
                                        "livemode",
                                        "as_of"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/ledger": {
            "get": {
                "operationId": "v1.ledger",
                "description": "Credit movements for the key's mode, newest first, with cursor pagination. Needs the `ledger:read` scope.",
                "summary": "List ledger entries",
                "tags": [
                    "Credits",
                    "Ledger"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Items per page (1 to 100). @default 20",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "The `next_cursor` from the previous page.",
                        "schema": {
                            "type": "string",
                            "maxLength": 512
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "list"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "next_cursor": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "livemode": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "data",
                                        "has_more",
                                        "next_cursor",
                                        "livemode"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/events/{event}": {
            "get": {
                "operationId": "v1.events.show",
                "description": "Fetch an event by the `webhook-id` you received, to confirm it came from us. Another\naccount's or another mode's event is 404. Needs the `webhooks:manage` scope.",
                "summary": "Get an event",
                "tags": [
                    "Events",
                    "Event"
                ],
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`WebhookEventResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookEventResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such object in this account and mode.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/health": {
            "get": {
                "operationId": "v1.health",
                "description": "Public, no key needed. `status` is `ok` when the API can reach its database.",
                "summary": "Health check",
                "tags": [
                    "Health"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "health"
                                        },
                                        "status": {
                                            "type": "string",
                                            "enum": [
                                                "ok",
                                                "degraded"
                                            ]
                                        },
                                        "version": {
                                            "type": "string",
                                            "const": "v1"
                                        },
                                        "time": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "status",
                                        "version",
                                        "time"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "health"
                                        },
                                        "status": {
                                            "type": "string",
                                            "const": "degraded"
                                        },
                                        "version": {
                                            "type": "string",
                                            "const": "v1"
                                        },
                                        "time": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "status",
                                        "version",
                                        "time"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many health checks from this IP.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        },
        "/v1/webhook-endpoints": {
            "get": {
                "operationId": "v1.webhook-endpoints.index",
                "description": "Endpoints for the key's mode, newest first. Needs the `webhooks:manage` scope.",
                "summary": "List webhook endpoints",
                "tags": [
                    "Webhook endpoints",
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Items per page (1 to 100). @default 20",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "The `next_cursor` from the previous page.",
                        "schema": {
                            "type": "string",
                            "maxLength": 512
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "list"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "next_cursor": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "livemode": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "data",
                                        "has_more",
                                        "next_cursor",
                                        "livemode"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.webhook-endpoints.store",
                "description": "The response holds the signing `secret` (`whsec_\u2026`) once; store it to verify the\n`webhook-signature` header. Test keys make test endpoints, which only get test events.\nNeeds the `webhooks:manage` scope. Send an `Idempotency-Key` to retry safely.",
                "summary": "Create a webhook endpoint",
                "tags": [
                    "Webhook endpoints",
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "description": "A unique value (a UUID) per logical request. Retries with the same key and body return the first response with `Idempotent-Replayed: true`; a different body is refused with 422; a request still running is refused with 409. Kept for 24 hours.",
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreWebhookEndpointRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookEndpointResource"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A request with this Idempotency-Key is still being processed.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-endpoints/{endpoint}": {
            "get": {
                "operationId": "v1.webhook-endpoints.show",
                "description": "Needs the `webhooks:manage` scope.",
                "summary": "Get a webhook endpoint",
                "tags": [
                    "Webhook endpoints",
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`WebhookEndpointResource`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookEndpointResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such object in this account and mode.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v1.webhook-endpoints.destroy",
                "description": "Stops all deliveries to it at once. Needs the `webhooks:manage` scope.",
                "summary": "Delete a webhook endpoint",
                "tags": [
                    "Webhook endpoints",
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "description": "A unique value (a UUID) per logical request. Retries with the same key and body return the first response with `Idempotent-Replayed: true`; a different body is refused with 422; a request still running is refused with 409. Kept for 24 hours.",
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "webhook_endpoint"
                                        },
                                        "id": {
                                            "type": "string"
                                        },
                                        "deleted": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "object",
                                        "id",
                                        "deleted"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The API key is missing, malformed, unknown, revoked or expired.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the scope, the IP is not allowed, or the account is suspended.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited. Wait for `Retry-After` seconds.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds to wait before retrying.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such object in this account and mode.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A request with this Idempotency-Key is still being processed.",
                        "content": {
                            "application/problem+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Problem"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Requests allowed in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Requests left in the window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "http",
                "description": "An API key: `mx_live_\u2026` for live mode or `mx_test_\u2026` for the sandbox, sent as `Authorization: Bearer <key>`. Keys in query strings are refused.",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "Problem": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "format": "uri",
                        "description": "A link to the error documentation, ending in `#<code>`."
                    },
                    "title": {
                        "type": "string",
                        "description": "A short, human summary of the problem type."
                    },
                    "status": {
                        "type": "integer",
                        "description": "The HTTP status code."
                    },
                    "code": {
                        "type": "string",
                        "description": "A stable, machine-readable error code.",
                        "enum": [
                            "invalid_api_key",
                            "api_key_in_query",
                            "ip_not_allowed",
                            "insufficient_scope",
                            "idempotency_key_required",
                            "idempotency_key_invalid",
                            "idempotency_key_reused",
                            "request_in_progress",
                            "validation_failed",
                            "not_found",
                            "method_not_allowed",
                            "rate_limited",
                            "insufficient_credits",
                            "credit_cap_reached",
                            "webhook_url_not_allowed",
                            "limit_reached",
                            "forbidden",
                            "bad_request",
                            "server_error"
                        ]
                    },
                    "detail": {
                        "type": "string",
                        "description": "What went wrong in this request."
                    },
                    "request_id": {
                        "type": "string",
                        "description": "Quote this when contacting support."
                    },
                    "errors": {
                        "type": "object",
                        "description": "Field errors, only on `validation_failed`.",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                },
                "required": [
                    "type",
                    "title",
                    "status",
                    "code",
                    "detail"
                ],
                "title": "Problem"
            },
            "StoreWebhookEndpointRequest": {
                "type": "object",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "An HTTPS URL on port 443 that resolves to a public address. @example https://example.com/webhooks/studio",
                        "maxLength": 2048
                    },
                    "events": {
                        "type": "array",
                        "description": "Event types to receive, or `[\"*\"]` for all.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "set.succeeded",
                                "set.failed",
                                "set.needs_confirmation",
                                "background.succeeded",
                                "background.failed",
                                "logo.succeeded",
                                "logo.failed",
                                "moderation.blocked",
                                "credits.low_balance",
                                "credits.purchased",
                                "api_key.revoked",
                                "*"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 20,
                        "uniqueItems": true
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    }
                },
                "required": [
                    "url",
                    "events"
                ],
                "title": "StoreWebhookEndpointRequest"
            },
            "WebhookEndpointResource": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "webhook_endpoint"
                    },
                    "id": {
                        "type": "string",
                        "examples": [
                            "we_01JD3XK5Z3Q8W3J9P2R7M4N6T1"
                        ]
                    },
                    "url": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "disabled"
                        ]
                    },
                    "livemode": {
                        "type": "boolean"
                    },
                    "secret": {
                        "type": "null",
                        "description": "Shown only once, in the response that creates the endpoint."
                    },
                    "disabled_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "object",
                    "id",
                    "url",
                    "description",
                    "events",
                    "status",
                    "livemode",
                    "disabled_at",
                    "created_at"
                ],
                "title": "WebhookEndpointResource"
            },
            "WebhookEventResource": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "event"
                    },
                    "id": {
                        "type": "string",
                        "description": "The same value as the `webhook-id` header. @example evt_01JD3XK5Z3Q8W3J9P2R7M4N6T1"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "set.succeeded",
                            "set.failed",
                            "set.needs_confirmation",
                            "background.succeeded",
                            "background.failed",
                            "logo.succeeded",
                            "logo.failed",
                            "moderation.blocked",
                            "credits.low_balance",
                            "credits.purchased",
                            "api_key.revoked",
                            "webhook.test"
                        ]
                    },
                    "livemode": {
                        "type": "boolean"
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": {}
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "object",
                    "id",
                    "type",
                    "livemode",
                    "data",
                    "created_at"
                ],
                "title": "WebhookEventResource"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            }
        }
    }
}