{
    "openapi": "3.0.0",
    "info": {
        "description": "Decentralized music platform API with dual authentication (Firebase JWT + Nostr NIP-98). Supports track management, image uploads, and legacy data access.",
        "title": "Wavlake API",
        "termsOfService": "https://wavlake.com/terms",
        "contact": {
            "name": "Wavlake Support",
            "url": "https://wavlake.com/support",
            "email": "support@wavlake.com"
        },
        "license": {
            "name": "MIT",
            "url": "https://opensource.org/licenses/MIT"
        },
        "version": "1.0"
    },
    "paths": {
        "/": {
            "get": {
                "description": "Returns API version, documentation links (the /api/docs spec alias, the machine-readable OpenAPI path, and the llms.txt agent guide), and available capabilities. Public endpoint for developer onboarding and service discovery.",
                "tags": [
                    "discovery"
                ],
                "summary": "API root discovery",
                "responses": {
                    "200": {
                        "description": "API information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/cmd_api.APIRootData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account/limits": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves the effective wallet limits for the authenticated user, including tier, limits, and upgrade path information. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "Get current user's wallet limits",
                "responses": {
                    "200": {
                        "description": "Wallet limits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.UserLimitsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account/status": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Checks if the authenticated user has a verified accounting account (Tier 3 status). This endpoint does NOT require account verification middleware, allowing Tier 2 users to check their status.",
                "tags": [
                    "accounting"
                ],
                "summary": "Get account verification status",
                "responses": {
                    "200": {
                        "description": "Account status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.AccountStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/accounts": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a new accounting account for a user (idempotent). Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "Create user account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateAccountRequest"
                            }
                        }
                    },
                    "description": "Account creation request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Account created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CreateAccountResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required or cannot create account for another user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/accounts/{userId}/balance": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves current balance for a user account. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "Get account balance",
                "parameters": [
                    {
                        "description": "User ID",
                        "name": "userId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Balance retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.GetBalanceResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid user ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required or cannot access another user's balance",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Account not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist-claims": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The requests for held artist names of the signing key's account (from any of its keys) and of the key itself, newest first (at most 50), each with its state, proof code, the act's own pages and staff's message when they asked for more or refused.",
                "tags": [
                    "artist-claims"
                ],
                "summary": "Your name requests",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimList"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Not signed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Opens a request for a name the reserved artist list holds, from the place the person hit the hold: an account name, a channel address, a wallet address or an artist credit. The name resolves to the act holding it the way the name check reads it (the handle rule for the three addresses, the exact credit key for a credit). Answers 201 with the request, including its proof code at once and the act's own pages where the code must be posted. Needs a linked account with a confirmed email (the answer comes by email; no address is stored). Changes nothing for anyone until staff decide it. At most one waiting request per act and account, and five new requests per account a day, whichever of the account's keys signs; a grant goes to the key that asked.",
                "tags": [
                    "artist-claims"
                ],
                "summary": "Ask for a held artist name",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimRequest"
                            }
                        }
                    },
                    "description": "The request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Opened",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimView"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Not signed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "CLAIM_EMAIL_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NAME_NOT_HELD",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CLAIM_AMBIGUOUS (details.acts) or CLAIM_ALREADY_OPEN (details.claim)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The list or the account directory could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist-claims/{id}": {
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The artist takes back a request that is still waiting, from any key of the request's account. Nothing they were granted before changes.",
                "tags": [
                    "artist-claims"
                ],
                "summary": "Withdraw a name request",
                "parameters": [
                    {
                        "description": "The request's id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimView"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CLAIM_NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CLAIM_NOT_OPEN",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist-claims/{id}/posted": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The artist says the request's code is up on one of the act's own pages, optionally where, from any key of the request's account. The request moves to posted for staff to check; it can be said again, with a new address, until staff decide.",
                "tags": [
                    "artist-claims"
                ],
                "summary": "Say your proof code is posted",
                "parameters": [
                    {
                        "description": "The request's id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimPostedRequest"
                            }
                        }
                    },
                    "description": "Where the code is"
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimView"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CLAIM_NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CLAIM_NOT_OPEN",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist-credits/availability": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers what POST /v1/tracks/nostr and POST /v1/releases would say about this one artist credit for this caller, without writing: `available`, or `artist_reserved` (held for a well-known artist; never says who has asked for it). Matching is exact on the credit's normalised form, look-alike letters included (a Cyrillic \"Т\" reads as a Latin \"T\"); a longer name containing an artist's is not held. The key holding a grant on the act, and a caller whose own legacy import carries the name, see `available`. A Firebase-only caller holds no key, so no grant. Tier2Auth (Firebase JWT or NIP-98), the same as the other name predictions.",
                "tags": [
                    "artist-credits"
                ],
                "summary": "Check whether an artist credit can be used",
                "parameters": [
                    {
                        "description": "The artist credit to check",
                        "name": "name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "What an upload carrying this credit would meet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.ArtistCreditAvailabilityResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The reserved artist list could not be read — never reported as free",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/albums/schedule": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a parent album row + N child track rows as a single atomic group. Each row carries its own pre-signed Nostr event. Validates signatures, kind/d-tag match, and created_at drift per row at submit time.",
                "tags": [
                    "Artist"
                ],
                "summary": "Schedule an album for future release (Phase 2 album groups)",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduleAlbumRequest"
                            }
                        }
                    },
                    "description": "Schedule album request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Scheduled album group created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduleAlbumResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "A music track's release hosting is not paid for (HOSTING_PAYMENT_REQUIRED, D146)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not content owner, or the album's d-tag is not a release id the API issued the caller nor a release they hold (RELEASE_ID_NOT_ISSUED, #5509)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Track already scheduled in another group, uploaded for another release (RELEASE_TRACK_MISMATCH), or an artist credit in a signed event is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "A child track is still processing (TRACK_NOT_READY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/content/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns content configuration including access mode and price for a specific track",
                "tags": [
                    "Artist"
                ],
                "summary": "Get content configuration",
                "parameters": [
                    {
                        "description": "Content ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Content configuration",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ContentConfigResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not content owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates content access mode and price for a specific track",
                "tags": [
                    "Artist"
                ],
                "summary": "Update content configuration",
                "parameters": [
                    {
                        "description": "Content ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.UpdateContentRequest"
                            }
                        }
                    },
                    "description": "Content update request",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Updated content configuration",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ContentConfigResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not content owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/content/{id}/schedule": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Schedule a track for future release at a specified date/time",
                "tags": [
                    "Artist"
                ],
                "summary": "Schedule a future release",
                "parameters": [
                    {
                        "description": "Content ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduleReleaseRequest"
                            }
                        }
                    },
                    "description": "Schedule release request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Scheduled release created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduleReleaseResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "A music track's release hosting is not paid for (HOSTING_PAYMENT_REQUIRED, D146)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not content owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Content already has a pending scheduled release, or an artist credit in the signed event is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Track is still processing (TRACK_NOT_READY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/deposits": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated artist's deposit purchase history, newest first. Pagination mirrors GET /artist/payouts (offset/limit). Every row today comes from a Stripe Checkout session; the response shape includes `source` and `external_id` so the deposit-top-up-methods PRD can extend it with Lightning/earnings rails without breaking the client. The pubkey is taken from the NIP-98 auth context only — any `?pubkey=` query parameter is ignored.",
                "tags": [
                    "Artist"
                ],
                "summary": "List artist deposit history",
                "parameters": [
                    {
                        "description": "Maximum number of deposits to return (default 20, max 100)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Number of deposits to skip (default 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Filter by status: pending, completed, or failed",
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Artist deposit history",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistDepositsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/earnings": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns earnings breakdown with tips, by-track analysis, and time-series data. When community_id is supplied, results are filtered to that community (creator-identity Phase 4); community_id=none selects content homed in no community. Stream counts include streams in every currency; money figures are USD only.",
                "tags": [
                    "Artist"
                ],
                "summary": "Get artist earnings analytics",
                "parameters": [
                    {
                        "description": "Start date (YYYY-MM-DD)",
                        "name": "start_date",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "End date (YYYY-MM-DD)",
                        "name": "end_date",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Optional scope: a community id (32 lowercase hex) for one community, or none for content homed in no community",
                        "name": "community_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Earnings analytics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EarningsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid date format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/feed-downloads": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns OP3's public download counts for up to 100 release feeds, by podcast guid. Downloads are requests for a file, not confirmed listens, and never affect streams or earnings. `available` is false when the counts cannot be read; a release OP3 does not know yet is left out.",
                "tags": [
                    "artist"
                ],
                "summary": "Read download counts for releases in podcast apps",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedDownloadsRequest"
                            }
                        }
                    },
                    "description": "The release feeds",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The counts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedDownloadsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "podcast_guids missing, malformed or over 100",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/feed-settings": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the account default (null when the key has never answered — absence is the opted-out state) and every per-release override. Precedence is override › account default › absent = off. Requires NIP-98 specifically: the settings are keyed by the signing pubkey.",
                "tags": [
                    "artist"
                ],
                "summary": "Read the RSS distribution settings for the signing key",
                "responses": {
                    "200": {
                        "description": "The current settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Lookup failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Upserts the account default. `enabled: true` REQUIRES a payable destination (D100 as amended): the signing key's newest Kind 0 on the Wavlake relay must carry a well-formed `lud16` — a missing profile, a missing field or a malformed value is 409 `DESTINATION_MISSING`; a Wavlake-domain name is accepted only when the caller holds the matching Spark authorization, otherwise 409 `DESTINATION_CUSTODIAL` (the legacy custodial address is refused); an unreachable relay is 503 and nothing is written. `enabled: false` checks nothing and is a RECORDED \"no\", deliberately distinct from never having answered. Content with its own override is unaffected. Returns the whole resulting state.",
                "tags": [
                    "artist"
                ],
                "summary": "Turn RSS distribution on or off for everything the signing key publishes",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsAccountRequest"
                            }
                        }
                    },
                    "description": "The switch",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "enabled missing or malformed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "DESTINATION_MISSING | DESTINATION_CUSTODIAL — enabled:true with no payable address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Write failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the destination check fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/feed-settings/owner-email": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Turns on, or changes, the address the key's feeds name as their owner (`<itunes:owner>`). Off is the default, for privacy, and the feeds then name Wavlake's support address. Anyone who reads a feed can see the address; podcast directories use it to contact the owner, for example to confirm a feed is theirs. The address is trimmed and must be one plain address — no display name, angle brackets, comment, whitespace, quoted part or IP-literal domain, at most 254 characters — else 400 with nothing written. No relay read and no payable-address check. Returns the whole resulting state.",
                "tags": [
                    "artist"
                ],
                "summary": "Put an email address in the signing key's feeds",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedOwnerEmailRequest"
                            }
                        }
                    },
                    "description": "The address",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "email missing, or not one plain address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Write failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Turns the owner email off: the row is deleted, so the address is not kept, and the key's feeds name Wavlake's support address again. Idempotent: turning off an address that is already off is a 200. Returns the whole resulting state.",
                "tags": [
                    "artist"
                ],
                "summary": "Take the email address out of the signing key's feeds",
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Delete failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/feed-settings/releases/{dTag}": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Upserts a per-release override, which takes precedence over the account default. The kind is fixed server-side to a release; the body carries the switch alone. The d-tag may contain colons. A d-tag the caller does not sign is inert — settings resolve against the content's own signing key — so no ownership check is made. `enabled: true` inherits the ACCOUNT's destination check (see the account-level PUT): 409 `DESTINATION_MISSING` / `DESTINATION_CUSTODIAL` without a payable address, 503 when the check cannot run; `enabled: false` checks nothing.",
                "tags": [
                    "artist"
                ],
                "summary": "Turn RSS distribution on or off for one release",
                "parameters": [
                    {
                        "description": "The release's `d` tag",
                        "name": "dTag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsOverrideRequest"
                            }
                        }
                    },
                    "description": "The switch",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid d-tag, or enabled missing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "DESTINATION_MISSING | DESTINATION_CUSTODIAL — enabled:true with no payable address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Write failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the destination check fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Deletes the per-release override. Idempotent: clearing an override that is not there is a 200, because \"inherit\" is the same state either way. Returns the whole resulting state.",
                "tags": [
                    "artist"
                ],
                "summary": "Remove a release's override so it follows the account default again",
                "parameters": [
                    {
                        "description": "The release's `d` tag",
                        "name": "dTag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid d-tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Delete failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/hosting/checkout": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Takes the release's hosting payment for exactly the amount due on the chosen method (D146): `stripe` opens a card checkout named \"Hosting for <release title>\" that expires after 35 minutes (an abandoned one reads \"Not completed\" in the history) — Stripe's hosted page at `checkout_url`, or, when the body asks `presentation: \"inline\"` and the server has the in-app card on for hosting, Stripe's form in the editor with `client_secret` (answered `Cache-Control: no-store`; `presentation` says which was made); `lightning` issues an invoice at the Lightning price (no discount since #4702); `earnings` pays from earnings at once; `credits` pays at once from the signer's bought credits (never membership credits, never counted toward the streaming cap; #4948). No top-up, cart, fee or minimum. A release that owes nothing (already paid, or new tracks its price already covers) is answered `status: \"paid\"` with no charge — a paid release is never charged again. Checkouts serialize per release: an earlier open card session for the release is expired first; a live Lightning invoice for the same amount and tracks is returned again instead of a second one, and any other checkout waits for it (409 HOSTING_PAYMENT_IN_PROGRESS). A completed payment marks the release's tracks paid; the publish confirms then accept the release and its audio is served.",
                "tags": [
                    "artist"
                ],
                "summary": "Pay for a release's hosting",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.ReleaseHostingCheckoutRequest"
                            }
                        }
                    },
                    "description": "The release, its tracks and the method",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Pending (card / Lightning) or paid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReleaseHostingCheckout"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed request or unknown method (INVALID_REQUEST), more than 30 tracks (RELEASE_TOO_MANY_TRACKS), or a card return origin off the allowlist (RETURN_ORIGIN_NOT_ALLOWED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Account frozen (ACCOUNT_FROZEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "A named track is not one of the signer's live rows, by row id or by published id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Earnings do not cover the price (INSUFFICIENT_BALANCE) or are still on hold (EARNINGS_HELD); bought credits do not cover it (INSUFFICIENT_CREDITS); an unpaid track was uploaded for another release or none (RELEASE_TRACK_MISMATCH) or its draft audio expired (AUDIO_EXPIRED); or an earlier payment for the release is still payable (HOSTING_PAYMENT_IN_PROGRESS — poll the quote). When that payment is an invoice nobody is known to have paid, `details.invoice_expires_at` says when it runs out; no other method is taken before then",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReleaseHostingPaymentInProgress"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daily card purchase cap reached (VELOCITY_CAP_EXCEEDED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The chosen method is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/hosting/checkout/confirm": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Called the moment Stripe's form in the editor says a card paid (inline Stripe payments PRD, FR6), and by Check again. Reads each of the release's pending card checkouts from Stripe and, when Stripe says one is complete and paid — and it is this signer's payment, for this release, amount and currency — completes it exactly as its webhook does (the release's tracks marked paid); an expired one is closed. Takes no outcome from the body: only Stripe's copy counts, and a Stripe read that fails decides nothing. Then answers the release's quote, as POST /artist/hosting/quote does. Idempotent; the webhook stays the guarantee. Rate-limited with the checkout.",
                "tags": [
                    "artist"
                ],
                "summary": "Check a release's card payment now",
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ReleaseHostingQuoteRequest"
                },
                "responses": {
                    "200": {
                        "description": "The release's price per method, after the check",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReleaseHostingQuote"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed request, or more than 30 tracks (RELEASE_TOO_MANY_TRACKS)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "A named track is not one of the signer's live rows, by row id or by published id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An unpaid track was uploaded for another release or none (RELEASE_TRACK_MISMATCH), or its draft audio expired (AUDIO_EXPIRED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many checkouts and checks this minute",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Hosting service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/hosting/quote": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Hosting is priced per release and paid at publish (D146; long-form priced like music until D78): $1 a track, capped at $10 for up to 15 tracks and $20 for 16–30; a release holds at most 30 tracks. Returns the price per method — card, earnings, bought credits, and Lightning at the configured discount — and what earlier payments for this release already cover, so a paid release owes nothing again and a grown one owes only the difference. Migrated tracks (D99) are never priced. A track is named by its row id or by its own published id (its d-tag, matched whole), among the signer's tracks only. The server decides the release's tracks: an unpaid track must have been uploaded for this release (its `release_d_tag`), and what is already paid is read from the release's own paid rows — the amount due is price(paid + new) − price(paid). Read-only; poll it after a card or Lightning checkout until `paid` is true.",
                "tags": [
                    "artist"
                ],
                "summary": "Price a release's hosting",
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ReleaseHostingQuoteRequest"
                },
                "responses": {
                    "200": {
                        "description": "The release's price per method",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReleaseHostingQuote"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed request, or more than 30 tracks (RELEASE_TOO_MANY_TRACKS)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "A named track is not one of the signer's live rows, by row id or by published id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An unpaid track was uploaded for another release or none (RELEASE_TRACK_MISMATCH), or its draft audio expired (AUDIO_EXPIRED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Hosting service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/payout-preferences": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the artist's default payout method and destination",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Get payout preferences",
                "responses": {
                    "200": {
                        "description": "Payout preferences",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PayoutPreferences"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates the artist's default payout method and destination (saving, changing or removing the payout address, or choosing the bank). A money action (#5861, D177): it needs a Firebase ID token AND NIP-98 from the key linked to that account, and a sign-in at most 5 minutes old — or a confirmed money-action \"Confirm it's you\" request in the `X-Wavlake-Confirmation` header, spent once.",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Update payout preferences",
                "parameters": [
                    {
                        "description": "A confirmed money-action request (#5322), spent in place of a fresh sign-in",
                        "name": "X-Wavlake-Confirmation",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.UpdatePayoutPreferencesRequest"
                            }
                        }
                    },
                    "description": "Preference update",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Preferences updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · NOSTR_AUTH_FAILED · REAUTH_REQUIRED (sign in again, then retry)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "PUBKEY_NOT_LINKED (the key is not the account's)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/payouts": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns paginated payout history for the authenticated artist",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "List payout history",
                "parameters": [
                    {
                        "description": "Maximum number of payouts (default 20, max 100)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Offset for pagination (default 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payout history",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PayoutListResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Initiates a new payout request for the authenticated artist after validating eligibility. A money action (#5861, D177): it needs a Firebase ID token AND NIP-98 from the key linked to that account, and a sign-in at most 5 minutes old — or a confirmed money-action \"Confirm it's you\" request in the `X-Wavlake-Confirmation` header, spent once.",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Create a payout request",
                "parameters": [
                    {
                        "description": "A confirmed money-action request (#5322), spent in place of a fresh sign-in",
                        "name": "X-Wavlake-Confirmation",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreatePayoutRequest"
                            }
                        }
                    },
                    "description": "Payout request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Payout created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Payout"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request or destination, or over the per-cash-out cap (PAYOUT_OVER_CAP, $250 by default)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · NOSTR_AUTH_FAILED · REAUTH_REQUIRED (sign in again, then retry)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "PUBKEY_NOT_LINKED (the key is not the account's); account too new, frozen, no registered account, or Lightning cash-outs on hold (PAYOUT_LIGHTNING_HELD)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Payout already pending",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "ACH-only: Stripe Connect onboarding incomplete; response includes resume_url for continuing onboarding",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.stripeConnectNotReadyResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Payout rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/payouts/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns details of a specific payout for the authenticated artist",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Get a single payout",
                "parameters": [
                    {
                        "description": "Payout ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payout details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Payout"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Payout not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/sale-price-bounds": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The configured price limits for a buy-to-own offer, in whole US cents: the floor for a track or a release, the ceiling for a track and for a release, and the fewest tracks a release needs for its own offer (a single is sold through its song). Platform config, not relay data — the studio mirrors it so it can name the range before it asks.",
                "tags": [
                    "artist"
                ],
                "summary": "Buy-to-own price bounds",
                "responses": {
                    "200": {
                        "description": "The bounds",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchasePriceBoundsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/scheduled": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns all scheduled releases for the authenticated artist",
                "tags": [
                    "Artist"
                ],
                "summary": "Get all scheduled releases",
                "responses": {
                    "200": {
                        "description": "Scheduled releases",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleasesListResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/scheduled/album/{id}": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates a pending album group (parent + children). Replaces the parent's pre-signed Kind 34139 event and/or scheduled_at.\nWhen scheduled_at is included, the parent and all child track rows are updated atomically in a single transaction.\nReturns 409 SCHEDULED_ALBUM_NOT_PENDING if any row in the group has transitioned out of `pending` (e.g. a child is mid-broadcast).\nEach validation branch returns a distinct error code (see API_RESPONSE_STANDARDS.md):\n- SCHEDULED_ALBUM_EVENT_INVALID_JSON / SCHEDULED_ALBUM_KIND_MISMATCH / SCHEDULED_ALBUM_DTAG_MISMATCH\n- SCHEDULED_ALBUM_SIGNATURE_INVALID / SCHEDULED_ALBUM_TIME_DRIFT / SCHEDULED_ALBUM_NOT_PENDING / SCHEDULED_ALBUM_FORBIDDEN / SCHEDULED_ALBUM_NOT_FOUND",
                "tags": [
                    "Artist"
                ],
                "summary": "Update a scheduled album group (studio-music-tab-redesign-v7 §11.3)",
                "parameters": [
                    {
                        "description": "Album parent release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.UpdateScheduleRequest"
                },
                "responses": {
                    "200": {
                        "description": "Updated album release",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleaseItem"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation failed (see error code)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the album owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled album not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Album group is no longer pending, or an artist credit in the new event is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Cancels a pending album group (parent + all still-pending children) in a single transaction. Already-broadcast child events are not recalled (Nostr is append-only).",
                "tags": [
                    "Artist"
                ],
                "summary": "Cancel a scheduled album group",
                "parameters": [
                    {
                        "description": "Album parent release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Group cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CancelScheduleResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not an album parent row or not pending",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/scheduled/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns details of a specific scheduled release, including the stored signed Nostr event so the artist UI can re-sign for a reschedule.",
                "tags": [
                    "Artist"
                ],
                "summary": "Get a scheduled release",
                "parameters": [
                    {
                        "description": "Scheduled release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled release details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleaseDetail"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates a pending scheduled release (time, notification settings)",
                "tags": [
                    "Artist"
                ],
                "summary": "Update a scheduled release",
                "parameters": [
                    {
                        "description": "Scheduled release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.UpdateScheduleRequest"
                },
                "responses": {
                    "200": {
                        "description": "Updated release",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleaseItem"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request or release not pending",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Cancels a pending scheduled release",
                "tags": [
                    "Artist"
                ],
                "summary": "Cancel a scheduled release",
                "parameters": [
                    {
                        "description": "Scheduled release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Release cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CancelScheduleResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Release is not pending",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/scheduled/{id}/cleanup": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Marks a non-pending scheduled release as cancelled so it stops showing in the Scheduled view.\nUse this for ghost rows whose underlying state (e.g. relay event) has drifted from the DB —\nfor example, a `published` row whose Nostr event was deleted out-of-band, a `broadcasting` row\nstuck after a worker crash, or a terminal `failed` row the artist wants removed from the dashboard.\nPending releases must go through the standard cancel flow. Already-cancelled rows succeed idempotently.\nDoes NOT publish a NIP-09 deletion — any Nostr event already on relays stays put.",
                "tags": [
                    "Artist"
                ],
                "summary": "Force-cleanup a non-pending scheduled release",
                "parameters": [
                    {
                        "description": "Scheduled release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Release cleaned up",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CancelScheduleResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Pending releases must be cancelled via the standard cancel flow",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/scheduled/{id}/retry": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Flips a `failed` release back to `pending` so the next Cloud Scheduler tick re-attempts the broadcast.\nClears retry state (publish_attempts, last_publish_error, broadcasting_at). The stored signed event is\nreplayed verbatim — NIP-33 dedup keeps this idempotent at the relay even if a prior attempt partially landed.\nOnly `failed` rows are retryable. Other states return 400. A row whose signed event names another home\nthan its release or track has now (it moved after failing) refuses the whole retry with 409 schedule_home_moved.",
                "tags": [
                    "Artist"
                ],
                "summary": "Retry a failed scheduled release",
                "parameters": [
                    {
                        "description": "Scheduled release ID",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Release queued for retry",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleaseItem"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Only failed releases can be retried",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A track of the album is already scheduled in another release (ALREADY_EXISTS), or the release or a track moved channel since it was signed (schedule_home_moved)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/splits": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns who each named track's earnings are shared with, from Wavlake's split record (the source of truth for money Wavlake settles: plays paid with credits, membership payouts and sales). Name each track with a `subject` query parameter, its address `<track-kind>:<your-pubkey>:<d-tag>`; repeat it for up to 50 tracks. A track with no split comes back with no recipients and version 0 (its owner is paid everything). Only your own tracks can be read. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Artist"
                ],
                "summary": "Read your tracks' splits",
                "parameters": [
                    {
                        "description": "Track address, repeatable (up to 50)",
                        "name": "subject",
                        "in": "query",
                        "required": true,
                        "explode": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SplitsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A subject is missing or not a track address (SPLIT_INVALID)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "A subject names another key (SPLIT_FORBIDDEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits are currently unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Saves who each listed track's earnings are shared with, for up to 50 tracks in one transaction: every track is saved or none is. Each recipient is a Wavlake account's hex pubkey OR an email, with a whole-number weight from 1 to 1,000,000; a track's shares are each weight over their sum, at most 20 people, nobody twice. Every email becomes an invite, whether or not it belongs to an account (the answer never says which): the invitee's share is held for them until they claim it. An artist can make up to 50 new invites a day. Wavlake's 10 % comes off first and the split divides what is left. An empty list, or you alone, puts the track back to paying you everything. You must own each track (a live track row signed by your key). Saving the same split again changes nothing. A split applies to plays from the moment it is saved; payouts already recorded are never re-split. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Artist"
                ],
                "summary": "Replace your tracks' splits",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.PutSplitsRequest"
                            }
                        }
                    },
                    "description": "The tracks and their new splits",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SplitsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The request breaks a split rule (SPLIT_INVALID)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "A track is not yours (SPLIT_FORBIDDEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits are currently unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Puts each named track back to paying you everything. Name each track with a `subject` query parameter (repeatable, up to 50); all are cleared in one transaction or none is. You must own each track. Payouts already recorded are not changed. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Artist"
                ],
                "summary": "Remove your tracks' splits",
                "parameters": [
                    {
                        "description": "Track address, repeatable (up to 50)",
                        "name": "subject",
                        "in": "query",
                        "required": true,
                        "explode": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SplitsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A subject is missing or not a track address (SPLIT_INVALID)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "A track is not yours (SPLIT_FORBIDDEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits are currently unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/splits/invites/{id}/resend": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Emails one of your pending split invites again. An invite is emailed when a save first names its address; this sends it again, at most once a day and five times in all, and an address gets at most five invite emails a day from everyone together. A send that fails still counts. The email never shows an amount. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Artist"
                ],
                "summary": "Send a split invite email again",
                "parameters": [
                    {
                        "description": "The invite's id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SplitInviteResendResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No pending invite of yours has this id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Sent less than a day ago, sent five times, or the address had enough invite emails today",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits or email are currently unavailable, or the email could not be sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/splits/received": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Lists the authenticated key's current shares in other people's published tracks, including tracks without earnings. Combines direct shares and claimed invites. No emails, other recipients or content metadata are returned. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Artist"
                ],
                "summary": "List music that shares earnings with you",
                "parameters": [
                    {
                        "description": "Next cursor returned by the previous page",
                        "name": "after",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceivedSplitsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid cursor",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits are currently unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/stats": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns comprehensive artist statistics including balance, stream counts, deposit status, and payout eligibility",
                "tags": [
                    "Artist"
                ],
                "summary": "Get artist statistics",
                "responses": {
                    "200": {
                        "description": "Artist statistics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistStatsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/streams": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns recent stream events for the artist's tracks, ordered by most recent first. A buy-to-own sale is never listed (its rows are not plays; the earnings read lists each sale once); a play by someone who bought the song is, with amount 0. When community_id is supplied, results are filtered to that community; community_id=none selects content homed in no community.",
                "tags": [
                    "Artist"
                ],
                "summary": "Get recent stream events",
                "parameters": [
                    {
                        "description": "Maximum number of streams to return (default 20, max 100)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Optional scope: a community id (32 lowercase hex) for one community, or none for content homed in no community",
                        "name": "community_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Recent streams",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StreamsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/stripe-connect/onboard": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns a fresh Stripe-hosted onboarding URL for the authenticated artist.\nIdempotent — repeat calls reuse the existing Stripe account and return a new link.\nAnswers 503 CONNECT_UNAVAILABLE when Stripe refuses Connect for the platform itself (for example, an incomplete Connect platform profile); no artist action fixes that.\nA money action (#5861, D177: the bank account is added or changed at Stripe): it needs a Firebase ID token AND NIP-98 from the key linked to that account, and a sign-in at most 5 minutes old — or a confirmed money-action \"Confirm it's you\" request in the `X-Wavlake-Confirmation` header, spent once.",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Start Stripe Connect onboarding",
                "parameters": [
                    {
                        "description": "A confirmed money-action request (#5322), spent in place of a fresh sign-in",
                        "name": "X-Wavlake-Confirmation",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.StripeConnectOnboardResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · NOSTR_AUTH_FAILED · REAUTH_REQUIRED (sign in again, then retry)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "PUBKEY_NOT_LINKED (the key is not the account's)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/stripe-connect/status": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated artist's Stripe Connect Express state (onboarding, charges_enabled, payouts_enabled). Returns 404 if the artist has not yet started onboarding.",
                "tags": [
                    "Artist Payouts"
                ],
                "summary": "Get Stripe Connect onboarding status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.StripeConnectStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/artist/tip-destination": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Resolves the CALLER's own tip destination and returns the full health report the studio \"Where your tips go\" card renders: the address, whether it is payable, and why not when it is not. Always resolved FRESH — never served from the affordance cache — because this is the moment an owner is looking at the screen where they would fix it. Reads only the caller's own public Nostr profile and that address's LNURL endpoint; writes nothing and stores nothing. Never 404s: an owner with no destination gets 200 with a null address and health.status \"none\". Requires a NIP-98 signature (Tier 1 — the data is the caller's own public profile); rate limited 10/min per pubkey AND 30/min per IP (Tier 1 admits any freshly generated key, so the per-pubkey cap alone resets with a new keypair), with a process-wide cap on concurrent outbound LNURL probes, so a refresh-mash cannot become a probe stream against a third-party LNURL provider. A destination that resolves into private or loopback address space is reported as `unreachable`/`connection_failed` like any other unreachable host — the specific reason is logged, never returned, so the report cannot be used as an internal-DNS oracle.",
                "tags": [
                    "artist"
                ],
                "summary": "Where your tips go — the owner's destination health report",
                "responses": {
                    "200": {
                        "description": "The caller's destination and its health",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TipDestinationResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audio/{dtag}": {
            "get": {
                "description": "Stream audio content by Nostr d-tag. A paywalled track is debit-then-serve: an unpaid GET returns the spend-contract v1 402 challenge, the listener debits 1 credit via POST /v1/audio/{dtag}/pay, then re-requests with the same X-Stream-Session. No payment is carried on this request and no bearer token is parsed. Identified listeners can provide identity for spending cap benefits via: (1) NIP-98 header (Authorization: Nostr), or (2) NIP-98 URL param (?auth=). Nothing else carries an identity: a request with ?pubkey=, ?sig=, ?t= or ?token= is anonymous.",
                "tags": [
                    "Audio"
                ],
                "summary": "Stream audio by d-tag (spend contract v1)",
                "parameters": [
                    {
                        "description": "Nostr d-tag identifier for the track",
                        "name": "dtag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "URL-encoded NIP-98 event for identity tracking (alternative to Authorization: Nostr header). Enables spending cap benefits for HTML audio elements.",
                        "name": "auth",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Set to the exact value 'true' to request the free preview excerpt (min(40s, track length)) instead of the full track. Paywalled tracks only; ignored on free/honor tracks. No payment, no stream is recorded. Any other value (including a bare flag, '1' or 'yes') is ignored. See docs/specs/paywall-spend-contract-v1.spec.md section 6.",
                        "name": "preview",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The embedded player's play pass from POST /v1/embed/pass (spend contract v1 section 6a). On a paywalled track, a valid pass for this track of a release still set to full songs and still out serves the full file with no debit and no stream recorded (Cache-Control: private, no-store; no X-Stream-Type, no X-Stream-Session). Checked after the explicit preview and every identity branch, immediately before the paid gate; an invalid or expired pass is ignored and the request gets the ordinary 402. Ignored entirely unless EMBED_ENABLED and EMBED_FULL_PLAY_ENABLED are both on.",
                        "name": "embed_pass",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "NIP-98 identity header (format: 'Nostr <base64-event>') for spending cap tracking. Does not carry payment tokens.",
                        "name": "Authorization",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Playback-session UUID. On a PAYG paid GET: the UUID already debited via POST /pay (the ?d= query param is the carrier for clients that cannot set headers). On a subscriber GET: optional — the server issues one when absent and echoes it when present.",
                        "name": "X-Stream-Session",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audio stream. A subscriber on a paywalled track is served the full file under skip-grace (X-Stream-Type: subscriber_grace) with a server-issued X-Stream-Session; the client debits it via POST /pay at 30s of non-skipped media time, or at completion for a sub-30s track. A listener who bought the track is served the full file with X-Stream-Type: owned and a server-issued X-Stream-Session, with no debit; the client confirms the play via POST /confirm with streamType owned at 30s heard.",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "206": {
                        "description": "Partial audio stream (Range request)",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing d-tag",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Payment required (spend contract v1 challenge), or a paywalled track whose owner has not paid their upload deposit (ARTIST_DEPOSIT_REQUIRED).",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found. Also the answer for a track its owner took down, to everyone but its owner and an account that already bought it.",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (100 requests/minute per IP)",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audio/{dtag}/confirm": {
            "post": {
                "description": "Confirms a playback after the 30s threshold (or onEnd for sub-30s tracks). streamType is required and must be free_access, free_tier, honor_paid, or honor_unpaid; the branch records an idempotent analytics row (NIP-98 optional). The session UUID is sent as stream_session_id (canonical, matching POST /pay) or sessionId (accepted alias). Replaying a session that is already recorded returns 200 and writes nothing. Paid streams confirm via POST /audio/{dtag}/pay instead.",
                "tags": [
                    "Audio"
                ],
                "summary": "Confirm a stream after 30s of listening",
                "parameters": [
                    {
                        "description": "Nostr d-tag identifier for the track",
                        "name": "dtag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.ConfirmRequest"
                            }
                        }
                    },
                    "description": "Confirm request with session ID and stream type",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Stream confirmed, or an idempotent replay of an already-recorded session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.ConfirmResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request, missing/unknown streamType, forged streamType, or a session UUID already used for another stream",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Content not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Replay lookup unavailable (fail-closed)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audio/{dtag}/pay": {
            "post": {
                "description": "Spend contract v1 (docs/specs/paywall-spend-contract-v1.spec.md §4). NIP-98-signed: the signing key IS the account. Debits the track price from the listener's server-side credit balance, records the paid stream, processes royalties, and returns the Kind 9444 receipt plus the remaining balance. Idempotent on (pubkey, stream_session_id): one session id is one play of one track — a replay of the same track returns 200 with a receipt and no second debit, while the same session id sent for a different track is rejected 400 with no debit. Fail-closed: a 503 means no debit occurred and no bytes will serve — retry with backoff. After a 200, GET /audio/{dtag} with `X-Stream-Session: <stream_session_id>` serves the full file.",
                "tags": [
                    "Audio"
                ],
                "summary": "Debit one stream from the listener's credit balance",
                "parameters": [
                    {
                        "description": "Nostr d-tag identifier for the track",
                        "name": "dtag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "NIP-98 auth (format: 'Nostr <base64-event>')",
                        "name": "Authorization",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.PaymentRequest"
                            }
                        }
                    },
                    "description": "Debit request: contract_version (SHOULD, 1), stream_session_id (MUST, UUIDv4), client (MAY, ≤64 chars)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Debited (or replayed): Kind 9444 receipt + balance_credits. When the creator has turned public receipts off, no receipt is signed (null) and data.settlement carries an unsigned summary instead. A listener who bought the track gets data.stream_type = owned instead: no debit, no receipt (null); re-request the audio.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.PaymentReceiptResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST (malformed body / non-UUID session / session already used for another stream) or UNSUPPORTED_CONTRACT_VERSION",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED — missing/invalid NIP-98 event",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "INSUFFICIENT_BALANCE (body repeats the v1 payment block + balance_credits; route to top-up), CAP_REACHED (not a failure: re-GET, the serve path grants free-tier access), or ARTIST_DEPOSIT_REQUIRED (the track's release is not published yet; nothing was debited)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NOT_FOUND — unknown d-tag, the track is not paywalled (nothing to debit), it was taken down, or its audio is gone; nothing was debited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CONFLICT — stream_session_id replayed with a different amount",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE — ledger unavailable; no debit occurred",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/check-pubkey-link": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Checks if the authenticated Nostr pubkey is linked to any Firebase account. Users can only check their own pubkey. Returns only the link status and the pubkey, never account details.",
                "tags": [
                    "auth"
                ],
                "summary": "Check if pubkey is linked to Firebase account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.CheckPubkeyLinkRequest"
                            }
                        }
                    },
                    "description": "Pubkey to check (must match authenticated pubkey)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Link status check result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.CheckPubkeyLinkResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request body",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid NIP-98 authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Attempted to check different pubkey",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/get-linked-pubkeys": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves all Nostr public keys linked to the authenticated user account, including when each was linked and last used. Accepts Firebase JWT or NIP-98 authentication via Tier2Auth middleware.",
                "tags": [
                    "auth"
                ],
                "summary": "Get all linked Nostr pubkeys",
                "responses": {
                    "200": {
                        "description": "List of linked pubkeys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.GetLinkedPubkeysData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to retrieve linked pubkeys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/has-published": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Checks whether the authenticated user's primary pubkey has published any content (tracks, albums, artist profiles) in the database or on Nostr relays. Used to determine if a primary key swap is still permitted.",
                "tags": [
                    "auth"
                ],
                "summary": "Check if primary pubkey has published content",
                "responses": {
                    "200": {
                        "description": "Publication status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.HasPublishedResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/key-change": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#6049. Answers for the signing key's own account. `state` is `none`, `music_cleared` (the music the move made is cleared; `deletions` is what the browser still deletes from the relay, signed by `from_pubkey`) or `finished` (a self-service change is answered only to the key the account moved off; a staff key change, `by_staff` true, to either key of it, with `deletions` naming the old key's moved coordinates: the new key re-signs the releases among them that are out, then the old key deletes them, #6205; the newest finished change that names the signing key wins). With `none`, `eligible` says whether the signing key may start, and `reasons` names every reason it may not, in a fixed order: not_main_key, no_moved_music, move_in_progress, own_music, music_on_another_key, earnings, hosting_fee, payout_preferences, payout_account, sales, purchases, membership, credits, balance_move_in_flight, wallet_address, splits, store, name_grant, account_hold. The read writes nothing. NIP-98 with a key linked to an account. 30 requests a minute per account. `wait_seconds`, when present, says an account that qualifies must still wait that long before it starts: the relay keeps who owns a track's audio for ten minutes after the old key's tracks last went out and would refuse the new key's inside them. `ask` (#6212), whatever the state, is staff's open ask to move the account to a new key (`to_pubkey`, `expires_at`, `consented`, `consent_expires_at`), answered only to the key it moves off and only while it can be confirmed or stands confirmed: the Studio's \"Confirm it's you\" card, confirmed with POST /auth/key-change/consent.",
                "tags": [
                    "auth"
                ],
                "summary": "Read where \"Use a different key\" stands, and whether this key qualifies",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required, or the key is not linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/key-change/cancel": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#6049. For a person who cannot carry on (the new key is lost, or they changed their mind) after the start-over. Drops the account's change, so the old key may start the move again; it brings nothing back by itself, and a channel already handed over is handed back by its new owner. A finished change is never undone (404). NIP-98 with any linked key of the account. 30 requests a minute per account.",
                "tags": [
                    "auth"
                ],
                "summary": "Keep the old key instead: drop a change whose music is cleared",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required, or the key is not linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "KEY_CHANGE_NOT_STARTED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/key-change/consent": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#6212 (ruled 2026-12-02). Staff ran accounts.key_change_ask after the person asked by email to move their account to a new key; GET /v1/auth/key-change answers that ask (`ask`) to the key it moves off. This records the person's consent: signed by the account's MAIN key (the one moving off), beside a Firebase ID token for the same account and a sign-in at most five minutes old (401 REAUTH_REQUIRED; a confirmed `key_change` \"Confirm it's you\" request in `X-Wavlake-Confirmation` stands in for a fresh token, spent once). Body `{to_pubkey}`: the ask's new key, which the signature covers. The consent lasts 24 hours; staff's accounts.key_change spends it, once. Confirming again while the ask stands renews it. 5 requests a minute per account.",
                "tags": [
                    "auth"
                ],
                "summary": "Confirm, with the old key, the key change staff asked about",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeConsentRequest"
                            }
                        }
                    },
                    "description": "The ask's new key",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeAsk"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST, or KEY_CHANGE_TARGET_INVALID: to_pubkey is not a 64-char hex key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED or REAUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KEY_CHANGE_KEY_NOT_LINKED: the signing key is not linked to this account; KEY_CHANGE_CONSENT_WRONG_KEY: the signing key is not the key the ask moves off",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "KEY_CHANGE_NO_ASK: staff have not asked, or the ask was used or replaced",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "KEY_CHANGE_ASK_MISMATCH: another new key than the ask's; KEY_CHANGE_ASK_EXPIRED: the ask's seven days ran out",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/key-change/finish": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#6049. The last server step of \"Use a different key\". No body: it finishes the account's own change, for the key the start-over named. It reads the Wavlake relay first and fails closed on it (503): the old key must own no channel (the relay-signed owner list), and the relay must hold none of the events the browser was asked to delete. Then, in ONE transaction, it re-checks that the new key is still an active sign-in key and that the old key holds no music and no money, and moves the account name (web address, NIP-05 and payment address), the name rows of the channels the new key now owns, and the main-key flag. In the same transaction it releases every Wavlake address the old key authorized to its wallet, and frees the account name's registration at the address server before committing (#6101): the address then answers \"not set up\" until the new key sets up its own, and never pays the old key's wallet. Anything missing is 409 KEY_CHANGE_NOT_READY with `details.reasons` (channels_not_handed_over with `details.channel_ids`, music_on_relay, new_key_not_linked, or any start-over reason that came true since) and nothing is moved. The old key stays a linked sign-in key. A repeat after it landed answers `finished`. NIP-98 with any linked key of the account. 30 requests a minute per account.",
                "tags": [
                    "auth"
                ],
                "summary": "Move the account name and the main-key flag to the new key",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required, or the key is not linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "KEY_CHANGE_NOT_STARTED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "KEY_CHANGE_NOT_READY; details.reasons names each reason",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeRefusedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "EXTERNAL_SERVICE_ERROR: the relay could not be read, or the account's Wavlake address could not be released from the old key's wallet (#6101); nothing was moved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/key-change/start-over": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#6049. The one destructive step of \"Use a different key\". Signed by the account's MAIN key (the one moving off), beside a Firebase ID token for the same account and a sign-in at most five minutes old (401 REAUTH_REQUIRED; a confirmed `key_change` request in `X-Wavlake-Confirmation` stands in for a fresh token). `to_pubkey` is the key to move onto: an active sign-in key of this account. In ONE transaction it re-checks that the account qualifies (409 KEY_CHANGE_NOT_ELIGIBLE with `details.reasons`, and nothing is changed), runs the operator reset's own statements (the account's import-origin music only, never a Studio upload; the podcast guids of exactly those rows are released), and records what the browser must delete from the relay. The answer's `deletions` is that work: the browser signs the deletion with the old key, since Wavlake holds no keys. From then on the old key can no longer start the move (409 MIGRATION_KEY_REPLACED). A repeat while the change is under way answers what was recorded, may name another `to_pubkey`, and never clears anything again. 5 requests a minute per account.",
                "tags": [
                    "auth"
                ],
                "summary": "Clear the music an old account's move made, to move it again under another key",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeStartOverRequest"
                            }
                        }
                    },
                    "description": "The key to move onto",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST, or KEY_CHANGE_TARGET_INVALID: the new key is malformed, the key signing, not this account's, or a key the account moved off",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED or REAUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KEY_CHANGE_KEY_NOT_LINKED: the signing key is not linked to this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "KEY_CHANGE_NOT_ELIGIBLE; details.reasons names each reason. Or KEY_CHANGE_TOO_SOON: the account qualifies and the old key's tracks went out under eleven minutes ago; details.retry_after_seconds (models.KeyChangeWaitDetails) and Retry-After say when to ask again. Nothing was changed either way",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeRefusedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/link-pubkey": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Links a Nostr public key to the authenticated Firebase user account. Requires both Firebase JWT token and NIP-98 Nostr signature, and a JSON body naming the account (firebaseUid) that the NIP-98 payload hash covers, so the signature cannot be used with another account's token. The signed NIP-98 event's content must be exactly the sentence naming the account, KeyBindingSentencePrefix followed by the token's email with the part before the last @ shortened to its first character (\"Add this sign-in key to the Wavlake account for j…@example.com\"), so the signer's prompt tells the person which account the key is going to. Once linked, the Nostr pubkey can be used for authentication on NIP-98 protected endpoints. Creates the user record when the Firebase account has none, so, like /auth/register, it requires the token's email to be present and verified.",
                "tags": [
                    "auth"
                ],
                "summary": "Link Nostr pubkey to Firebase account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.LinkPubkeyRequest"
                            }
                        }
                    },
                    "description": "firebaseUid (required, must match the token's uid) and pubkey (optional, must match the authenticated pubkey). The body must be covered by the NIP-98 payload hash.",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Pubkey successfully linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LinkPubkeyData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No signed body, a body with no firebaseUid, a firebaseUid that is not the token's, a pubkey mismatch, or a signed event whose content is not the sentence naming the token's account (code=INVALID_REQUEST)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token email absent or not verified (code=FORBIDDEN), or the account or key is on hold: frozen or barred from buying (code=ACCOUNT_FROZEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Pubkey is already linked to a different Firebase account (code=PUBKEY_ALREADY_LINKED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded - includes Retry-After header (seconds)",
                        "headers": {
                            "Retry-After": {
                                "description": "Seconds until next allowed request (e.g., 720 for 12 minutes)",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/passkey-credentials": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records the WebAuthn credential id the signing key was derived from, so the account's owner can later steer the passkey prompt to that account's own passkey. The key must be linked to an account. Idempotent; at most ten credentials are kept per key, newest by use.",
                "tags": [
                    "auth"
                ],
                "summary": "Record the passkey a sign-in key was proven with",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.RecordPasskeyCredentialRequest"
                            }
                        }
                    },
                    "description": "The credential id, base64url without padding",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.RecordPasskeyCredentialData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed credential id (code=INVALID_REQUEST)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid NIP-98 signature, or a key with no account (code=PUBKEY_NOT_LINKED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded - includes Retry-After header (seconds)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The credential could not be recorded (code=DATABASE_ERROR)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Recording is not available (code=SERVICE_UNAVAILABLE)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/pubkey-status": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Tier-1 NIP-98 endpoint. Returns `{ linked: true }` if the signing pubkey is already linked to a Firebase account, `{ linked: false }` when it has no active link (no row, or an unlinked one); a lookup failure is a 500, never `linked: false`. The pubkey under inspection is derived from the NIP-98 signature — callers cannot probe arbitrary pubkeys. Response surface is intentionally minimal (no email, no Firebase UID, no timestamps) to prevent enumeration of linked-account metadata by holders of stolen public keys.",
                "tags": [
                    "auth"
                ],
                "summary": "Check whether the authenticated pubkey is linked to a Firebase account",
                "responses": {
                    "200": {
                        "description": "Link status of the authenticated pubkey",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.PubkeyStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid NIP-98 authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error (the link could not be looked up)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/register": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Registers a new user by linking a Firebase account to a Nostr pubkey (hex format). Requires both Firebase JWT authentication (Authorization header) and NIP-98 Nostr signature (X-Nostr-Authorization header), and a JSON body naming the account (firebaseUid) that the NIP-98 payload hash covers, so the signature cannot be used with another account's token. The signed NIP-98 event's content must be exactly the sentence naming the account, KeyBindingSentencePrefix followed by the token's email with the part before the last @ shortened to its first character (\"Add this sign-in key to the Wavlake account for j…@example.com\"), so the signer's prompt tells the person which account the key is going to. Creates user record with artist tier and sets custom claims. IDEMPOTENT: Returns existing user data if Firebase UID already registered with the same pubkey.",
                "tags": [
                    "auth"
                ],
                "summary": "Register new user account (idempotent)",
                "parameters": [
                    {
                        "description": "Firebase ID token",
                        "name": "Authorization",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "default": "Bearer <token>"
                        }
                    },
                    {
                        "description": "NIP-98 Nostr event signature",
                        "name": "X-Nostr-Authorization",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "default": "Nostr <base64_event>"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.RegisterRequest"
                            }
                        }
                    },
                    "description": "firebaseUid (required, must match the token's uid) and pubkey (optional, must match the authenticated pubkey). The body must be covered by the NIP-98 payload hash.",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Registration successful (or user already exists with same pubkey - idempotent)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.RegisterData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No signed body, a body with no firebaseUid, a firebaseUid that is not the token's, a pubkey mismatch, or a signed event whose content is not the sentence naming the token's account (code=INVALID_REQUEST); invalid pubkey format (must be 64 hex characters)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Email verification required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Pubkey already registered to a different Firebase UID (code=PUBKEY_ALREADY_LINKED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to complete registration",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/swap-primary": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Swaps the authenticated user's primary pubkey to a different pubkey that is already linked to their account. Permanently blocked once any content has been published (409 CONFLICT). Also refused while the current main key holds money or settings keyed to it — a hosting or earnings balance, payout preferences, a payout (Stripe Connect) account, an owned channel, or the account name (web address, NIP-05 and Lightning address, which would keep resolving to the old key) — because the swap moves only the main-key flag and those would stay behind: 409 PRIMARY_KEY_HOLDS_STATE with `details.reasons` naming each (hosting_balance, earnings_balance, payout_preferences, payout_account, owned_channels, account_name).",
                "tags": [
                    "auth"
                ],
                "summary": "Swap primary pubkey",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SwapPrimaryRequest"
                            }
                        }
                    },
                    "description": "New primary pubkey (must be linked to account)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Primary key swapped successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SwapPrimaryResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request or pubkey not linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CONFLICT: published content exists. PRIMARY_KEY_HOLDS_STATE: the main key holds money or settings; details.reasons names each",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SwapPrimaryRefusedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/terms-acceptance": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers whether the signing key agreed to the Terms version named by `terms_version` (the date the Terms carry), and when. NIP-98 Tier 1.",
                "tags": [
                    "auth"
                ],
                "summary": "Whether I agreed to the Terms",
                "parameters": [
                    {
                        "description": "The Terms version, e.g. October 16, 2026",
                        "name": "terms_version",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Whether the key agreed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TermsAcceptanceResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid Terms version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Saves that the signing key agreed to one version of the Terms (the date the Terms carry, e.g. \"October 16, 2026\"). The key is the NIP-98 signer — never a body field; Tier 1 is enough. Idempotent per key and version: the first agreement answers 201, every later one 200 with the first agreement, and nothing is written again. Internal operations only; this is not a relay event.",
                "tags": [
                    "auth"
                ],
                "summary": "Agree to the Terms",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.TermsAcceptanceRequest"
                            }
                        }
                    },
                    "description": "The Terms version agreed to",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Already agreed to this version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TermsAcceptanceResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Agreed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TermsAcceptanceResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid body or Terms version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The agreement could not be saved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/unlink-pubkey": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    }
                ],
                "description": "Removes the link between a Nostr public key and the authenticated Firebase user account. After unlinking, the pubkey can no longer be used for authentication.",
                "tags": [
                    "auth"
                ],
                "summary": "Unlink Nostr pubkey from Firebase account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UnlinkPubkeyRequest"
                            }
                        }
                    },
                    "description": "Pubkey to unlink",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Pubkey successfully unlinked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.UnlinkPubkeyData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request or pubkey not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid Firebase authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/backups": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Lists all Nostr event metadata backups for the authenticated user, ordered by most recently updated first.",
                "tags": [
                    "backups"
                ],
                "summary": "List backups",
                "responses": {
                    "200": {
                        "description": "List of backups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to retrieve backups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates or updates a Nostr event metadata backup. Pubkey is resolved server-side from auth context. Uses ON CONFLICT upsert on (pubkey, nostr_kind, nostr_d_tag). The store never goes backwards: a stored backup is replaced only by a newer event — a later event_created_at, or on a same-second tie the lower event_id (strfry's rule for a replaceable event). An older or identical event, or a same-second one without event_id, answers 200 with the stored backup and writes nothing. event_id is optional (64 hex characters).",
                "tags": [
                    "backups"
                ],
                "summary": "Upsert backup",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UpsertBackupRequest"
                            }
                        }
                    },
                    "description": "Backup data",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Backup upserted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to upsert backup",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/portal": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a Stripe Billing Portal session for self-service billing management.\nAllows users to manage subscriptions, update payment methods, and view invoices.\nRequires the user to have an existing Stripe customer ID.\nThe optional `return_origin` query parameter (the calling client's origin) sends the person back to that origin on the configured return path when it exactly matches an entry of the API's return-origin allowlist; any other value is refused with 400 `RETURN_ORIGIN_NOT_ALLOWED`. Absent, the configured return URL applies unchanged.",
                "tags": [
                    "billing"
                ],
                "summary": "Create Stripe billing portal session",
                "parameters": [
                    {
                        "description": "Calling client's origin, e.g. https://beta.wavlake.com (must be allowlisted)",
                        "name": "return_origin",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Portal session created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.BillingPortalResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No Stripe customer ID on account (INVALID_REQUEST), or a return_origin that is not allowlisted (RETURN_ORIGIN_NOT_ALLOWED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/channels/shows/import/bandsintown": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Asks Bandsintown for the artist's upcoming events with the artist's OWN Bandsintown key and returns them as plain tour date rows. Stores nothing and publishes nothing: the studio's Bandsintown connection calls this on every check, and the client saves the dates the artist adds. The server uses the key for this request only — never stores, logs or returns it (the client keeps its own encrypted copy); Bandsintown's links echo it, so the server strips it from every link. Requires NIP-98 specifically. An event with no date is skipped; an empty list means no upcoming shows. Field mapping is from Bandsintown's published v3 spec and unconfirmed against a live answer (#5114).",
                "tags": [
                    "channels"
                ],
                "summary": "Read an artist's upcoming Bandsintown events as tour date rows",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ImportBandsintownShowsRequest"
                            }
                        }
                    },
                    "description": "The Bandsintown artist name and the artist's own key",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The upcoming events as rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ImportBandsintownShowsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST — a name or key missing, too long, or with control characters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_key — Bandsintown refused the key | unknown_artist — no Bandsintown artist by that name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many imports",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "unavailable — Bandsintown didn't answer, or answered with something unusable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/channels/shows/import/bandsintown/artist": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Looks the artist up on Bandsintown with the artist's OWN key and returns who Bandsintown found (its id, name, picture, page link and number of upcoming dates), for the artist to confirm before the Studio keeps the connection (#5867). `artist` is the artist's Bandsintown page link (`bandsintown.com/a/<number>-<slug>`, read as Bandsintown's id) or their name. A link to anything other than an artist's page is refused without asking Bandsintown. Stores nothing; the key is used for this request only and never stored, logged or returned, and neither is the artist field. Requires NIP-98 specifically. Field mapping is from Bandsintown's published v3 spec and unconfirmed against a live answer.",
                "tags": [
                    "channels"
                ],
                "summary": "Find who an artist is on Bandsintown, before connecting",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FindBandsintownArtistRequest"
                            }
                        }
                    },
                    "description": "The artist's Bandsintown page link or name, and their own key",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Who Bandsintown found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FindBandsintownArtistResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST — the artist or key missing, too long, or with control characters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_key — Bandsintown refused the key | unknown_artist — no Bandsintown artist by that name or link | not_artist_page — a link that isn't a Bandsintown artist's page",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "unavailable — Bandsintown didn't answer, or answered with something unusable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/communities": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Reserves the URL slug `wavlake.com/<slug>` for a community the caller owns. A community's name is routing only — no NIP-05 attestation, no Lightning address, no payment surface (D84); the `<name>@wavlake.com` pointer set is one per account. The caller's ownership is proven by reading the channel's relay-signed description (kinds 39000/39001, trusted only from the relay's own key) off the Wavlake relay — a signed event in the request body would prove nothing, since any key can sign an edit for any id. Re-registering the same community with a different slug renames it and retires the old slug for redirects. Requires NIP-98 (Tier 2).",
                "tags": [
                    "communities"
                ],
                "summary": "Reserve a community's name",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.RegisterCommunityRequest"
                            }
                        }
                    },
                    "description": "Community id and slug",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The community's name reservation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Verification"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed community id, slug, or a slug that does not match the channel's published one",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized, or not signed with a key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The caller is not the community's current owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "NOT_ON_RELAY, SLUG_TAKEN (a blocked name included), NAME_RESERVED (reserved route name, or a name an existing Wavlake account holds — D132), ARTIST_NAME_RESERVED (the address, or a new channel's display name, is held for a well-known artist; details: field `slug` or `channel_name`, the name as submitted or as the channel carries it), or the community's name row belongs to another account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be reached, or the existing-account check or the reserved artist list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/communities/availability": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers what POST /v1/communities would say about the NAME for this caller, without reserving it: `available`, `taken` (an account name or another community holds it — the caller's own account name included, and a blocked name too), `reserved` (a route word or the static legacy list), `legacy_reserved` (an existing Wavlake account holds it — never says whose; that account's holder sees `available`) or `artist_reserved` (held for a well-known artist; the key holding the act's grant sees `available`). It does not check the community itself: ownership and the definition's slug are still the registration's relay read. Requires NIP-98 (Tier 2), as the registration does.",
                "tags": [
                    "communities"
                ],
                "summary": "Check whether a slug can be taken as a community's name",
                "parameters": [
                    {
                        "description": "The slug to check",
                        "name": "slug",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "What a registration of this slug would meet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.CommunitySlugAvailabilityResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed slug",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized, or not signed with a key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The name rows could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The existing-account check or the reserved artist list could not be read — never reported as free",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/communities/{id}/deleted": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retires a community's name after its owner deleted the channel on the relay. Routing stops; the name itself is never freed and can never be re-registered. Requires NIP-98 (Tier 2).",
                "tags": [
                    "communities"
                ],
                "summary": "Report that a community was deleted",
                "parameters": [
                    {
                        "description": "Community id (32 lowercase hex characters)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The name was retired",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed community id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized, or not signed with a key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The caller is not the community's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "This community has no name reservation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/communities/{id}/merch": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The requests waiting for the owner's answer, newest first, and the accepted connection if there is one. Requests from a disabled store are left out. NIP-98, Tier 2; the caller must be the channel's current owner on the Wavlake relay (403 when not, 409 NOT_ON_RELAY when the relay holds no such channel, 503 when it cannot be read). Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "The merch requests on a channel the caller owns",
                "parameters": [
                    {
                        "description": "Channel (community) id, 32 hex",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The channel's requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchChannelRequests"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A malformed channel id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "NOT_ON_RELAY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/creators/{pubkey}/destination": {
            "get": {
                "description": "Returns the Lightning address a creator is currently payable at, derived at request time from the `lud16` on that account key's public Nostr profile and validated live against the address's own LNURL-pay endpoint. Wavlake stores no destination for anyone and this endpoint exposes only what the creator already published to a public relay. Answers 404 — never an empty 200 — whenever the creator is not payable, for every reason alike (unknown or malformed pubkey, no profile, no address published, or an address whose endpoint is unreachable or unusable). The response BODY is identical for every unpayable reason; timing is NOT equalised (a cached hit is instant, a relay miss costs one bounded round trip). The whole answer is bounded at four seconds; an answer that could not be finished in that time is the same 404 and is not cached. The amount bounds are the destination's OWN advertised LNURL range; Wavlake adds none. Public, no auth; rate limited 60/min per IP.",
                "tags": [
                    "creators"
                ],
                "summary": "Resolve a creator's public tip destination",
                "parameters": [
                    {
                        "description": "Creator account pubkey (64-char lowercase hex)",
                        "name": "pubkey",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The creator's payable Lightning address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreatorDestinationResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "DESTINATION_NOT_FOUND — no payable destination, for any reason",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/credit-packs": {
            "get": {
                "description": "Returns available credit pack options and custom amount bounds.\nThis is a public endpoint with no authentication required.",
                "tags": [
                    "stripe"
                ],
                "summary": "Get available credit packs",
                "responses": {
                    "200": {
                        "description": "Credit packs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.GetCreditPacksResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/deposits": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Initiates a deposit via Lightning invoice. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "Create deposit",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateDepositRequest"
                            }
                        }
                    },
                    "description": "Deposit creation request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Deposit created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CreateDepositResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required or cannot create deposit for another user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/embed/pass": {
            "post": {
                "description": "Public and unsigned; cross-origin calls are accepted only from the player's hosts. For one track of a release whose player is set to full songs, and one play session (a UUIDv4), answers play \"full\" with a pass and its expiry (EMBED_PASS_TTL, 30 minutes to start), or play \"excerpt\" with neither — when a limit is reached (full plays per visitor per hour, per visitor per song per day, per song per hour), when the limit store cannot be read, or when the release no longer plays this song in full (set back to excerpt or off, not out, taken down, or a song that needs no pass). The answer never says which. The pass is signed and stored nowhere; it is bound to the track, the release, the play session and its expiry. It goes on GET /v1/audio/{dtag}?embed_pass= and on POST /v1/embed/plays. It moves no money and records no stream. Registered only when EMBED_ENABLED and EMBED_FULL_PLAY_ENABLED are both on; otherwise 404 NOT_FOUND.",
                "tags": [
                    "embed"
                ],
                "summary": "A pass to play one paid song in full in the player on another website",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPassRequest"
                            }
                        }
                    },
                    "description": "The track and the play session",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "A pass, or play the excerpt",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPassResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A malformed field",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NOT_FOUND when EMBED_ENABLED or EMBED_FULL_PLAY_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/embed/plays": {
            "post": {
                "description": "Public and unsigned; cross-origin calls are accepted only from the player's hosts. The player sends it once 30 seconds have been heard. Idempotent on play_session_id (a UUIDv4): a repeat answers recorded=false and records nothing. Refused with 404 EMBED_NOT_AVAILABLE for a track that is not in a release whose player is on and that is out. played is \"full\" or \"excerpt\"; \"full\" is refused for a track that plays as an excerpt, and for a track that needs a pass unless pass is a valid pass for the same track and play session. host is the framing page's host name only; a full address is refused. Writes the separate embedded-play count and nothing else: no stream, no royalty, no receipt, no balance or cap change. Rate limited per visitor. Answers 404 NOT_FOUND when EMBED_ENABLED is unset.",
                "tags": [
                    "embed"
                ],
                "summary": "Record one play in the player on another website",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPlayRequest"
                            }
                        }
                    },
                    "description": "The play",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Recorded, or already recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPlayResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A malformed field, a host that is not a host name, or full for an excerpt track",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "EMBED_NOT_AVAILABLE — the track cannot play in an embed; or NOT_FOUND when EMBED_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Write failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The shared rate limit store is unreachable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/embed/release": {
            "get": {
                "description": "Public and unsigned; cross-origin calls are accepted only from the player's hosts (EMBED_ALLOWED_ORIGINS). Returns the release's mode and, for each track that can play, in the release's own order, whether it plays \"full\" or as an \"excerpt\", and whether it needs a play pass (needs_pass: a paid song longer than 40 seconds in full-songs mode; the player asks POST /v1/embed/pass first). A stored \"full\" answers \"excerpt\" while EMBED_FULL_PLAY_ENABLED is off. Every case with nothing to play — the setting is off, the release is unknown, a draft, scheduled and not yet live, its hosting unpaid, or taken down — gets the same 404 EMBED_NOT_AVAILABLE. The d-tag may contain colons. Rate limited per visitor. Answers 404 NOT_FOUND when EMBED_ENABLED is unset.",
                "tags": [
                    "embed"
                ],
                "summary": "What the player on another website may play of a release",
                "parameters": [
                    {
                        "description": "The release signer's hex key (64 lowercase characters)",
                        "name": "pubkey",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The release's d-tag (colons allowed)",
                        "name": "d",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "What may play",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedReleaseResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "EMBED_NOT_AVAILABLE — nothing to play; or NOT_FOUND when EMBED_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Lookup failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/feed-audio/{pubkey}/{release}/{track}": {
            "get": {
                "description": "The address a release's RSS feed gives as a track's enclosure. It plays with no credential, paid songs included, only while the release is distributed as RSS: the release is out, lists the track as its signer's own, and its opt-in is on, read on every request. An opt-out, a take-down, a deletion or expired audio stops it at once, with the same 404 as an address that never existed. Serves the compressed MP3 with Range support and Cache-Control private, no-store. No identity is read and nothing is recorded: no debit, no stream, no receipt. The release and track segments are unpadded base64url d-tags, the track's followed by .mp3; apps/feeds writes this address, and it is not meant to be built by hand.",
                "tags": [
                    "Audio"
                ],
                "summary": "Stream an opted-in release's track for a podcast app",
                "parameters": [
                    {
                        "description": "The release signer's hex public key (64 lowercase hex characters)",
                        "name": "pubkey",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The release's d-tag, unpadded base64url",
                        "name": "release",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The track's d-tag, unpadded base64url, followed by .mp3",
                        "name": "track",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "A single byte range, for example bytes=0-1",
                        "name": "Range",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The whole file",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "206": {
                        "description": "The requested byte range",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not available: unknown, malformed, not opted in, not in that release, taken down, deleted or expired. These are one answer on purpose.",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "416": {
                        "description": "Range not satisfiable",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (100 requests/minute per IP, shared with /audio)",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The file could not be read",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Whether the release is opted in could not be read; retry",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "head": {
                "description": "The address a release's RSS feed gives as a track's enclosure. It plays with no credential, paid songs included, only while the release is distributed as RSS: the release is out, lists the track as its signer's own, and its opt-in is on, read on every request. An opt-out, a take-down, a deletion or expired audio stops it at once, with the same 404 as an address that never existed. Serves the compressed MP3 with Range support and Cache-Control private, no-store. No identity is read and nothing is recorded: no debit, no stream, no receipt. The release and track segments are unpadded base64url d-tags, the track's followed by .mp3; apps/feeds writes this address, and it is not meant to be built by hand.",
                "tags": [
                    "Audio"
                ],
                "summary": "Stream an opted-in release's track for a podcast app",
                "parameters": [
                    {
                        "description": "The release signer's hex public key (64 lowercase hex characters)",
                        "name": "pubkey",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The release's d-tag, unpadded base64url",
                        "name": "release",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "The track's d-tag, unpadded base64url, followed by .mp3",
                        "name": "track",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "A single byte range, for example bytes=0-1",
                        "name": "Range",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The whole file",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "206": {
                        "description": "The requested byte range",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not available: unknown, malformed, not opted in, not in that release, taken down, deleted or expired. These are one answer on purpose.",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "416": {
                        "description": "Range not satisfiable",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (100 requests/minute per IP, shared with /audio)",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The file could not be read",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Whether the release is opted in could not be read; retry",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/feedback": {
            "post": {
                "description": "Privately report a bug, missing capability, or documentation gap. No authentication required, including for auth failures. Send a fresh UUID v4 submission_id; retry identical content with the same ID. Acceptance confirms storage only. Maximum 16 KiB, 5 requests/hour/IP and 1000 requests/day globally (shared in production). Do not include credentials, personal data, raw headers or conversation transcripts. Route must be a path without query/fragment. All submissions are untrusted and reviewed before any external issue or coding task.",
                "tags": [
                    "feedback"
                ],
                "summary": "Submit API feedback",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedbackSubmission"
                            }
                        }
                    },
                    "description": "Structured feedback",
                    "required": true
                },
                "responses": {
                    "202": {
                        "description": "Durably received, including identical retries",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedbackReceipt"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid feedback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Submission ID reused with different content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Payload too large",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited; observe Retry-After",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Intake temporarily unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/feedback/reports": {
            "post": {
                "description": "Stores a problem report from the app's \"Report a problem\" button: what happened, the context the app attaches (page path, build, browser, screen size, recent console errors) and an optional screenshot (base64; JPEG, PNG or WebP, at most 1.5 MiB). Anonymous reports are accepted; when the request carries a valid NIP-98 signature the report records the signer's key. The key is never read from the body. Reports and screenshots are private: nothing here is ever public. Rate-limited per signer or per IP.",
                "tags": [
                    "feedback"
                ],
                "summary": "Report a problem from the app",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedbackReportRequest"
                            }
                        }
                    },
                    "description": "The report",
                    "required": true
                },
                "responses": {
                    "202": {
                        "description": "Stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedbackReportReceipt"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid report",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Report or screenshot too large",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited; observe Retry-After",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Reports temporarily unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/grid/setup-withdrawals": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Provisions a Lightspark Grid customer for the authenticated user so they can later withdraw to a bank account. Idempotent: repeated calls return the same Grid customer without creating a duplicate. Requires a registered account (Tier 2+); a user with no account row is rejected with 403. KYC adjudication and the actual off-ramp money movement are handled by separate, later flows. Returns 503 when the Grid off-ramp is not configured in this environment.",
                "tags": [
                    "accounting-grid"
                ],
                "summary": "Set up bank withdrawals (provision a Grid customer)",
                "responses": {
                    "200": {
                        "description": "Grid customer provisioned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.GridSetupWithdrawalsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Account registration required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (10 requests per minute per user)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Grid off-ramp not available",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/hosting/promo/claim": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Spends a one-use free hosting link (D174) on the signing key: from its next publish, its releases owe no hosting fee for the link's terms, counted from now. A key that already has free hosting lasting at least as long keeps it (`kept_existing`); the link is spent all the same. Claiming again with the same key answers the same (`again`); any other key is refused.",
                "tags": [
                    "hosting"
                ],
                "summary": "Claim a free hosting link",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.HostingPromoClaimRequest"
                            }
                        }
                    },
                    "description": "The link's code",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "What the claim gave",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.HostingPromoClaimResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98), or the key is not linked to an account (PUBKEY_NOT_LINKED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No link has that code (PROMO_LINK_NOT_FOUND)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Another account claimed it (PROMO_LINK_USED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "Nobody claimed it in time (PROMO_LINK_EXPIRED), or it was cancelled (PROMO_LINK_CANCELLED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/hosting/promo/{code}": {
            "get": {
                "description": "A one-use free hosting link (D174), by its code: whether it can still be claimed (`open`, `claimed`, `expired`, `cancelled`) and how long the free hosting lasts once claimed (`free_for_days`; absent is no end date). Never who it was made for or who claimed it. Public; rate-limited per IP.",
                "tags": [
                    "hosting"
                ],
                "summary": "Read a free hosting link",
                "parameters": [
                    {
                        "description": "The link's code (22 letters and digits)",
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The link's state and terms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.HostingPromoStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No link has that code (PROMO_LINK_NOT_FOUND)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/images/my": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves all images owned by the authenticated user. Optional filtering by image type. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status).",
                "tags": [
                    "images"
                ],
                "summary": "Get user's images",
                "parameters": [
                    {
                        "description": "Filter by image type (profile, cover, track_artwork)",
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of user's images",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to retrieve images",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/images/upload": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Uploads an image file with metadata. Supports profile images, cover images, and track artwork. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status with email verification).",
                "tags": [
                    "images"
                ],
                "summary": "Upload image",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "description": "Image file to upload",
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "image_type": {
                                        "description": "Image type (profile, cover, track_artwork)",
                                        "type": "string"
                                    },
                                    "associated_entity_id": {
                                        "description": "Associated entity ID (track ID, album ID, etc.)",
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "file",
                                    "image_type"
                                ]
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Image uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request or file",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/images/{imageId}": {
            "delete": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Deletes an image owned by the authenticated user. Users can only delete their own images. The stored file is never removed while any of the owner's other content still uses the image — a release or track, a channel, a channel update, the profile, a show, an article, a video, a podcast, or a release scheduled for later (read from the Wavlake relay and the scheduled releases; channel updates are read by a second scan with its own bound; comments, notes, playlists and live streams are not read, since no studio puts a hosted image in them) — because gallery reuse and the migration's de-duplication let one image serve several releases, and both studios delete a release's cover with the release. Such an image is kept, unchanged and still in the gallery, and the answer is still 200 with kept_reason \"in_use\"; the delete that finds no user left removes it. If that cannot be settled (the relay cannot be read, or the scan passes its bounds), the image is kept too (\"usage_unverified\"). An image that was already deleted, or never existed, answers 404, so a repeat delete reads as already gone rather than as a failure. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status).",
                "tags": [
                    "images"
                ],
                "summary": "Delete image",
                "parameters": [
                    {
                        "description": "Image ID to delete",
                        "name": "imageId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Image deleted, or kept because other content still uses it",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.DeleteImageResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid image ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not authorized to delete this image or Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Image already deleted or not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to delete image",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/images/{imageId}/associate": {
            "put": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates the entity association for an image (e.g., link image to a track). Users can only update their own images. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status).",
                "tags": [
                    "images"
                ],
                "summary": "Update image association",
                "parameters": [
                    {
                        "description": "Image ID to update",
                        "name": "imageId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UpdateImageAssociationRequest"
                            }
                        }
                    },
                    "description": "New association details",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Association updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not authorized to update this image or Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Image already deleted or not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to update association",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/l402/demo": {
            "get": {
                "description": "Generic L402 entitlement gate proving the challenge→pay→present→verify loop. Returns 402 + a `WWW-Authenticate: L402 …` challenge when no/invalid/expired credential is presented (deliberate L402-spec wire semantics — distinct from the ledger 402/400 split), and 200 once a valid `Authorization: L402 <macaroon>:<preimage>` is supplied. POC/demo surface; production per-stream gating is Phase 4 (gated). Controlled by the L402_ISSUER_ENABLED kill-switch (404 when off).",
                "tags": [
                    "l402"
                ],
                "summary": "Demonstration L402-gated resource (POC)",
                "parameters": [
                    {
                        "description": "Resource coordinate to gate (e.g. a Nostr coord 36787:<pubkey>:<d-tag>)",
                        "name": "resource",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Access granted — valid L402 credential",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.L402DemoResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing resource query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Payment required — challenge in WWW-Authenticate header",
                        "headers": {
                            "WWW-Authenticate": {
                                "description": "L402 macaroon=\\\"<base64>\\\", invoice=\\\"<bolt11>\\",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "L402 issuer disabled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Invoice provider or store fault",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/legacy-artist-urls/{name}": {
            "get": {
                "description": "Public. Answers whether `name` was a legacy Wavlake act's URL (the `<artistUrl>` in an old `wavlake.com/<artistUrl>` link), read from the legacy name snapshot taken when the legacy platform went read-only (D152), act names only. It says nothing about who held the name. When a channel has taken the act (the channel that inherited the act's legacy feed guid, community_feed_guids, found through the act's id in the legacy catalog), `moved_to` names that channel and the path of its page: the account name pointed at it, else its own address, else `/c/id/<id>`. Without a legacy catalog, or on a fault reading it, `moved_to` is left out (and the answer is not cached), never a 5xx. The client asks only after it found no channel or account at that address: `moved_to` sends the visitor to the new page for good, a 200 without it to the same path on the legacy site. 404 = not a legacy artist URL.",
                "tags": [
                    "legacy"
                ],
                "summary": "Whether a name was a legacy artist URL, and where the act moved",
                "parameters": [
                    {
                        "description": "The address segment",
                        "name": "name",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A legacy artist URL, and the channel it moved to",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyArtistURLResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a legacy artist URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Could not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/legacy-links/{kind}/{legacy_id}": {
            "get": {
                "description": "Public. Given a legacy Wavlake album or track UUID (the id in an old `wavlake.com/album/<uuid>` or `/track/<uuid>` share link), returns the address of the event its owner's migration run prepared for it: the author key, the d-tag (the legacy id) and the naddr. Read from the newest migration run holding the id; an id held by more than one account is refused (503), never resolved to either. The run PREPARES an event its owner then signs, so a caller must confirm the event is on the relay before linking to it. 404 = not migrated.",
                "tags": [
                    "legacy"
                ],
                "summary": "Resolve a legacy album or track id to its migrated release or song",
                "parameters": [
                    {
                        "description": "album or track",
                        "name": "kind",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Legacy album or track UUID",
                        "name": "legacy_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The migrated item's address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyLinkResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Unknown kind, or legacy_id is not a UUID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not migrated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Could not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/legacy/metadata": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves all user metadata from the legacy PostgreSQL system including user profile, artists, albums, and tracks. Supports flexible authentication (Firebase or NIP-98). Returns empty arrays for artists/albums/tracks if user doesn't exist or has no content. The user's and each artist's artwork_url is Wavlake's copy of the picture, copied on this read if it was not already; a picture that could not be copied has an empty artwork_url and sets pictures_not_copied.",
                "tags": [
                    "legacy"
                ],
                "summary": "Get user's legacy metadata",
                "responses": {
                    "200": {
                        "description": "User metadata with artists, albums, and tracks",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.UserMetadataResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Database error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/balance": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated listener's streaming credit balance, split into the subscription-granted and top-up portions. Amounts are integer credits (1 credit = 1 US cent). Scoped to the requesting listener's own NIP-98 pubkey — never accepts a target pubkey. A listener who has never transacted receives 200 with a zero balance, never 404. Tier-1 (no DB account) listeners are supported. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get listener credit balance",
                "responses": {
                    "200": {
                        "description": "Listener credit balance",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.ListenerBalanceResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Balance service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/buy": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Buys the item at `item` (a \"36787:<pubkey>:<d-tag>\" track or \"34139:<pubkey>:<d-tag>\" release coordinate, colon-safe) for the signer. The server charges its own price; `expected_price_cents` must equal it or the answer is 409 PRICE_CHANGED with the current price. Method \"credits\" spends pay-as-you-go credits only (membership credits never buy) and completes at once: 200 with the order, its frozen track list, and which tracks the signer now holds. Methods \"card\" and \"instant\" open a PENDING order and answer 200 with what pays it — `checkout_url` (card: a hosted checkout for exactly the price) or `invoice` + `expires_at` (instant: a payment code to scan with any wallet app); a card order sent with `presentation` \"inline\" where music pays inside the app answers `checkout_session_id` + `client_secret` instead of `checkout_url`, for the in-app payment form (Cache-Control: no-store); the purchase completes when the payment lands, and GET /listener/buy/{order_id} reports it (complete, or funded_not_bought when the music was already bought meanwhile and the payment stayed as credits). A method this deployment does not offer (GET /listener/purchase-methods) is 400 METHOD_NOT_AVAILABLE. A frozen account is refused on every method (403 ACCOUNT_FROZEN). The music's own signer is refused on every method (400 OWN_MUSIC), before any order or charge. Idempotent on `idempotency_key` (a UUID): the same key returns the recorded order — for card and instant, the same link or code while it is open — with no second charge; a key already used for another item or method is 409 IDEMPOTENCY_KEY_REUSED. `names` is optional: the title, artist and release title the buyer was shown, kept with the order (cleaned, 200 characters each, only for tracks the order covers) and given back only on GET /listener/owned, so the purchase can still be named after its artist takes it down. Requires NIP-98 (Tier 1).",
                "tags": [
                    "Listener"
                ],
                "summary": "Buy a song or a whole release",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.BuyRequest"
                            }
                        }
                    },
                    "description": "What to buy, the price shown, the method and an idempotency key",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The completed (or replayed) order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST, METHOD_NOT_AVAILABLE, RETURN_ORIGIN_NOT_ALLOWED, or OWN_MUSIC (the signer asked to buy their own music; refused on every method before any order or charge)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "INSUFFICIENT_CREDITS (details: models.InsufficientCreditsDetails); nothing charged, no order kept",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "ACCOUNT_FROZEN (every method) or PURCHASE_BLOCKED (card)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CONTENT_NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "PRICE_CHANGED (details: models.PriceChangedDetails), ALREADY_OWNED, CONTENT_NOT_PURCHASABLE, RELEASE_NOT_SELLABLE (details: models.ReleaseNotSellableDetails) or IDEMPOTENCY_KEY_REUSED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "ORDER_EXPIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED, or VELOCITY_CAP_EXCEEDED (card: the daily card limit)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE — nothing was charged",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/buy/{order_id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Reports one of the signer's orders: pending | complete | funded_not_bought | expired, its prices and its frozen track list. A pending card or instant order also carries its `checkout_url` or `invoice`; a pending card order paid inside the app is read from Stripe on each request: a paid payment completes the order before it is answered, and an open one carries `checkout_session_id` + `client_secret` (never for a frozen or card-blocked account, nor where card purchases are off; Cache-Control: no-store); `refunded` marks an order support refunded or a disputed payment undid. Another key's order answers 404, exactly like a missing one. Requires NIP-98 (Tier 1).",
                "tags": [
                    "Listener"
                ],
                "summary": "Read one of your purchases",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "order_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/credits/recover": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    }
                ],
                "description": "Moves the credit balance from a key the listener no longer controls to another key linked to the same account. Both keys must be linked to the authenticated account. The move is recorded as a matched pair of ledger entries, never an edit, and the old key is retired. Subscription credits move only while their month is still open; credits in a closed month stay with the old key and are reported as left_behind_credits. Purchased tracks move with the credits (moved_purchases); a purchased track the new key already owns is retired on the old key instead (already_owned_purchases). This month's spending progress toward the monthly cap does not transfer. A client-supplied idempotency_key (8-200 characters, generated once per recovery attempt and reused across retries of that attempt) is required: retrying with the same key returns the original movement with replayed=true rather than moving money twice or failing. Requires Firebase authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Move a credit balance to a newly linked key",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.RecoverBalanceRequest"
                            }
                        }
                    },
                    "description": "Source and destination keys",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Balance moved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.RecoverBalanceResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Keys are not both linked to this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Recovery service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/credits/recoverable": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    }
                ],
                "description": "Returns every Nostr key linked to the authenticated account together with the credit balance each one holds and how many purchased tracks it owns (purchases), so a listener who lost a key can see which one held their credits and purchases and choose it as the recovery source. Amounts are integer credits (1 credit = 1 US cent). Scoped to the caller's own Firebase account. Requires Firebase authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "List the account's keys and their credit balances",
                "responses": {
                    "200": {
                        "description": "Linked keys and balances",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.ListRecoverableResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Recovery service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/membership/recap": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated member's listening history per membership cycle, newest first: the current cycle (if any) and the most recent closed ones (at most 6). For each cycle: its window, whether it is current, the number of plays its membership credits paid for, the artists played (hex pubkey + play count, most played first, at most 50; `artistCount` is the full number) and what happened to the unused part at cycle end (`share`: open, pending, played_artists, pool, nothing_left). Plays paid from bought credits are never counted. Carries no money figure (R27): what a member spent on plays in a membership month is the receipt (`GET /v1/listener/receipt` with the cycle's `cycleStart`/`cycleEnd` as `start`/`end`). Scoped to the NIP-98 signer — never accepts a target pubkey. Requires a linked account (Tier 2); a key with none gets 403 TIER2_REQUIRED. A linked key with no membership gets an empty list.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get the member's listening recap",
                "responses": {
                    "200": {
                        "description": "Membership recap",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MembershipRecapResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "A linked account is required (TIER2_REQUIRED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Recap service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/owned": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The signer's completed purchases, newest first, as coordinates grouped by order (a release bought whole is one entry, listing every track of it the signer holds now), with the purchase date and the price paid. Titles and artwork are read from the relay by coordinate. For music the relay no longer has (its artist took it down), each purchase also carries the names it was bought under, when the order kept any (`release_title`, `release_artist`, and `title` / `artist` per track in `track_details`), and each held track its streaming address (`audio_url`), which the audio route still serves to the holder. Requires NIP-98 (Tier 1).",
                "tags": [
                    "Listener"
                ],
                "summary": "List the music you bought",
                "responses": {
                    "200": {
                        "description": "Purchases",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.OwnedPurchasesResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/owned/download": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Issues a 5-minute signed link to the song's file (the same file the stream serves), saved as \"<Artist> - <Title>.mp3\". Requires an active purchase of the track by the signer; a song taken down is refused. Any number of times, behind a per-key hourly limit; every link issued is logged. `title` and `artist` are optional display hints for the filename. Requires NIP-98 (Tier 1).",
                "tags": [
                    "Listener"
                ],
                "summary": "Get a download link for a song you bought",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.OwnedDownloadRequest"
                            }
                        }
                    },
                    "description": "The track coordinate",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "A signed link",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.OwnedDownloadResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "TRACK_NOT_OWNED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "DOWNLOAD_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/purchase-methods": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Lists the purchase methods this deployment offers right now, so the buy sheet shows only those: \"credits\" always; \"card\" only where card purchases are switched on; \"instant\" only where the instant payment code is available. Requires NIP-98 (Tier 1).",
                "tags": [
                    "Listener"
                ],
                "summary": "The ways to pay for music here",
                "responses": {
                    "200": {
                        "description": "The offered methods",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseMethodsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/purchases": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns a paginated, chronological list of the authenticated listener's credit purchases. Unifies PAYG top-ups (grouped by Stripe payment intent) and subscription renewals (one row per billing cycle). Includes processing and failed rows so users see in-flight purchases and billing failures. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get listener credit purchase history",
                "parameters": [
                    {
                        "description": "Number of purchases to return (1-100, default 20)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Number of purchases to skip (default 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Purchase history with pagination info",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ListenerPurchasesResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Purchase history service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/receipt": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated listener's \"where your money flowed\" receipt for a period: a calendar month (`month`), or a start/end window (`start` + `end`) — a member's membership month, so the receipt and the Account page count the same plays. Always includes a per-artist per-stream spend section (excluding synthetic month-end-distribution rows, scoped to USD). Subscribers additionally get a month-end distribution section, marked pending until the cycle closes and finalized once distributed. Scoped to the requesting listener's own NIP-98 pubkey — never accepts a target pubkey. Tier-1 (no DB account) listeners receive the per-stream-only view, never a 401. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get listener monthly receipt",
                "parameters": [
                    {
                        "description": "Month in YYYY-MM format (UTC). Defaults to the current month. Never with start/end.",
                        "name": "month",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Window start, RFC 3339 (inclusive). Requires end.",
                        "name": "start",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Window end, RFC 3339 (exclusive). Requires start; after it by at most a year.",
                        "name": "end",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Adaptive monthly receipt",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ListenerReceiptResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid month or period",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Receipt service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/spending": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the current spending status for the authenticated listener, including total spent, cap amount, whether the cap has been reached, and today/month-to-date/year-to-date spending breakdowns. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get listener spending status",
                "responses": {
                    "200": {
                        "description": "Current spending status including cap progress",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SpendingStatus"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/streams": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns paginated stream history for the authenticated listener. Each stream carries the track's d-tag (track_d_tag), the pubkey that signed the track (track_pubkey, 64-char hex; empty when the d-tag has no content record), the amount paid, the stream type, and a timestamp. track_name and artist_name are always empty: read the track from Nostr by author (track_pubkey) and d-tag, never by d-tag alone. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Get listener stream history",
                "parameters": [
                    {
                        "description": "Number of streams to return (1-50, default 10)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Number of streams to skip (default 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Filter by month in YYYY-MM format (e.g., 2024-01)",
                        "name": "month",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "When true, only return streams with amount > 0 (filters out free streams)",
                        "name": "paid_only",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stream history with pagination info",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ListenerStreamsResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/listener/topup/lightning": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Issues a BOLT11 invoice for a credit top-up. The credit amount in US cents is FIXED when the invoice is issued; the sats figure is derived from it at the current rate and the invoice expires in 5 minutes. Credits are NOT added by this call — they arrive when the invoice is paid and the payment provider calls back, so clients poll GET /listener/balance to observe them. Scoped to the requesting listener's own NIP-98 pubkey — never accepts a target pubkey. Tier-1 (no DB account) listeners are supported. Requires NIP-98 authentication.",
                "tags": [
                    "Listener"
                ],
                "summary": "Buy credits with a Lightning payment",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.ListenerTopupRequest"
                            }
                        }
                    },
                    "description": "Top-up amount in credits",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Payable invoice",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.ListenerTopupResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid amount",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Top-up service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/access-requests": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Going live is invite-only. A key that is not on the invite list asks here; the ask is kept once per key for an operator, and grants nothing by itself. The requester is the NIP-98 signer — never a body field. Idempotent per key: the first ask answers 201, every later one 200 with the first ask (its channel id is kept, a later one is ignored). A key already on the invite list answers 200 `allowed` and nothing is kept. The body is optional. Mounted ahead of the invite-list check. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Ask to be invited to go live",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.CreateLiveAccessRequest"
                            }
                        }
                    },
                    "description": "The channel the person was in (optional)"
                },
                "responses": {
                    "200": {
                        "description": "Already asked, or already allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveAccessRequestResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Asked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveAccessRequestResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid body or channel id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The ask could not be kept",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/access-requests/me": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers `allowed` when the signed-in key is on the invite list, `requested` (with `requestedAt`, unix seconds) when it has asked, and `none` otherwise. Mounted ahead of the invite-list check. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Where I stand with going live",
                "responses": {
                    "200": {
                        "description": "Where the key stands",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveAccessRequestResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/signer": {
            "get": {
                "description": "The hex public key the API signs every live event (Kind 30311) with. Public and unauthenticated; the deploy check compares it with the relay's and the client's live key. 503 while live streaming is off.",
                "tags": [
                    "live"
                ],
                "summary": "The live signing key's public half",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveSignerResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the authenticated host's live sessions (newest first). Never includes stream keys. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "List my live streaming sessions",
                "responses": {
                    "200": {
                        "description": "Sessions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.ListLiveStreamsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Query failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Provisions a NIP-53 live session for the authenticated host and returns the ingest URL(s) + broadcast key plus the host proof challenge. Requires NIP-98 (Tier 2) and beta-allowlist membership. The host must own the channel named by communityId: the API reads the channel's relay-signed description (39000/39001) from the Wavlake relay before anything is provisioned, and answers 403 FORBIDDEN when another key owns it, 409 NOT_ON_RELAY when the relay holds no such channel, and 503 EXTERNAL_SERVICE_ERROR when the relay cannot be read (fail closed). Instant sessions are published as status=planned until the encoder connects. One active (planned/live) session per artist is allowed (409 CONFLICT). 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Create a live streaming session",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.CreateLiveStreamRequest"
                            }
                        }
                    },
                    "description": "Session parameters",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Session created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.CreateLiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist, or the host does not own the channel",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An active session already exists (CONFLICT), or the relay holds no such channel (NOT_ON_RELAY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Provisioning failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable, or the channel's owner could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns a single live session owned by the authenticated host (no stream key). A session owned by another pubkey returns 404. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Get a live streaming session",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/end": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Tears the session down at the media provider (revoking the key at ingest) and publishes an explicit ended Kind 30311. Owner-only. Idempotent teardown at the provider. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "End a live streaming session",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Session ended",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Provider error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/goal": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Registers an already-published tip-goal event (signed by the artist's own key, client-side) against a live session and republishes the live event carrying a `goal` tag, so every subsequent lifecycle republish includes it. One goal per session: registering a DIFFERENT goal returns 409 LIVE_GOAL_ALREADY_SET, while re-registering the same id succeeds idempotently. The id must be 64-char lowercase hex. Owner-only; a session owned by another pubkey or a terminal session returns 404. Registration is discovery metadata only — goal contributions settle directly to the artist and never pass through Wavlake. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Register the tip goal for a live session",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SetGoalRequest"
                            }
                        }
                    },
                    "description": "Tip goal event id",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Session with the registered goal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid goal event id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A different tip goal is already registered",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/key": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Fetches the current broadcast stream key from the media provider (never stored in Wavlake) and returns it with the ingest endpoints. Owner-only; a session owned by another pubkey returns 404. Keys are redacted from all logs. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Reveal the broadcast stream key",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Broadcast credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamCredentialsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Provider error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/pins": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Replaces the session's pinned Kind 1311 message set (replace-the-set semantics; an empty array clears all pins) and republishes the Kind 30311 carrying the `pinned` tags, so every subsequent lifecycle republish includes the set. Owner-only; a session owned by another pubkey or a terminal session returns 404. Ids must be 64-char lowercase hex; the set is deduped and capped. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Set the pinned live-chat messages",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SetPinsRequest"
                            }
                        }
                    },
                    "description": "Pinned message set",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Session with the updated pin set",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid or too many pinned message ids",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/proof": {
            "patch": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Attaches the artist's signed NIP-53 host proof to the session and republishes the Kind 30311 carrying it, so subsequent lifecycle republishes include the proof. Owner-only. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Attach the host proof of agreement",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.AttachLiveProofRequest"
                            }
                        }
                    },
                    "description": "Host proof",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Session with proof attached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid proof",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/streams/{id}/rotate-key": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Rotates the broadcast key at the media provider (recreate-and-swap) and returns the refreshed session + new credentials. The provider stream id may change. Owner-only. Rotation drops any in-progress broadcast. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Rotate the broadcast stream key",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Rotated credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.RotateLiveKeyResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Provider error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/live/{id}/moderators": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the moderator roster for a live session owned by the authenticated host. Owner-only; a session owned by another pubkey returns 404. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Get the appointed-moderator roster",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Persisted roster",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.ModeratorsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Replaces the moderator roster for a live session owned by the authenticated host (full-replace: the roster becomes exactly the submitted set) and republishes the live event so it carries a provider-attested Moderator tag per moderator. Each entry must be a 64-char lowercase-hex identity; the roster is bounded, de-duped, and may not include the host. Owner-only; a session owned by another pubkey returns 404. 503 when live streaming is disabled.",
                "tags": [
                    "live-streaming"
                ],
                "summary": "Set the appointed-moderator roster",
                "parameters": [
                    {
                        "description": "Session id (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SetModeratorsRequest"
                            }
                        }
                    },
                    "description": "Moderator roster",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Persisted roster",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.ModeratorsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid roster",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not on the beta allowlist",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Live streaming is unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lnurlp/wavlake": {
            "get": {
                "description": "LNURL-pay metadata (LUD-06/LUD-16) for wavlake@<domain>, the 10 % fee recipient in every feed's value block. It pays Wavlake's fee wallet (dedicated in production), never a user balance, and is not behind the custodial-wallet switch. Answers an LNURL error until the fee wallet is configured.",
                "tags": [
                    "lnurlp"
                ],
                "summary": "Wavlake's fee Lightning address",
                "responses": {
                    "200": {
                        "description": "LNURL error (per spec, errors return HTTP 200)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LNURLError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lnurlp/wavlake/callback": {
            "get": {
                "description": "LNURL-pay callback (LUD-06) for wavlake@<domain>. Mints an invoice for the amount, whose description hash is sha256 of the metadata, on the fee wallet's ZBD project.",
                "tags": [
                    "lnurlp"
                ],
                "summary": "Invoice for Wavlake's fee Lightning address",
                "parameters": [
                    {
                        "description": "Amount in millisatoshis",
                        "name": "amount",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LNURL error (per spec, errors return HTTP 200)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LNURLError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lnurlp/{identifier}": {
            "get": {
                "description": "Returns LNURL-pay metadata (LUD-06/LUD-16) for a Lightning Address identifier. Supports NIP-05 username (e.g., 'alice' resolves to alice@wavlake.com), npub, hex pubkey, or Firebase UID formats. Tier 3 (KYC) verification is performed at the callback endpoint when creating invoices.",
                "tags": [
                    "lnurlp"
                ],
                "summary": "Get LNURL-pay metadata for Lightning Address",
                "parameters": [
                    {
                        "description": "Lightning Address identifier (NIP-05 username, npub, hex pubkey, or Firebase UID). Examples: 'alice', 'npub1...', '79be667e...')",
                        "name": "identifier",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LNURL error (per spec, errors return HTTP 200)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LNURLError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lnurlp/{identifier}/callback": {
            "get": {
                "description": "Generates a Lightning invoice for the specified amount. Requires Tier 3 (KYC) verification.",
                "tags": [
                    "lnurlp"
                ],
                "summary": "Generate Lightning invoice for LNURL-pay",
                "parameters": [
                    {
                        "description": "User identifier (hex pubkey or Firebase UID)",
                        "name": "identifier",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Amount in millisatoshis",
                        "name": "amount",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Zap request event (base64 encoded JSON)",
                        "name": "nostr",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Optional payment comment",
                        "name": "comment",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LNURL error response with status='ERROR' and reason (per LUD-06, errors return HTTP 200)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/channels/{communityId}": {
            "get": {
                "description": "The products of the store collection the channel's owner accepted: title, the product's page on the store (where checkout happens), one image on Shopify's CDN, the lowest price with its currency, whether some options cost more, and sold out. At most 100 products; truncated says the collection holds more (collection_url links to it). Answered from a snapshot the API refreshes in the background when it is older than MERCH_SNAPSHOT_TTL; a Shopify failure keeps the last snapshot. 404 when the channel shows no merch; 503 only when the channel's first snapshot could not be read. Unauthenticated, rate limited per IP, cacheable for a minute. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "A channel's merch",
                "parameters": [
                    {
                        "description": "Channel (community) id, 32 hex",
                        "name": "communityId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The channel's merch",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchChannel"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The channel shows no merch",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The store has not answered yet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/checkout": {
            "post": {
                "description": "Makes the store's cart from a listener's cart and answers the store's checkout page for it, where the listener pays (the store takes the payment and makes the order; Wavlake holds neither). Each line names a channel, a variant from that channel's merch and a quantity (1 to 10; at most 20 lines, a channel's lines of one variant added together). Each item carries the channel it was added on onto the store's order, hidden from the buyer. Every line must be one store's: one store's channels may share a cart, two stores' may not (400). A channel that no longer shows merch, or a variant its merch no longer lists, is 409 MERCH_CART_STALE; Shopify decides stock: short lists the lines the store could not fill in full, and a cart it could fill nothing of is 409 MERCH_SOLD_OUT. checkout_url is on the store's own domains. Unauthenticated, rate limited per IP, never cached. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Make a listener's cart on the store",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCheckoutRequest"
                            }
                        }
                    },
                    "description": "The cart's lines",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The store's checkout page and the lines it could not fill",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCheckout"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: a malformed line, too many lines, or two stores",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "MERCH_CART_STALE or MERCH_SOLD_OUT",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "MERCH_STORE_REFUSED: Shopify refused the store",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The store did not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/connections/{id}": {
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Ends a waiting or accepted connection. The store's operator withdraws (removed_by \"store\"); otherwise the caller must be the channel's current owner on the Wavlake relay and disconnects (removed_by \"owner\"). The channel's page stops showing the merch at once on the API (browsers may hold the public read for up to a minute). A connection already declined or removed is 409 MERCH_NOT_OPEN. NIP-98, Tier 2. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Withdraw or disconnect a store's collection",
                "parameters": [
                    {
                        "description": "Connection id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The removed connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Neither the store's operator nor the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "MERCH_NOT_OPEN or NOT_ON_RELAY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/connections/{id}/accept": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The channel's owner accepts a waiting request; the collection then shows on the channel's page. A channel shows one store's collection at a time: with another accepted, 409 MERCH_CHANNEL_HAS_STORE (disconnect it first). A request no longer waiting, or from a disabled store, is 409 MERCH_NOT_PENDING. NIP-98, Tier 2; the caller must be the channel's current owner on the Wavlake relay. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Accept a store's request",
                "parameters": [
                    {
                        "description": "Connection id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The accepted connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "MERCH_NOT_PENDING, MERCH_CHANNEL_HAS_STORE or NOT_ON_RELAY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/connections/{id}/decline": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The channel's owner declines a waiting request. The store may ask again later. NIP-98, Tier 2; the caller must be the channel's current owner on the Wavlake relay. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Decline a store's request",
                "parameters": [
                    {
                        "description": "Connection id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The declined request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "MERCH_NOT_PENDING or NOT_ON_RELAY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/shopify/collections": {
            "get": {
                "security": [
                    {
                        "ShopifySessionToken": []
                    }
                ],
                "description": "As GET /merch/stores/{id}/collections, for the store the session token's shop acts for: one page searched by title and paged by Shopify's cursor, read live. Never cached. Mounted only with MERCH_ENABLED and a store's app configured.",
                "tags": [
                    "merch"
                ],
                "summary": "The store's collections, from its Shopify admin",
                "parameters": [
                    {
                        "description": "Title search",
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "next_cursor from the previous page",
                        "name": "after",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One page of collections",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCollectionsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: a cursor Shopify did not issue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "MERCH_SESSION_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "MERCH_SHOP_NOT_REGISTERED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "MERCH_STORE_REFUSED: Shopify refused the store's app",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Shopify did not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/shopify/connections": {
            "get": {
                "security": [
                    {
                        "ShopifySessionToken": []
                    }
                ],
                "description": "As GET /merch/stores/{id}/connections, for the store the session token's shop acts for: every request in any state, newest first, at most 500, whoever on the store's side sent it. Never cached. Mounted only with MERCH_ENABLED and a store's app configured.",
                "tags": [
                    "merch"
                ],
                "summary": "Every request the store sent, from its Shopify admin",
                "responses": {
                    "200": {
                        "description": "The requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnectionsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "MERCH_SESSION_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "MERCH_SHOP_NOT_REGISTERED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ShopifySessionToken": []
                    }
                ],
                "description": "As POST /merch/stores/{id}/connections, for the store the session token's shop acts for. The request records the staff member who sent it (the token's Shopify user id). The channel must exist on the Wavlake relay. Mounted only with MERCH_ENABLED and a store's app configured.",
                "tags": [
                    "merch"
                ],
                "summary": "Ask a channel to show a collection, from the store's Shopify admin",
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.MerchConnectionRequest"
                },
                "responses": {
                    "201": {
                        "description": "The waiting request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: a malformed channel or collection id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "MERCH_SESSION_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "MERCH_SHOP_NOT_REGISTERED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "A collection the store's app cannot see",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "NOT_ON_RELAY, MERCH_REQUEST_EXISTS or MERCH_ALREADY_CONNECTED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay or Shopify did not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/shopify/connections/{id}": {
            "delete": {
                "security": [
                    {
                        "ShopifySessionToken": []
                    }
                ],
                "description": "The store's side ends one of its own waiting or accepted connections (removed_by \"store\"), recording the staff member. A connection of another store is 404, as an unknown one is. A connection already declined or removed is 409 MERCH_NOT_OPEN. Mounted only with MERCH_ENABLED and a store's app configured.",
                "tags": [
                    "merch"
                ],
                "summary": "Withdraw or disconnect a collection, from the store's Shopify admin",
                "parameters": [
                    {
                        "description": "Connection id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The removed connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "MERCH_SESSION_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "MERCH_SHOP_NOT_REGISTERED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such connection on this store",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "MERCH_NOT_OPEN",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/shopify/store": {
            "get": {
                "security": [
                    {
                        "ShopifySessionToken": []
                    }
                ],
                "description": "The live store whose shop the session token names, read through the shop's own Shopify app. Its staff use the \"Wavlake\" app embedded in their Shopify admin, with no Wavlake account. Never cached. Mounted only with MERCH_ENABLED and a store's app configured.",
                "tags": [
                    "merch"
                ],
                "summary": "The store a Shopify admin's Wavlake app acts for",
                "responses": {
                    "200": {
                        "description": "The store",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchStore"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "MERCH_SESSION_INVALID: no session token, or one that does not verify",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "MERCH_SHOP_NOT_REGISTERED: the shop has no store on Wavlake",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/stores": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Every live merch store whose operator is the signed-in key, oldest first. A store read through its own Shopify app is left out: its side is its Shopify admin. A store's Storefront token is never returned. NIP-98, Tier 2. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "The stores the signed-in account runs",
                "responses": {
                    "200": {
                        "description": "The stores",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchStoresResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/stores/{id}/collections": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "One page of the store's collections for its operator, searched by title (every word must start a word of the title) and paged by Shopify's cursor. has_products is false when the store's storefront sees no product in a collection. Never cached; 503 when Shopify does not answer. NIP-98, Tier 2; the caller must operate the store. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "A store's collections, read live from Shopify",
                "parameters": [
                    {
                        "description": "Store id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Title search",
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "next_cursor from the previous page",
                        "name": "after",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One page of collections",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCollectionsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: a cursor Shopify did not issue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such store, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "MERCH_STORE_REFUSED: Shopify refused the store's token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Shopify did not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/merch/stores/{id}/connections": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The store's requests in any state (pending, accepted, declined, removed), newest first, at most 500. NIP-98, Tier 2; the caller must operate the store. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Every request a store sent",
                "parameters": [
                    {
                        "description": "Store id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnectionsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such store, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records a waiting request from the store to the channel's owner. The channel must exist on the Wavlake relay (409 NOT_ON_RELAY when it does not; 503 when the relay cannot be read). The collection is read from Shopify for its title. One waiting request per store, channel and collection (409 MERCH_REQUEST_EXISTS); a collection already showing on the channel is refused (409 MERCH_ALREADY_CONNECTED). NIP-98, Tier 2; the caller must operate the store. Mounted only with MERCH_ENABLED.",
                "tags": [
                    "merch"
                ],
                "summary": "Ask a channel to show one of the store's collections",
                "parameters": [
                    {
                        "description": "Store id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.MerchConnectionRequest"
                },
                "responses": {
                    "201": {
                        "description": "The waiting request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: a malformed channel or collection id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such store, or a collection the store's token cannot see",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "NOT_ON_RELAY, MERCH_REQUEST_EXISTS or MERCH_ALREADY_CONNECTED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "MERCH_STORE_REFUSED: Shopify refused the store's token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay or Shopify did not answer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-account": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Three booleans and a list for the magic-link completion page: `has_legacy_account` is true iff the authenticated firebase_uid owns at least one eligible (non-deleted) legacy catalog track, `has_legacy_user` is true iff a legacy user row exists for that firebase_uid at all (a legacy listener owns no tracks), `has_legacy_balance` is true iff that row holds a balance above zero (never the amount), and `legacy_linked_pubkeys` is the keys that old account linked on the old Wavlake, as 64-character lowercase hex, oldest first (always an array; empty when there is no old account or it linked none), so the sign-up can offer one before it makes a new key. Unlike GET /migration/status this route requires only a valid Firebase ID token — no `users` row, no linked pubkey — because it runs BEFORE registration, when the completion page decides whether the arrival is a legacy user who must be routed into the Migrate flow. Returns 5xx on legacy-DB error so the caller fails closed. Never echoes legacy-account contents.",
                "tags": [
                    "migration"
                ],
                "summary": "Legacy-account probe for a Firebase-authenticated caller with no linked key",
                "responses": {
                    "200": {
                        "description": "Detection booleans and the old account's linked keys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyAccountProbeResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The sats migration's read (#4155). Returns the caller's balance on the old Wavlake system, what is available to move, the dust line (1,000 sats), the routing-fee reserve (1.5%), every reason a move cannot start right now (`blockers`), the caller's own proven destination, what ONE move would do (`preview`), and the account's move in flight and newest finished move. Works for a listener-only legacy account: a Firebase Bearer token is enough, no registered user row is needed. A caller with no signing key gets `destination: null` and the blocker `LEGACY_BALANCE_WALLET_NOT_READY`. No legacy account is a 200 with `has_legacy_user: false`. While the old system's own switch is off the read is 503 `LEGACY_BALANCE_PAUSED`, except for a caller with a move in flight: that caller gets a 200 with zero amounts, the blocker `LEGACY_BALANCE_PAUSED` and `active_move`, so the move can still be followed. All amounts are integer millisatoshi.",
                "tags": [
                    "migration"
                ],
                "summary": "Read the caller's legacy balance and what a move would do",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE (the old system could not be asked) · LEGACY_BALANCE_PAUSED (the old system's switch is off)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/address": {
            "put": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The own-address route (#4158). Saves a Lightning address outside Wavlake as the account's address for its old balance, after checking it live (as the check route does). Requires the move route's whole chain: a Firebase ID token AND a NIP-98 signature with the body's payload hash, the key linked to that account (403 `LEGACY_BALANCE_KEY_NOT_LINKED`), a sign-in at most 5 minutes old (401 `REAUTH_REQUIRED`); 5 requests a minute per account. Every change is emailed to the account's email: a notice, never a gate, so a notice that cannot be sent does not undo the save. There is no waiting period: a move may use the address at once. Saving the address the account already has changes nothing and sends nothing. An account an operator paused is refused (409 `LEGACY_BALANCE_ACCOUNT_PAUSED`).",
                "tags": [
                    "migration"
                ],
                "summary": "Save the address the old balance is sent to",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceAddressRequest"
                            }
                        }
                    },
                    "description": "The address to save",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceSavedAddress"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST · LEGACY_BALANCE_OWN_ADDRESS_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · NOSTR_AUTH_FAILED · REAUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "LEGACY_BALANCE_KEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "LEGACY_BALANCE_ACCOUNT_PAUSED · _OWN_ADDRESS_WAVLAKE · _OWN_ADDRESS_UNREACHABLE · _OWN_ADDRESS_UNUSABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "LEGACY_BALANCE_PAUSED · LEGACY_BALANCE_DESTINATION_UNAVAILABLE · SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/address/check": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The own-address route (#4158). Reads a Lightning address outside Wavlake live (LNURL-pay) and answers what it takes in one payment. Saves nothing and needs no fresh sign-in; 20 requests a minute per account. Refused: a string that is not an address (400 `LEGACY_BALANCE_OWN_ADDRESS_INVALID`), a Wavlake address (409 `LEGACY_BALANCE_OWN_ADDRESS_WAVLAKE`: the wallet route is the one for those), an address that could not be reached (409 `LEGACY_BALANCE_OWN_ADDRESS_UNREACHABLE`) or that answered with something that cannot be paid (409 `LEGACY_BALANCE_OWN_ADDRESS_UNUSABLE`). While moves are paused for everyone the answer is 503 `LEGACY_BALANCE_PAUSED`.",
                "tags": [
                    "migration"
                ],
                "summary": "Check an address for the old balance before saving it",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceAddressRequest"
                            }
                        }
                    },
                    "description": "The address to check",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceAddressCheck"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST · LEGACY_BALANCE_OWN_ADDRESS_INVALID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "LEGACY_BALANCE_OWN_ADDRESS_WAVLAKE · _OWN_ADDRESS_UNREACHABLE · _OWN_ADDRESS_UNUSABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "LEGACY_BALANCE_PAUSED · LEGACY_BALANCE_DESTINATION_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/confirmations": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#5322. The app about to move an old balance opens a request before it emails a \"Confirm it's you\" link, so the link can be opened in ANY browser. NIP-98 only (the key's own signature; a Firebase token is not accepted here): the request is bound to the signing key, to the Firebase account that key is linked to, and to ONE purpose. The body may name it: `legacy_balance_move` (the default, and what an empty body means) `money_action` (#5861: a cash-out, or adding or changing a bank account or payout address) or `key_change` (#6049: starting over on another key); any other is 400. It waits 15 minutes for the link to be opened; a newer request from the same key for the same purpose replaces any unspent older one. The `id` goes in the link and, once confirmed, in the action's `X-Wavlake-Confirmation` header. 5 requests a minute per key.",
                "tags": [
                    "migration"
                ],
                "summary": "Open a \"Confirm it's you\" request for moving the old balance or for a money action",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationOpenRequest"
                            }
                        }
                    },
                    "description": "The purpose (optional)"
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationOpened"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST (an unknown purpose)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NOSTR_AUTH_FAILED · PUBKEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/confirmations/confirm": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    }
                ],
                "description": "#5322. Called by whatever browser opened the emailed link, right after Firebase's email-link sign-in there: that proves the email. Firebase ID token only (`Authorization: Bearer`), no key needed. Refused unless the token's sign-in is at most 5 minutes old (401 `REAUTH_REQUIRED`, checked before the request is looked at), the token's account is the one the request was opened for, and the request is waiting and unexpired. A request of another account is 404 `CONFIRMATION_NOT_FOUND`, exactly as an unknown id. Confirming an already confirmed request again is a 200 that changes nothing. Email access alone cannot start or finish a move: only the key that opened the request can spend it. 10 requests a minute per account.",
                "tags": [
                    "migration"
                ],
                "summary": "Confirm a \"Confirm it's you\" request from the browser that opened the link",
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.SignInConfirmationRequest"
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationStatus"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · REAUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CONFIRMATION_NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CONFIRMATION_USED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "CONFIRMATION_EXPIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/confirmations/status": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "#5322. The asking app polls its request while it waits for the link to be opened. NIP-98 only; the id is in the body, never the URL. A request that is not this key's is 404, exactly as an unknown id. `state` is `pending`, `confirmed` (spend it now: the move's fresh-sign-in window counts from the confirmation), `used` or `expired`. 60 requests a minute per key.",
                "tags": [
                    "migration"
                ],
                "summary": "Read a \"Confirm it's you\" request",
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.SignInConfirmationRequest"
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationStatus"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NOSTR_AUTH_FAILED · PUBKEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CONFIRMATION_NOT_FOUND",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/move": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The sats migration's move (#4155; the own-address route #4158). Requires, in order: a Firebase ID token AND a NIP-98 signature with the body's payload hash (`Authorization: Bearer <id token>` + `X-Nostr-Authorization: Nostr <event>`); the signing key to be the key linked to that Firebase account (403 `LEGACY_BALANCE_KEY_NOT_LINKED`); a sign-in at most 5 minutes old (401 `REAUTH_REQUIRED`); 5 requests a minute per account. The destination is read from the account, never from the request: with `route` \"wallet\" (or empty) the caller's own Wavlake address, proven to resolve to their backed-up wallet; with \"own_address\" the address the account saved, which must equal `confirmed_address` (409 `LEGACY_BALANCE_OWN_ADDRESS_CHANGED`) and must take the whole amount in one payment (409 `LEGACY_BALANCE_OWN_ADDRESS_CAP`, with the address's maximum in `details`; never split); an operator's maximum for one move below the whole amount is refused the same way on this route (409 `LEGACY_BALANCE_OWN_ADDRESS_MOVE_CAP`, with that maximum in `details`), while the wallet route moves what it allows. The amount is recomputed from a fresh balance and must equal `expected_amount_msat`. **A 2xx means a move row exists and `data` is that move (201 new, 200 the same `move_id` again); any non-2xx means no row was created and nothing was sent, so the same `move_id` may be reused.** A move that was recorded and then could not go ahead comes back 2xx in state `refused` with a `refusal_code`.",
                "tags": [
                    "migration"
                ],
                "summary": "Move the caller's legacy balance to their own wallet or saved address",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMoveRequest"
                            }
                        }
                    },
                    "description": "The move id and the amount the person confirmed",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "This move id already exists (idempotent repeat)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMove"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Move recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMove"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED · INVALID_TOKEN · NOSTR_AUTH_FAILED · REAUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "LEGACY_BALANCE_KEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "LEGACY_BALANCE_NO_ACCOUNT",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CONFLICT · LEGACY_BALANCE_NOT_VERIFIED · _REGION_UNSUPPORTED · _ACCOUNT_LOCKED · _WITHDRAWAL_IN_FLIGHT · _KEYSEND_IN_FLIGHT · _BUSY · _ACCOUNT_DISABLED · _ACCOUNT_DELETED · _ACCOUNT_PAUSED · _BELOW_DUST · _WALLET_NOT_READY · _BACKUP_UNCHECKED · _ADDRESS_NOT_REGISTERED · _DESTINATION_LIMIT · _AMOUNT_CHANGED (details.preview) · _CONFIRMATION_REQUIRED · _MOVE_IN_PROGRESS (details.active_move) · _OWN_ADDRESS_MISSING · _OWN_ADDRESS_CHANGED · _OWN_ADDRESS_WAVLAKE · _OWN_ADDRESS_UNREACHABLE · _OWN_ADDRESS_UNUSABLE · _OWN_ADDRESS_CAP (details.max_sendable_msat, details.amount_msat) · _OWN_ADDRESS_MOVE_CAP (details.max_move_msat, details.amount_msat)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "RATE_LIMITED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "LEGACY_BALANCE_PAUSED · LEGACY_BALANCE_WITHDRAWALS_SUSPENDED · LEGACY_BALANCE_DESTINATION_UNAVAILABLE · SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/legacy-balance/moves/{move_id}": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The status read the client polls after a move (#4155). Owner only. A move still in flight is brought up to date from the old system first (at most once every 5 seconds per move). **404 `LEGACY_BALANCE_MOVE_NOT_FOUND` means this API has no row for the caller: nothing was sent.** Any other 404 (a path this API does not serve answers `NOT_FOUND`) says nothing about the move.",
                "tags": [
                    "migration"
                ],
                "summary": "Read one legacy-balance move",
                "parameters": [
                    {
                        "description": "The move id",
                        "name": "move_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMove"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "AUTH_REQUIRED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "LEGACY_BALANCE_MOVE_NOT_FOUND — no such move for this caller; nothing was sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/prepare": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Takes a batch of legacy track IDs, verifies firebase_uid ownership against the legacy catalog DB, copies referenced images synchronously to GCS (with cascade on failure), upserts nostr_content rows with pending_audio_source_url set, and returns per-item seed payloads for the client to build + sign Nostr events via the canonical TS builders in `packages/shared/nostr/publishing.ts`. For type=track items the response carries `track_seed` (flat metadata fed into createTrackEvent); for type=album items the response carries `album_seed` (including `track_ids` for `track` ref tags fed into createAlbumEvent). There is no type=artist item: a legacy artist is a NAME carried in `artist_credits` (D47), not a profile. Tier 2 (NIP-98 + linked Firebase user) required.",
                "tags": [
                    "migration"
                ],
                "summary": "Prepare seed metadata for legacy migration",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationPrepareRequest"
                            }
                        }
                    },
                    "description": "Legacy track IDs to prepare",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Prepared templates + per-item errors",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationPrepareResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Release home conflict — a legacy album in the run already lives under a different home; `details` names the album and the page (release_home_conflict). Also NOT_ON_RELAY when the named community has no definition on the relay.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationPrepareConflict"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Too many IDs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/retry/{track_id}": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Resets a failed migration row (processing_error, processing_attempts, processing_failed_at, migration_claimed_at) so the audio worker can re-attempt the copy. One guarded UPDATE decides: the row must have pending_audio_source_url IS NOT NULL (migration-class), carry a failure or a stranded in-flight flag, and not be held by a processor — a row the audio worker holds a live claim on (stamped within the last 3 minutes), or that ProcessTrack has started on since that claim, is never reset; a row whose worker claim has gone stale is. Returns 409 CONFLICT when the row is already healthy or still being processed, and 409 not_retryable when the failure is one the worker classified permanent (source_not_found, invalid_mime, source_too_large, gcs_write_failed) — /tracks/readiness reports those rows with retryable=false. Tier 2 (NIP-98 + linked Firebase user) required.",
                "tags": [
                    "migration"
                ],
                "summary": "Retry a failed migration audio processing job",
                "parameters": [
                    {
                        "description": "nostr_content.id UUID",
                        "name": "track_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Reset successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid track_id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found or not owned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Track is already healthy or still being processed (CONFLICT), or the failure is permanent and a retry cannot help (not_retryable)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/rss-gate": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The legacy migration's former last step (D100). The gate itself is retired (D100 as amended 2026-09-24): nothing is locked behind this answer, `GET /v1/migration/status` reports `rss_gate_pending` false for everyone, and the reversible switch is `PUT /v1/artist/feed-settings`. This endpoint stays for an old client mid-flow only. Body carries the choice only: `continue_rss`. On `true` the server runs the same destination check the feed-settings write runs: the caller's Kind 0 on the Wavlake relay must carry a well-formed `lud16` — an external address is recorded as path `byo`; a Wavlake-domain address is accepted (path `generated`) only when the caller holds the matching Spark authorization, otherwise 409 `DESTINATION_CUSTODIAL`; a missing or malformed `lud16` is 409 `DESTINATION_MISSING`; an unreachable relay is 503. The address is never accepted from the client, never echoed and never stored. Write-once per account (409 `GATE_ALREADY_RESOLVED`); refused for an account with no migration run (409 `LEGACY_GATE_NOT_APPLICABLE`). Requires NIP-98 specifically (Tier 2 + linked account); rate limited 10/min per pubkey.",
                "tags": [
                    "migration"
                ],
                "summary": "Record the legacy RSS gate's write-once answer (retired gate; no new callers)",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyRssGateRequest"
                            }
                        }
                    },
                    "description": "The choice",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Decision recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyRssGateResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "continue_rss missing or malformed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "LEGACY_GATE_NOT_APPLICABLE | GATE_ALREADY_RESOLVED | DESTINATION_MISSING | DESTINATION_CUSTODIAL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay or database unreachable — the check fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/run": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the account's most recent migration run (active first): its worker state (queued | preparing | prepared | failed), legacy-track counters, a wire-stable `last_error` code, the audio readiness roll-up derived from the readiness service over the run's track ids (never stored), and one cursored page of persisted items — the exact `track_seed` / `album_seed` payloads the client feeds to the canonical builders, or the per-item `error_code`. `signer_replaced` is true when a key change moved the account off the run's `signer_pubkey` (#6205): the run is over for every key, and a client publishes nothing for it. The studio reattaches on this after a closed tab. 404 when the account has never kicked a run. Tier 2 (NIP-98 + linked Firebase user) required.",
                "tags": [
                    "migration"
                ],
                "summary": "Read the account's server-owned legacy migration run",
                "parameters": [
                    {
                        "description": "Return items with cursor greater than this value (from a previous page's next_cursor). Default 0.",
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Items per page (1-500, default 200)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Run envelope + one page of items",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationRunResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid cursor or limit",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No migration run for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Idempotent kick for the legacy migration (D94: silent, server-owned). No body — the run covers the account's whole eligible legacy catalog, imported standalone (D83) with the D99 paid default (1 credit per track). Returns 202 with the run envelope when it created a new run or re-queued the account's failed one in place; 200 with the existing envelope when the account already has an active (queued/preparing) or prepared run. The worker executes the run in the background; poll GET /v1/migration/run (or `run_state` on GET /v1/migration/status) to follow it. Tier 2 (NIP-98 + linked Firebase user) required. Rate limited 10/min per pubkey, a budget shared with /migration/prepare; the 429 carries Retry-After. The GET read is not limited.",
                "tags": [
                    "migration"
                ],
                "summary": "Start (or reattach to) the server-owned legacy migration run",
                "responses": {
                    "200": {
                        "description": "Existing run (active or prepared)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationRunResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Run created or re-queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationRunResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/status": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Detection signal for the frontend migration banner. Scoped entirely by the authenticated firebase_uid. `has_legacy_account` is true iff the user owns at least one eligible (non-deleted) legacy catalog track. `migrated` is a loose proxy — true iff every eligible legacy track ID already has a non-deleted nostr_content row for this firebase_uid (matched on nostr_d_tag); it does NOT inspect audio readiness, relays, or drafts. `partially_migrated` is true iff some (but not all) eligible legacy track IDs have a nostr_content row (mutually exclusive with `migrated`, false for a fresh discovery). `run_id` / `run_state` name the account's most recent server-owned migration run (queued | preparing | prepared | failed) and are omitted when none was ever kicked — one poll tells the banner whether to reattach via GET /v1/migration/run. `signer_replaced` is true when a key change moved the account off the run's signer (#6205): the run is over for every key and a client publishes nothing for it; false with no run. `rss_gate_pending` is always `false` (D100 as amended 2026-09-24 — RSS gates nothing; the field stays on the wire for the old client, which derives its studio lock from it and must read it as unlocked). `legacy_rss_answer` is the account's answer to the retired legacy RSS gate (\"Keep distributing on podcast apps?\"): `yes`, `no`, or `null` when it never answered. Historical intent only — it gates nothing, and a setting saved through /v1/artist/feed-settings always outranks it; a client uses it to avoid asking an artist who already answered. Returns 5xx on legacy-DB error so the frontend hides the banner. Never echoes legacy-account contents. Tier 2 (NIP-98 + linked Firebase user) required.",
                "tags": [
                    "migration"
                ],
                "summary": "Migration discovery status for the authenticated user",
                "responses": {
                    "200": {
                        "description": "Detection booleans",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/moderation/hidden": {
            "get": {
                "description": "The ids of the events staff hid and the keys staff banned directly, both lower-case hex and sorted. Never a key banned only because it shares an account with a banned key: which keys belong together is private, so it stays in the relay's internal policy. Wavlake's app drops these from every comment, channel post and channel conversation it reads, and shows everything when this read fails. Unauthenticated: a hidden event's id and a banned key are public on the relay already. Cached for a minute (Cache-Control: public, max-age=60); a hide or a ban reaches the app within about a minute.",
                "tags": [
                    "moderation"
                ],
                "summary": "What Wavlake's app hides from every comment it shows",
                "responses": {
                    "200": {
                        "description": "The hidden ids and banned keys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ModerationHiddenList"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE: the list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/music/publish": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The one way a track or a release reaches Wavlake's relay (D161 ruling 20). Send the signed release and its tracks, the release first in meaning: the API checks all of them before it writes any, then writes the release, then each track, reads them back off the relay and stamps them published. There is no separate confirm. A refusal of a check answers with nothing written and an error code naming the check: MUSIC_NOT_HOSTED (Wavlake holds no such upload, or the audio is not that upload's own address), MUSIC_NOT_UPLOADER (signed by a key other than the one that uploaded it, or a release listing another key's track), MUSIC_REMOVED (taken down, and it stays refused). An edit goes the same way. Send only tracks to retry the ones a release left behind. confirm_release and confirm_tracks name events the relay already holds: they run the same checks and are stamped without being written. A 200 answers per event: published, retry (send it again; nothing is charged) or refused. complete is true when every event is published. The call is safe to repeat. A playlist, a deletion, a channel definition and a comment go to the relay directly.",
                "tags": [
                    "music"
                ],
                "summary": "Publish music to the Wavlake relay",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.MusicPublishRequest"
                            }
                        }
                    },
                    "description": "Signed events, and events the relay already holds",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "One result per event",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.MusicPublishResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No events, more than 30 tracks, an event that is not a signed track or release, tracks of more than one release, or a track or release with no podcast guid: an `i` of podcast:item:guid (a track) or podcast:guid (a release) with its matching `k` (MUSIC_GUID_REQUIRED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The release's hosting is not paid for (HOSTING_PAYMENT_REQUIRED, D146)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Signed by a key other than the uploader (MUSIC_NOT_UPLOADER)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An artist credit (an `artist` tag of an event to be written) is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`, every held credit as signed), not hosted (MUSIC_NOT_HOSTED), the event's home is not its row's (MUSIC_HOME_MISMATCH), the audio expired or is not ready (AUDIO_EXPIRED, AUDIO_NOT_READY), a track uploaded for another release (RELEASE_TRACK_MISMATCH), a purchase tag that disagrees with the saved price (PURCHASE_PRICE_MISMATCH), a release offer the API cannot sell (RELEASE_OFFER_TOO_FEW_TRACKS, RELEASE_NOT_SELLABLE), a new release with no genre (RELEASE_GENRE_REQUIRED), a release the migration prepared going out the first time with no channel (CHANNEL_REQUIRED, #5478), a podcast guid other than the one the track or release first went out with (MUSIC_GUID_CHANGED) or one another live track or release holds (MUSIC_GUID_TAKEN), or the relay refused the release (RELAY_REFUSED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "Taken down (MUSIC_REMOVED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "A check could not be answered (the reserved artist list included) or the relay is unreachable. Nothing is out; send it again",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nip05": {
            "get": {
                "security": [],
                "description": "Looks up NIP-05 verification data for the username provided via the `name` query parameter, as specified in NIP-05. Returns a raw NIP-05 response with `names` (username → hex pubkey) and `relays` (pubkey → relay URLs). When `name` is absent or no match is found, returns empty `names`/`relays` maps (per NIP-05); the endpoint does not enumerate the full directory.",
                "tags": [
                    "nip05"
                ],
                "summary": "Get NIP-05 verification data",
                "parameters": [
                    {
                        "description": "NIP-05 local-part to look up (e.g., 'josh'). When omitted, returns an empty response.",
                        "name": "name",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "NIP-05 verification data with names and relays",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Response"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to fetch verification data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "A required dependency is unreachable; the deployment is not ready",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nip05/held": {
            "get": {
                "description": "For a channel address nobody holds that the reserved artist list keeps for an act nobody has claimed: the act's name and its CC0 links (one official website, its Wikidata and MusicBrainz records), for the placeholder page (#5479). Every other address answers 404, the same as a free name. Public endpoint, no auth required.",
                "tags": [
                    "nip05"
                ],
                "summary": "Held channel address placeholder",
                "parameters": [
                    {
                        "description": "Channel address to look up",
                        "name": "name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The acts the address is kept for",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.HeldNameResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a held name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The reserved list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nip05/held/search": {
            "get": {
                "description": "The held, unclaimed acts on the reserved artist list whose names match the words loosely (exact, start, inside, or a letter or two off), best first, three at most: each with the address its placeholder page is at (#5693). Public endpoint, no auth required.",
                "tags": [
                    "nip05"
                ],
                "summary": "Search held channel addresses",
                "parameters": [
                    {
                        "description": "The words typed (2 to 100 characters)",
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The acts found, best first; empty when none",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.HeldNameSearchResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing, too short or too long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many searches from this address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The reserved list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nip05/resolve": {
            "get": {
                "description": "Resolves a NIP-05 username to its pubkey, type, community id / routing pointer and relay hints. Public endpoint, no auth required. `artistDTag` retired with the persona model (PRD (c) Phase 8).",
                "tags": [
                    "nip05"
                ],
                "summary": "Resolve NIP-05 username",
                "parameters": [
                    {
                        "description": "NIP-05 username to resolve",
                        "name": "username",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resolved NIP-05 data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.Nip05ResolveResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing username query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Username not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to resolve",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/notifications": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the signing key's newest 100 account events within 180 days, ordered by creation time then ID descending. Scope comes only from the NIP-98 signature and server tenant. No amounts, buyer identities or public-content prose are returned. Read and clear state is managed by the client.",
                "tags": [
                    "Notifications"
                ],
                "summary": "Read your account notifications",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.AccountNotificationsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Notifications unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nwc/connections": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns all active (non-revoked) NWC connections for the authenticated user. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "nwc"
                ],
                "summary": "List user's NWC connections",
                "responses": {
                    "200": {
                        "description": "List of connections",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/internal_accounting_handlers.NWCConnectionResponse"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Registers a new NWC connection for the authenticated user. Client generates keypair client-side and sends only the public key. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "nwc"
                ],
                "summary": "Create NWC connection",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateNWCConnectionRequest"
                            }
                        }
                    },
                    "description": "Connection creation request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Connection created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.NWCConnectionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters or validation failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Account not found - user must verify first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Connection with this pubkey already exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nwc/connections/{id}": {
            "delete": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Soft-deletes (revokes) an NWC connection. Verifies ownership before deletion. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "nwc"
                ],
                "summary": "Revoke NWC connection",
                "parameters": [
                    {
                        "description": "Connection ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Connection revoked successfully"
                    },
                    "400": {
                        "description": "Invalid connection ID format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required or cannot delete another user's connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Connection not found or already revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates the device name for an NWC connection. Verifies ownership before update. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "nwc"
                ],
                "summary": "Update NWC connection device name",
                "parameters": [
                    {
                        "description": "Connection ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.UpdateConnectionRequest"
                            }
                        }
                    },
                    "description": "Update request with new device name",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Connection updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.NWCConnectionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid connection ID format or request body",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required or cannot update another user's connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Connection not found or already revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nwc/custodial-wallet": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Registers or retrieves a Wavlake custodial wallet NWC connection for Tier 3 users.\nSupports multi-device access: each device generates its own keypair.\nClient generates keypair locally and sends only the public key.\nReturns partial NWC URI (without secret) - client appends secret locally.\nIdempotent: same pubkey returns existing connection.\nMax 21 connections per user - exceeding triggers LRU eviction.\nUses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "nwc"
                ],
                "summary": "Register custodial wallet connection with client-generated pubkey",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateCustodialWalletRequest"
                            }
                        }
                    },
                    "description": "Client public key and optional device name",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Custodial wallet connection registered/retrieved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CustodialWalletResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid client public key format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Account not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Client pubkey already registered by another user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/nwc/wallet-pubkey": {
            "get": {
                "description": "Returns the wallet service public key for building NWC connection URIs client-side",
                "tags": [
                    "nwc"
                ],
                "summary": "Get wallet service public key",
                "responses": {
                    "200": {
                        "description": "Wallet public key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.WalletPubkeyResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to load wallet service keys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/onramp/session": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Mints a Stripe Crypto Onramp session locked to the caller's own Spark on-chain BTC (P2TR) deposit address and returns a Stripe-hosted redirect URL. Stripe is merchant of record for the cash → on-chain BTC leg; the backend holds no balance, signs nothing, and moves no funds. Authenticated via NIP-98 (Tier 1) so Nostr-only listeners can fund. The address is validated by a full bech32m taproot decode and locked (lock_wallet_address=true) before any Stripe call. Returns 503 when the onramp is not configured (STRIPE_ONRAMP_SECRET_KEY unset).",
                "tags": [
                    "accounting-onramp"
                ],
                "summary": "Create a Stripe Crypto Onramp session",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.OnrampSessionRequest"
                            }
                        }
                    },
                    "description": "Onramp session request (amount + BTC address)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Onramp session created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.OnrampSessionResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request, amount out of band, or invalid BTC address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Onramp not available",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "description": "Returns the OpenAPI 3.0 document describing this API. Regenerated via `task openapi:generate`; CI fails on drift. Public endpoint.",
                "tags": [
                    "discovery"
                ],
                "summary": "OpenAPI 3.0 specification",
                "responses": {
                    "200": {
                        "description": "OpenAPI 3.0 document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ramp/session": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a session for the ZBD Ramp widget to enable fiat-to-Bitcoin purchases.\nUser must be Tier 3 verified. Purchased sats are delivered to the user's Wavlake Lightning Address.\nUses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "ramp"
                ],
                "summary": "Create ZBD Ramp session",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateRampSessionRequest"
                            }
                        }
                    },
                    "description": "Ramp session creation request",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Ramp session created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CreateRampSessionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "KYC verification (Tier 3) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Account not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error or ZBD API error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Ramp service not enabled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Mints the release record the studio's album builder needs before any track row exists. `nostr_d_tag` is the release id the API issued the caller (POST /v1/releases/ids); absent, the API mints one and returns it. A d-tag the API did not issue to the caller is refused (403 RELEASE_ID_NOT_ISSUED, #5509), so nobody can take an old album's id. `community_id` is required (#5478): the Studio makes the record when a release is first published, and publishing needs a channel, so none is 400 CHANNEL_REQUIRED. The caller must be that community's current owner, read off the Wavlake relay (there is no communities table — the relay is the authority). Records nothing about cross-listing.",
                "tags": [
                    "releases"
                ],
                "summary": "Create a release record",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.CreateReleaseRequest"
                            }
                        }
                    },
                    "description": "Release record",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Release record created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed body or community id, no community id (CHANNEL_REQUIRED, #5478), or a purchase_price_cents outside the configured bounds (PURCHASE_PRICE_OUT_OF_RANGE)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Caller does not own this community, or the d-tag is not a release id the API issued the caller (RELEASE_ID_NOT_ISSUED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An artist credit is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`, every held credit as submitted); community not on the Wavlake relay (NOT_ON_RELAY); d-tag already used by this publisher (ALREADY_EXISTS); or another publisher holds a live release there (RELEASE_ID_TAKEN)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Wavlake relay unreachable — the owner check fails closed — the reserved artist list could not be read, or a release id issued before #5509 could not be checked against the old catalog",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/embed-plays": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the signing key's count for its own release at the d-tag: plays in full, plays as excerpts, and the host names it played on most (at most ten). Shown to the artist only; it is not a stream count and feeds no earnings. A release with no plays answers zeros. Requires NIP-98 specifically. Answers 404 NOT_FOUND when EMBED_ENABLED is unset.",
                "tags": [
                    "releases"
                ],
                "summary": "Read a release's plays in the player on other websites",
                "parameters": [
                    {
                        "description": "The release's d-tag (colons allowed)",
                        "name": "d",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The count",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPlaysResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed d-tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "EMBED_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Lookup failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/embed-setting": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the signing key's setting for its own release at the d-tag: \"off\" (no setting is stored — the starting state), \"excerpt\" or \"full\". The d-tag is a query value and may contain colons. Requires NIP-98 specifically: the setting is keyed by the release's signer. Answers 404 NOT_FOUND when EMBED_ENABLED is unset.",
                "tags": [
                    "releases"
                ],
                "summary": "Read a release's setting for the player on other websites",
                "parameters": [
                    {
                        "description": "The release's d-tag (colons allowed)",
                        "name": "d",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The setting",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedSettingResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed d-tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "EMBED_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Lookup failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Sets the signing key's setting for its own release. \"excerpt\" lets the release play on other websites: free songs in full, paid songs as their 40-second excerpt, and a paid song of 40 seconds or less in full. \"full\" plays every song in full, a paid song on a short-lived play pass within the soft lock's limits; it is refused (400) while EMBED_FULL_PLAY_ENABLED is off (full_available says which). \"off\" removes the setting, which is the starting state. The release need not be out: a release that is not out answers \"not available\" to the player whatever its setting. Requires NIP-98 specifically. Answers 404 NOT_FOUND when EMBED_ENABLED is unset.",
                "tags": [
                    "releases"
                ],
                "summary": "Set a release's player on other websites to off, excerpt or full songs",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedSettingRequest"
                            }
                        }
                    },
                    "description": "The release and its setting",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The setting after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedSettingResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed d-tag, an unknown mode, or full while EMBED_FULL_PLAY_ENABLED is off",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "EMBED_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Write failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/home": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Homes the caller's STANDALONE release, every track linked to it, and every one of the caller's tracks named in track_d_tags, in the named community (#3193, #3733 — the API half of spec §7.2's re-home republish). track_d_tags is optional: the release's own track list, read off the relay, at most 500 names (more is 400, before any relay read), blank names ignored. Name every track: a track row is often not linked to the release's record. Every name must be a track the release lists — the newest version of the caller's 34139 on the Wavlake relay, the caller's own pointers only; one that is not refuses the whole request with 400 track_not_in_release. With no names, the release is not read. The caller must own the community, read off the Wavlake relay; an unreachable relay, for either read, fails closed with 503. Re-homing only ADDS a home: if the release or any linked or named track is already homed elsewhere, the whole move is 409 release_home_conflict. Nothing is written on any refusal. Another key's row is never touched, even when named. Idempotent — re-homing to the same community succeeds. Call this BEFORE re-signing the release and its tracks, so their publish confirms verify against the new home.",
                "tags": [
                    "releases"
                ],
                "summary": "Add a home to a standalone release",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.RehomeReleaseRequest"
                            }
                        }
                    },
                    "description": "The release d-tag and the target community",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Release homed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing d-tag, a malformed community id, more track d-tags than a release holds, or a named track the release does not list (track_not_in_release)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The caller does not own the community",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The caller publishes no release at that d-tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Community not on the Wavlake relay (NOT_ON_RELAY), or already homed elsewhere (release_home_conflict)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the ownership check and the release read fail closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/ids": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Hands out a new release id (its d-tag, a UUID), issued to the caller's key (#5509). The Studio asks for one when a release is started, before any upload: a new upload (`release_d_tag`) and a new release record (`nostr_d_tag`) may name only an id the API issued the caller, or a release the caller already holds. A live release d-tag names one release across every publisher, as a track's does. Nothing else is written; an id never used is harmless.",
                "tags": [
                    "releases"
                ],
                "summary": "Get an id for a new release",
                "responses": {
                    "201": {
                        "description": "The new release id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.IssuedReleaseID"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "More than 30 ids asked for in a minute by this key (RATE_LIMITED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The id could not be recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/move": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Moves the caller's release — its record when it has one, every track row linked to it, and every one of the caller's rows named in track_d_tags — from from_community_id to to_community_id, in one transaction (channel-move PRD). Null on either side means standalone; a release the Wavlake relay holds cannot be moved to standalone (409 CHANNEL_REQUIRED, #5478), while a draft or a release taken down can. The move is a compare-and-swap: every row must be at from_community_id, or already at to_community_id (a resumed move); a row anywhere else refuses the whole move with 409 release_home_conflict and nothing is written. The caller must own to_community_id, read off the Wavlake relay (fails closed with 503). A published named track must be the release's own (400 track_not_in_release): one the release lists on the Wavlake relay or, when the relay holds no version of the release at all (it was taken down, or never went out), one the release's own record holds — a track of the caller's uploaded for this release, or held by the caller's record of it. A relay read that fails is 503, never \"not on the relay\". An unpublished named track is the caller's draft and moves as named. Another key's row is never touched. A pending or broadcasting schedule for the release or its tracks refuses the move with 409 release_move_scheduled, without changing any home or move log. Cancel the schedule or wait for it to finish before moving. Call this BEFORE re-signing the release and its tracks, so their confirms verify against the new home.",
                "tags": [
                    "releases"
                ],
                "summary": "Move a release to another of the caller's channels, or to standalone",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.MoveReleaseRequest"
                            }
                        }
                    },
                    "description": "The release d-tag, its current home and the target home",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Release moved (or already there)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.MoveReleaseResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing d-tag, a malformed community id, the same home on both sides, too many track d-tags, or a published named track that is not the release's own (track_not_in_release)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The caller does not own the target community",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The caller has no release record and no track row to move",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Target community not on the Wavlake relay (NOT_ON_RELAY), a release that is out moved to no channel (CHANNEL_REQUIRED), a row is not where the caller said (release_home_conflict), or the release has a pending or broadcasting schedule (release_move_scheduled)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the ownership check and the release read fail closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/unpublish": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Marks the caller's release, and its tracks, unpublished after it was taken down on the relay (#4412). Keyed by the release d-tag; the caller is the signer. The Wavlake relay is read first: while it still holds a version of the release nothing is written and the answer is 409 RELEASE_STILL_ON_RELAY; a relay read that fails is 503, never \"taken down\". Then, in one transaction: the release's record (when the caller has one) loses published_at, its event id and its whole-release price, and every published track row of the caller's that is the release's own (uploaded for it, or held by the caller's record of it and listed by no other published release of theirs) loses published_at. From then on neither the release nor its tracks can be bought, and a track's audio is served only to its owner and to an account that already bought it; everyone else gets 404, as for a track that does not exist. Hosting stays paid, purchases stay, and nothing is deleted: publishing again confirms the release and its tracks again and charges nothing. Safe to repeat: a second call changes nothing and answers 200 with tracks_unpublished 0. A caller with no record and no track at that d-tag gets 200 with a null release.",
                "tags": [
                    "releases"
                ],
                "summary": "Record that a release was taken down",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UnpublishReleaseRequest"
                            }
                        }
                    },
                    "description": "The release d-tag",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Release marked unpublished (or already was)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.UnpublishReleaseResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing d-tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The Wavlake relay still holds the release (RELEASE_STILL_ON_RELAY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the release read fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/{id}/pricing": {
            "patch": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Sets or withdraws the price of the WHOLE release (buy-to-own, D147), in whole US cents. The body is the release's whole buy-to-own state: an absent or null purchase_price_cents withdraws the offer. A price must sit inside the configured floor and release ceiling (GET /artist/sale-price-bounds). The path takes the record id or, for a release already out (whose editor knows only its d-tag), the d-tag of one of the caller's own releases. The studio then re-signs the release with the matching [\"purchase\", \"<dollars>\", \"USD\"] tag and confirms it (the confirm takes either form too); the confirm refuses a release with fewer than two tracks (a single is sold through its song) or one listing a track that cannot be sold.",
                "tags": [
                    "releases"
                ],
                "summary": "Set a release's buy-to-own price",
                "parameters": [
                    {
                        "description": "Release record ID (UUID), or the d-tag of one of the caller's own releases",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UpdateReleasePricingRequest"
                            }
                        }
                    },
                    "description": "The release price",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Price saved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "A price outside the configured bounds (PURCHASE_PRICE_OUT_OF_RANGE)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Release belongs to another publisher",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/{id}/publish-failed": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records publish_attempted_at and the relay's reason, and NOTHING else — never published_at, never the lifecycle sweep, never the deposit. The deposit is final once the upload succeeds (D63 (C)); a refused publish is fixed and retried on the same row at no extra cost.",
                "tags": [
                    "releases"
                ],
                "summary": "Record that a release publish was refused",
                "parameters": [
                    {
                        "description": "Release record ID (UUID), or the d-tag of one of the caller's own releases",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ReportPublishFailedRequest"
                },
                "responses": {
                    "200": {
                        "description": "Failure recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing reason",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Release belongs to another publisher",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/releases/{id}/published": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Verifies on the Wavlake relay — and only there — that the named event exists, is this release's 34139, and carries the release's home community. Stamps published_at on success. A confirm naming an event the Wavlake relay does not hold is 409 NOT_ON_RELAY: \"published\" must not mean \"some relay accepted it\".",
                "tags": [
                    "releases"
                ],
                "summary": "Confirm a release was published",
                "parameters": [
                    {
                        "description": "Release record ID (UUID), or the d-tag of one of the caller's own releases",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ConfirmPublishRequest"
                },
                "responses": {
                    "200": {
                        "description": "Publish confirmed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing event_id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (NIP-98)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The release lists a music track whose hosting is not paid for (HOSTING_PAYMENT_REQUIRED, D146)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Release belongs to another publisher",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Release not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The Wavlake relay does not hold this event (NOT_ON_RELAY); the release lists a music track uploaded for another release (RELEASE_TRACK_MISMATCH, D146); the event's purchase tag disagrees with the saved price (PURCHASE_PRICE_MISMATCH); a release offer on fewer than two tracks (RELEASE_OFFER_TOO_FEW_TRACKS); a release offer listing a track that cannot be sold (RELEASE_NOT_SELLABLE, details name the tracks); or a new studio release's first publish naming no genre (RELEASE_GENRE_REQUIRED, #4698)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Wavlake relay unreachable, or the hosting check or track list could not be written",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/sitemap/entries": {
            "get": {
                "description": "Returns every page a listener can open, for sitemap XML generation: published tracks, published releases, and each channel holding a published release (its id as d_tag, no pubkey). Drafts, take-downs and deleted content are left out.\nSupports pagination via limit and offset query parameters.",
                "summary": "Get sitemap entries",
                "parameters": [
                    {
                        "description": "Number of entries to return (default 50000, max 50000)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Offset for pagination (default 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "*/*": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SitemapResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "*/*": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "*/*": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/authorization": {
            "get": {
                "description": "Public endpoint. Returns {authorized: true} only when a durable authorization record matches BOTH the supplied username and Spark pubkey. Always responds 200 and never reveals which half mismatched. The Vercel LNURL proxy forwards a Breez register call only on authorized:true and fails closed (rejects) on any error.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Check a Spark Lightning address binding",
                "parameters": [
                    {
                        "description": "Claimed NIP-05 username",
                        "name": "username",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Opaque Spark identity pubkey",
                        "name": "sparkPubkey",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authorization status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkAddressCheckResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing username or sparkPubkey query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to check authorization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Removes the durable authorization for a username. Requires NIP-98 authentication tied to a registered account (Tier 2); only the owner that recorded the binding may delete it. This is the un-block path — removing the binding also frees the NIP-05 name for release. Phase 4's \"remove pay address\" calls this alongside the Breez delete.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Remove a Spark Lightning address binding",
                "parameters": [
                    {
                        "description": "Claimed NIP-05 username",
                        "name": "username",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authorization removed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing username query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - NIP-98 authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Authorization owned by a different identity",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No authorization found for username",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to remove authorization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/authorize": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records a durable authorization binding a claimed NIP-05 username to a Spark wallet identity (33-byte compressed public key, hex). Requires NIP-98 authentication tied to a registered account (Tier 2). The caller must already own the username via an active NIP-05 verification (claim-then-authorize). The account's wallet binding (spark_wallet_bindings, per network) is checked in the same transaction: no binding creates one; the same wallet proceeds (a rename on the same wallet); a DIFFERENT wallet is refused with 409 WALLET_BINDING_CONFLICT and nothing is written. Moving to another wallet is POST /spark/lnurl/recover.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Authorize a Spark Lightning address binding",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SparkAddressAuthorizeRequest"
                            }
                        }
                    },
                    "description": "Username + opaque Spark pubkey",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Authorization recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkAddressAuthorization"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request body, username, or Spark pubkey",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - NIP-98 authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Username owned by a different identity",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Username not claimed - claim it first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "LEGACY_NAME_RESERVED — the name belongs to an existing Wavlake account (D132); ARTIST_NAME_RESERVED — a new address at a name held for a well-known artist (details: field `wallet_name`, names as submitted); WALLET_BINDING_CONFLICT — the account is bound to a different wallet on this network; CONFLICT — a page name cannot receive payments",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to record authorization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The existing-account check or the reserved artist list could not be read — binding fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/legacy-move": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records that the caller's own legacy `<name>@wavlake.com` now routes to their self-custodial wallet (founder ruling 2026-09-29, amending D114 + D132). One-way and per name; idempotent for the same account and name (200, `created:false`): a move another active sign-in key of the caller's account made is the account's own (#6101), and the row is never written again. Written only when every gate holds: the legacy catalog holds the name as the caller's own legacy username (not an act name); the caller holds the name here as their account name; the caller's Spark authorization for the name and the account's wallet binding on the network name the same wallet; the binding's backup check has passed; and the address server's own registration for the name resolves to that wallet. Requires NIP-98 (Tier 2). Old invoices, cached callbacks and old-feed keysend keep paying the legacy hosted balance.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Move a legacy Wavlake address to the caller's wallet",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.LegacyNameMoveRequest"
                            }
                        }
                    },
                    "description": "The name, and the wallet's network (default mainnet)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Already moved by this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyNameMove"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Move recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyNameMove"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid body, username or network",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The caller has not claimed this name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "LEGACY_MOVE_NOT_ELIGIBLE · LEGACY_NAME_RESERVED · LEGACY_MOVE_NAME_TAKEN · LEGACY_MOVE_NOT_AUTHORIZED · LEGACY_MOVE_BACKUP_UNCHECKED · LEGACY_MOVE_NOT_REGISTERED · LEGACY_NAME_ALREADY_MOVED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to record the move",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The legacy catalog or the address server's registry could not be read — nothing written",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/legacy-moves": {
            "get": {
                "description": "Public. Every legacy `<name>@wavlake.com` that moved to its owner's wallet, with its derived state: `moved` (the apex routes it to the wallet; a wallet-side failure is an error, never a fallback) or `released` (the owner renamed away; the apex routes it nowhere). The apex router reads this before its legacy leg and keeps a last-known-good copy; an unreadable list falls back to legacy. Carries no owner key, wallet or legacy id. Cacheable for 30 seconds.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "List moved legacy addresses",
                "responses": {
                    "200": {
                        "description": "The moves",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyNameMovesResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/legacy-moves/{name}": {
            "get": {
                "description": "Public. One legacy `<name>@wavlake.com`'s move state (`moved` | `released`), or 404 when the name never moved. Same derivation as the list.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Read one moved legacy address",
                "parameters": [
                    {
                        "description": "The name",
                        "name": "name",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The move",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.LegacyNameMoveState"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The name never moved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The move could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/recover": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Re-points a claimed NIP-05 username's pay address to a NEW Spark wallet identity (33-byte compressed public key, hex), for lost-passkey recovery. Requires NIP-98 authentication tied to a registered account (Tier 2); the caller must currently own the username via an active NIP-05 verification — the SAME ownership gate as authorize, deliberately NOT requiring the old wallet's signature. Re-points the ownership binding (binding 1) AND the account's wallet binding (spark_wallet_bindings, per network) in one transaction — this is the deliberate wallet switch — and then frees the orphaned (domain, username) row on the self-hosted Breez LNURL server (binding 2) so the new wallet can register the name. Recovery only restores the address, never lost funds. Rate-limited and audit-logged. Returns 503 when recovery is not configured.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Recover a Spark Lightning address onto a new wallet",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SparkAddressRecoverRequest"
                            }
                        }
                    },
                    "description": "Username + NEW wallet's opaque Spark pubkey",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Handle re-pointed to the new wallet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkAddressRecoverResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request body, username, or Spark pubkey",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - NIP-98 authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Username owned by a different identity",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Username not claimed - claim it first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "CONFLICT — a page name cannot receive payments; ARTIST_NAME_RESERVED — the caller has no address at a name held for a well-known artist, so this would be a new one (details: field `wallet_name`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many recovery attempts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to recover address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Recovery is not available, or the reserved artist list could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/lnurl/resolution/{name}": {
            "get": {
                "description": "Public. Returns {resolves: true} only when the address server's own registration for the name is the wallet recorded in the name's authorization. No authorization, no registration, or a different wallet is {resolves: false}; an invalid name is {resolves: false}. The address server's registry not configured or unreadable is 503 — never an answer. Carries no wallet or owner. Not cacheable.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Check that a Wavlake address resolves to its authorized wallet",
                "parameters": [
                    {
                        "description": "The address name (the part before the @)",
                        "name": "name",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resolution status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkAddressResolutionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The authorization could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The address server's registry is not configured or could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/spark/wallet-binding": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns which self-custodial wallet the NIP-98 account key owns on a network (a non-secret descriptor), or 404 when there is none. Owner only: the lookup is keyed by the signed-in key. Requires NIP-98 authentication tied to a registered account (Tier 2).",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Get the account's wallet binding",
                "parameters": [
                    {
                        "description": "mainnet or regtest",
                        "name": "network",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The binding",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkWalletBinding"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or unknown network",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 authentication required, or PUBKEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No wallet binding on this network",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to read the binding",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Create-if-absent or compare-and-match, never an upsert (founder ruling 5 of 2026-09-28). scheme is root-v1 (the passkey wallet: rpId required, credentialIds allowed) or words-v1 (the no-passkey wallet: rpId and credentialIds must be absent). No binding: creates it (201). A binding naming the SAME wallet identity: 200, idempotent, and its stored scheme never changes — may add credential-id hints and fill an unknown rpId (root-v1 only), and stamp backupCheckedAt when backupChecked is true (only a passing check sets it). A binding naming a DIFFERENT wallet: 409 WALLET_BINDING_CONFLICT and nothing is written; the deliberate switch is POST /spark/lnurl/recover. The body must carry the wallet identity key's signature over `wavlake-wallet-binding:v1:<owner>:<network>` (ECDSA secp256k1 over SHA-256 of the UTF-8 bytes; hex, 64-byte compact r||s or DER); a missing or bad signature is 403 WALLET_SIGNATURE_INVALID. Requires NIP-98 authentication tied to a registered account (Tier 2); the binding is always the signed-in key's own.",
                "tags": [
                    "spark-lnurl"
                ],
                "summary": "Bind a wallet to the account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SparkWalletBindingRequest"
                            }
                        }
                    },
                    "description": "The descriptor and the wallet's signature",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The same wallet was already bound",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkWalletBinding"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Binding created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SparkWalletBinding"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid body, network, wallet identity, scheme, label, rpId or credential ids (including passkey fields on a words-v1 wallet)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 authentication required, or PUBKEY_NOT_LINKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "WALLET_SIGNATURE_INVALID — the wallet's signature is missing or does not verify",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "WALLET_BINDING_CONFLICT — a different wallet is bound on this network",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to record the binding",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/splits/invites/claim": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Takes every pending split invite made for your account's verified email — by any artist — and moves what each holds into your earnings, in one transaction. From then on your share of those tracks is paid to you directly. Needs both your sign-in (Firebase) and a signature from a key linked to that account; the email must be verified. Calling it again is harmless: nothing is left to take, and the answer lists nothing. Gated by SPLITS_ENABLED.",
                "tags": [
                    "Splits"
                ],
                "summary": "Collect earnings shared with your email",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SplitInviteClaimResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No verified email (SPLIT_CLAIM_EMAIL), or the signing key is not linked to the account (SPLIT_CLAIM_KEY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limited",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Splits are currently unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/channels/{communityId}/products": {
            "get": {
                "description": "The listings a channel's Merch tab may show: active, their seller still able to sell, and not hidden by staff, newest listed first (at most 50). The API's half of each: its price, two shipping prices, whether it is in stock and its address; the words and pictures are the signed listing's, on the relay at that address. Public, unsigned, rate limited per IP. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "A channel's artist-run listings",
                "parameters": [
                    {
                        "description": "Channel id (32 hex)",
                        "name": "communityId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The channel's listings; none is an empty list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreChannelProductsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not a channel id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/orders": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Writes the order with its address, holds its stock for 15 minutes (the stock goes down now and comes back if it is not paid in time), opens its money row with the four amounts and opens a card checkout: a Stripe Session the in-app payment form pays, whose secret is answered here and nowhere else. The seller's switch and the staff hide are checked again here. request_id (a UUID) is the client's key for one tap: the same key again answers the same order and its open payment. Answers STORE_CARD_OFF where the store's card flow is not on (STRIPE_INLINE_CHECKOUT_FLOWS), before anything is written. With payment_method \"credits\" no card checkout is opened and the answer carries no payment: POST /store/orders/{id}/pay-credits pays the order (STORE_CREDITS_OFF where that is not on); the same request_id sent again as \"card\" opens its card checkout after all. Never cached. NIP-98, Tier 1. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Open an order and its card payment",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreCheckoutRequest"
                            }
                        }
                    },
                    "description": "The cart, the address and the client's key",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "The order and its payment",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE, STORE_CANNOT_SHIP or RETURN_ORIGIN_NOT_ALLOWED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "PURCHASE_BLOCKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_SOLD_OUT, STORE_MIXED_CART, STORE_UNAVAILABLE or STORE_ORDER_CLOSED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "STORE_TOO_MANY_HELD: the key holds stock on 3 orders already, or too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "STORE_CARD_OFF, STORE_CREDITS_OFF, or SERVICE_UNAVAILABLE: sales tax could not be worked out just now",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/orders/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The order as the API holds it now: its lines, its four amounts and their total, where its money stands and, while it can be paid, when its stock hold runs out. Never a payment secret, and never a call to Stripe (the confirm asks Stripe). Another key's order is 404. NIP-98, Tier 1. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Read one of the buyer's orders",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/orders/{id}/confirm": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Called the moment the in-app form reports success, after a payment method that left the page comes back, and by Check again. Takes no outcome from the client: the API reads the order's Stripe Session and, when it is paid, lands the payment on the order (paid status, the tax rows and the hold decision in one transaction, as the webhook does). An order whose stock hold ran out is closed at Stripe first, then its stock goes back. While the order can still be paid the answer carries its payment again (the same Session). Never cached. NIP-98, Tier 1. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Ask Stripe about an order's card payment",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order, and its payment while it can be paid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_ORDER_CLOSED: the order's money never opened",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "STORE_CARD_OFF",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/orders/{id}/pay-credits": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Pays one of the buyer's open orders with their pay-as-you-go credits, at once: the order's total (price, shipping and tax) comes off their credits and the order is paid in one step, or nothing is taken. Membership credits never pay for merch. No body. An order already paid answers as it stands and takes nothing twice. Refused with nothing taken: INSUFFICIENT_CREDITS (details: needed_cents, available_cents), ACCOUNT_FROZEN, PURCHASE_BLOCKED, STORE_ORDER_CLOSED (its stock hold ran out, or it was undone), STORE_CREDITS_OVER_LIMIT (a total above $1,000), STORE_PAYMENT_IN_PROGRESS (a card payment of the same order may be under way; the confirm says how it ended). An order's open card checkout is closed first, so the order is never paid twice. A refund of an order paid this way goes back to credits. Never cached. NIP-98, Tier 1. Mounted only with STORE_ENABLED; answers STORE_CREDITS_OFF unless STORE_CREDITS_ENABLED is on.",
                "tags": [
                    "store"
                ],
                "summary": "Pay an open order with credits",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order, paid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "STORE_CREDITS_OVER_LIMIT",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "ACCOUNT_FROZEN or PURCHASE_BLOCKED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "INSUFFICIENT_CREDITS, STORE_ORDER_CLOSED or STORE_PAYMENT_IN_PROGRESS",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "STORE_CREDITS_OFF",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/products": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Every product the signed-in key has, drafts and listed, newest first. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "The signed-in seller's products",
                "responses": {
                    "200": {
                        "description": "The products",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProductsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "A draft product for the signed-in key, which must be able to sell (STORE_NOT_SELLER otherwise). The API keeps its price, its two shipping prices (shipped alone, each extra item) and its stock. The category must be on the band-merch list (STORE_CATEGORY). A channel, when given, must be the caller's. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Save a new product as a draft",
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.StoreProductRequest"
                },
                "responses": {
                    "201": {
                        "description": "The draft",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProduct"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE or STORE_CATEGORY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "STORE_NOT_SELLER, or not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "NOT_ON_RELAY: the channel is not on the relay",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/products/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The product, a draft or listed. Another key's product is 404. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "One of the signed-in seller's products",
                "parameters": [
                    {
                        "description": "Product id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The product",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProduct"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such product, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Deletes a draft that was never listed. A listed product is refused STORE_NOT_DRAFT. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Delete a draft",
                "parameters": [
                    {
                        "description": "Product id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "404": {
                        "description": "No such product, or not the caller's",
                        "content": {
                            "*/*": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_NOT_DRAFT",
                        "content": {
                            "*/*": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Changes a draft or a listed product. A listed product keeps its old listing on the relay until its seller signs the new one (POST /store/products/{id}/list), but an order is always priced from what the API holds. An ended product cannot change. The same checks as a new product. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Change a product",
                "parameters": [
                    {
                        "description": "Product id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/github_com_wavlake_monorepo_internal_models.StoreProductRequest"
                },
                "responses": {
                    "200": {
                        "description": "The product",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProduct"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE or STORE_CATEGORY",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "STORE_NOT_SELLER, or not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such product, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The product has ended",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/products/{id}/list": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The artist's signed NIP-99 listing (kind 30402) for the product, built from the product by the shared builder. The API checks the key can sell (STORE_NOT_SELLER), owns the product's channel, and that the listing is signed by the product's seller and names the product's d-tag (its id), title, price in decimal USD and category (STORE_LISTING_MISMATCH otherwise). It writes the listing to Wavlake's relay, reads it back, and only then marks the product listed. A product changed meanwhile answers STORE_PRODUCT_CHANGED: sign again. Safe to repeat. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "List a product: check its signed listing and write it to the relay",
                "parameters": [
                    {
                        "description": "Product id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreListRequest"
                            }
                        }
                    },
                    "description": "The signed listing",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The listed product",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProduct"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "STORE_LISTING_MISMATCH or INVALID_VALUE (no channel)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "STORE_NOT_SELLER, or not the channel's owner",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such product, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_PRODUCT_CHANGED, or the product has ended",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The relay did not take or return the listing; try again",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/quote": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The cart's price, shipping, shipping tax and tax, kept apart, and their total, for a US address (the total depends on it, so it comes first). Writes nothing. Only products a channel's Merch tab shows can be priced: active, their seller still able to sell, not hidden by staff; one store per cart (STORE_MIXED_CART), at most 20 lines of 1 to 10 each, and never more than is left (STORE_SOLD_OUT, with what is left). Tax comes through the tax seam: 0 % by default, or Stripe Tax where STORE_TAX_CALCULATOR is stripe, which answers SERVICE_UNAVAILABLE (try again) when it cannot be reached and never a 0 % quote instead. NIP-98, Tier 1. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Price a cart going to an address",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreQuoteRequest"
                            }
                        }
                    },
                    "description": "The cart and the address",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The amounts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreQuote"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE or STORE_CANNOT_SHIP",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_SOLD_OUT, STORE_MIXED_CART or STORE_UNAVAILABLE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE: sales tax could not be worked out just now",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Whether staff turned selling on for the signed-in key (the store's seller switch), and the categories a product may take. The Studio draws its products only for a key that can. While the key cannot sell, `request` says where its latest ask for a store stands (`pending` or `denied`), and is absent when it never asked. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Whether the signed-in key can sell",
                "responses": {
                    "200": {
                        "description": "The key's switch, its ask and the categories",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller/orders": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The signed-in seller's paid orders, newest first: those waiting to ship (status=to_ship, at most 100), the newest 100 shipped (shipped), or all (all, the default: every order waiting to ship, up to 100 however old, and the newest 100 of the rest). to_ship counts the orders waiting, whatever the filter: the Studio's \"Needs attention\". Each carries its four amounts and, once shipped, the artist's share: the fee on the product price alone and what the artist got (price minus the fee, plus shipping; never tax), in millicents. Never the buyer's address (the order's own read has it). Read whether or not the seller switch is on. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "List the artist's orders",
                "parameters": [
                    {
                        "description": "to_ship, shipped or all",
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The orders",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrdersResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: an unknown status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller/orders/{id}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "One of the signed-in seller's paid orders with where it ships (the full address, for the seller alone), its shipment and, once shipped, the artist's share. Another seller's order, or one never paid, is 404. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Read one of the artist's orders",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The order and its address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller/orders/{id}/cancel": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The signed-in seller cancels one of their paid orders that has not shipped, and everything left of it is refunded to the buyer's card: the merch, the shipping and the tax (#5356; before shipping only, ruled 2026-11-05: once an order is marked shipped all sales are final). It is the staff refund's one money path (the tax reversed by line, the order cancelled, its stock back on sale) and emails the buyer. While the refund is on its way the order cannot ship. Idempotent: asked again it answers the refund it made (replayed) or finishes one Stripe had not answered; nothing goes back twice. 409 STORE_ORDER_SHIPPED for a shipped order, STORE_ORDER_DISPUTED for one the buyer charged back, STORE_ORDER_ON_HOLD for one Wavlake stopped for a person to check, STORE_ORDER_UNDONE for one already refunded or cancelled, STORE_REFUND_BUSY while another refund of it is on its way, STORE_REFUND_REFUSED when the card refund was refused (nothing changed); 502 STORE_REFUND_UNFINISHED when the answer was unclear (ask again). The seller switch is not read: an artist whose selling was turned off can still cancel what was bought. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Cancel and refund an unshipped order",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The cancelled order and what went back",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerCancelResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_ORDER_SHIPPED, STORE_ORDER_DISPUTED, STORE_ORDER_ON_HOLD, STORE_ORDER_UNDONE, STORE_ORDER_NOT_PAID, STORE_REFUND_BUSY or STORE_REFUND_REFUSED",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "STORE_REFUND_UNFINISHED: ask again to finish it",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Card refunds are not wired here",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller/orders/{id}/ship": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records the artist's shipment (a carrier and a tracking number, both optional) and marks the order shipped, which emails the buyer, then writes the artist's share: the earning, the platform fee on the product price alone (shipping and tax carry none) and the order's money row, in one transaction, held while the order's chargeback window is open. Called again on a shipped order it replaces the fields it is sent and writes nothing else. If the share could not be written this time the order still answers shipped and the share follows within minutes. 409 STORE_ORDER_NOT_PAID for an unpaid order, STORE_ORDER_DISPUTED for one whose payment the buyer charged back (the shipment is stopped), STORE_ORDER_UNDONE for a refunded or cancelled one. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Mark an order shipped",
                "parameters": [
                    {
                        "description": "Order id",
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreShipRequest"
                            }
                        }
                    },
                    "description": "The carrier and tracking number",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The order as it stands",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrderResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_VALUE: the carrier or tracking number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such order, or not the caller's",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "STORE_ORDER_NOT_PAID, STORE_ORDER_DISPUTED, STORE_ORDER_ON_HOLD or STORE_ORDER_UNDONE",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/seller/request": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "An artist who cannot sell asks for a store from the Studio (#5892). The ask is kept for staff, who approve it (store.sellers.grant) or say no (store.sellers.deny) in Wavlake Admin; it grants nothing by itself. The asker is the NIP-98 signer, never a body field, and the body is ignored. One ask waits per key: a second while one waits answers 409 STORE_REQUEST_PENDING, and a key that can already sell answers 409 STORE_ALREADY_SELLER. After a denial the key may ask again. Answers where the key now stands, as GET /store/seller does. NIP-98, Tier 2. Mounted only with STORE_ENABLED.",
                "tags": [
                    "store"
                ],
                "summary": "Ask the Wavlake team for a store",
                "responses": {
                    "201": {
                        "description": "Asked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No NIP-98 signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An ask already waits, or the key can already sell",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/store/status": {
            "get": {
                "description": "The store's fixed terms: its currency and the countries it ships to, and whether an order can be paid with credits here (credits_enabled, STORE_CREDITS_ENABLED) with the largest total credits can pay (credits_max_cents). Public and read-only. Answers 404 NOT_FOUND when STORE_ENABLED is unset.",
                "tags": [
                    "store"
                ],
                "summary": "Read what the store sells in and ships to",
                "responses": {
                    "200": {
                        "description": "The store's terms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "STORE_ENABLED is unset",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/checkout": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a Stripe Checkout session for purchasing credits. User must be authenticated via Firebase JWT or NIP-98.\nAmount must be between $10-$100 (1000-10000 cents). Creates a pending transaction record.\nThe optional `return_origin` (the calling client's origin, e.g. `https://beta.wavlake.com`) sends the person back to that origin on the configured success and cancel paths when it exactly matches an entry of the API's return-origin allowlist; any other value is refused with 400 `RETURN_ORIGIN_NOT_ALLOWED`. Absent, the configured URLs apply unchanged.",
                "tags": [
                    "stripe"
                ],
                "summary": "Create Stripe checkout session",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateCheckoutRequest"
                            }
                        }
                    },
                    "description": "Checkout session creation request",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Checkout session created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CreditPurchaseResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters (INVALID_REQUEST), or a return_origin that is not allowlisted (RETURN_ORIGIN_NOT_ALLOWED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Credit purchases suspended for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daily purchase limit reached for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/checkout-capability": {
            "get": {
                "description": "Returns the Stripe publishable key and the sales that pay inside the app (`credits`, `music`, `hosting`, `membership`, `store`; the artist-run store has no hosted page, so without `store` its card checkout is off). An empty list means every sale uses Stripe's hosted page. The list only chooses what a client draws: the API decides each sale itself.\nThis is a public endpoint with no authentication required. The publishable key is public by design.",
                "tags": [
                    "stripe"
                ],
                "summary": "Get the in-app payment capability",
                "responses": {
                    "200": {
                        "description": "Capability retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CheckoutCapabilityResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/credit-checkouts": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Account recovery when browser storage is gone. Lists only attempts with money in motion: payment processing or unknown, or paid and not yet credited. An unpaid form someone left is not listed, and a completed purchase stays in history. The buyer's one open form is first checked with Stripe, so a payment made just before a reload is credited by this read. `status` must be `active`.",
                "tags": [
                    "stripe"
                ],
                "summary": "List the buyer's credit checkouts with money in motion",
                "parameters": [
                    {
                        "description": "Must be active",
                        "name": "status",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The buyer's attempts, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutActiveListResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "status must be active",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Accepts a whole-dollar amount from $10 to $100 and returns one payable attempt. A repeated `requestId` with the same parameters returns the same result; with different parameters it returns 409 `IDEMPOTENCY_KEY_REUSED`. A new request with a different amount replaces an open unpaid attempt: the Session is expired first, and if that loses a race with a payment the response carries the paid or pending attempt with no way to pay.\nThe server chooses the presentation. The response carries `clientSecret` for an open inline Session or `checkoutUrl` for an open hosted one, and neither when the status is the answer. Not cacheable.",
                "tags": [
                    "stripe"
                ],
                "summary": "Start or replay a credit checkout",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreateCreditCheckoutRequest"
                            }
                        }
                    },
                    "description": "The amount, the client's request key and the return context",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The attempt, and how to pay when paying is next",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutSessionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not a whole-dollar amount from $10 to $100 (INVALID_REQUEST), or a return_origin that is not allowlisted (RETURN_ORIGIN_NOT_ALLOWED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Credit purchases suspended for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "This requestId already names a checkout with different parameters (IDEMPOTENCY_KEY_REUSED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Daily purchase limit reached, or too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/credit-checkouts/{attemptId}": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the buyer's own attempt: separate payment and fulfillment status, the exact amount credited once it has been, the expiry, and what may happen next. No client secret. Answers for an account that could not buy today, so an already-paid result stays readable. Unknown and unowned ids look the same.",
                "tags": [
                    "stripe"
                ],
                "summary": "Read one credit checkout attempt",
                "parameters": [
                    {
                        "description": "Attempt id",
                        "name": "attemptId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The attempt",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutAttemptStatus"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such attempt for this buyer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/credit-checkouts/{attemptId}/confirm": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Called the moment Stripe reports success in the browser, and by Check again. Takes no outcome from the client: the server reads the Session from Stripe and runs the same fulfillment as the webhook, so a forged call on an unpaid Session grants nothing and a repeat adds nothing. Returns the same status as GET. Limited with the reads.",
                "tags": [
                    "stripe"
                ],
                "summary": "Check a credit checkout with Stripe now",
                "parameters": [
                    {
                        "description": "Attempt id",
                        "name": "attemptId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The attempt",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutAttemptStatus"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such attempt for this buyer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/credit-checkouts/{attemptId}/fallback": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "For a form that cannot load. Idempotent. Expires an open unpaid Session and only then returns `checkoutUrl` for a hosted one at the same price for the same buyer. If the expiry loses a race with a payment, or the state is unknown, the response carries the status and no address. Not cacheable.",
                "tags": [
                    "stripe"
                ],
                "summary": "Move a credit checkout to the hosted page",
                "parameters": [
                    {
                        "description": "Attempt id",
                        "name": "attemptId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The attempt, with `checkoutUrl` when the hosted page is safe",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutSessionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Credit purchases suspended for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such attempt for this buyer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/stripe/credit-checkouts/{attemptId}/resume": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Rechecks ownership and whether the Session can still be paid, then returns its `clientSecret` or `checkoutUrl`, or the status alone when it cannot. An unpaid form is re-exposed only to a buyer who may buy today. Not cacheable.",
                "tags": [
                    "stripe"
                ],
                "summary": "Resume a credit checkout",
                "parameters": [
                    {
                        "description": "Attempt id",
                        "name": "attemptId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The attempt, and how to pay when it can still be paid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutSessionResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Credit purchases suspended for this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such attempt for this buyer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "In-app credit checkout is not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the current subscription status, cycle info, and spending progress.",
                "tags": [
                    "subscription"
                ],
                "summary": "Get subscription status",
                "responses": {
                    "200": {
                        "description": "Subscription status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SubscriptionStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No subscription found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription/cancel": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Sets cancel_at_period_end on the Stripe subscription. The subscription remains\nactive until the end of the current billing period.",
                "tags": [
                    "subscription"
                ],
                "summary": "Cancel subscription",
                "responses": {
                    "200": {
                        "description": "Subscription cancellation scheduled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active subscription found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription/checkout": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a Stripe Checkout session for a $10/mo streaming subscription.\nUser must be authenticated. Rejects users who already have an active subscription.\nThe optional body field `return_origin` (the calling client's origin, e.g. `https://beta.wavlake.com`) sends the person back to that origin on the configured success and cancel paths when it exactly matches an entry of the API's return-origin allowlist; any other value is refused with 400 `RETURN_ORIGIN_NOT_ALLOWED`. Absent (or no body), the configured URLs apply unchanged.\nThe optional body field `presentation` (`inline` or `hosted`) asks where to pay. The server answers `inline` only when the membership flow is paid inside the app here (STRIPE_INLINE_CHECKOUT_FLOWS); then the answer has `clientSecret`, `expiresAt` and `summary` (the plan, what was applied, what is due today and the next charge) and no `checkoutUrl`. Any other value is 400 `INVALID_REQUEST`. The answer is never cached.\nThe optional body field `apply_credits_cents` (D162) puts that much of the person's pay-as-you-go balance toward the first membership invoices; the card pays the rest. The applied amount leaves the balance when the checkout starts and comes back if the session expires, is cancelled (`POST /subscription/checkout/cancel`) or is replaced by a new checkout. Above the balance: 409 `INSUFFICIENT_CREDITS`. An amount that would leave a card part between 1 and 49 cents: 400 `FLOOR_CAP` with `capped_cents` in the details. Negative or not a whole number: 400 `INVALID_AMOUNT`. The response carries `appliedCents` and `dueTodayCents` (the first invoice's card part).",
                "tags": [
                    "subscription"
                ],
                "summary": "Create subscription checkout session",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SubscriptionCheckoutRequest"
                            }
                        }
                    },
                    "description": "Optional return origin and credits to apply"
                },
                "responses": {
                    "200": {
                        "description": "Checkout session created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SubscriptionCheckoutResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing pubkey or already subscribed, a malformed body (INVALID_REQUEST), a return_origin that is not allowlisted (RETURN_ORIGIN_NOT_ALLOWED), a negative or non-integer apply_credits_cents (INVALID_AMOUNT), or one that breaks the card floor (FLOOR_CAP, details carry capped_cents)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Purchases disabled or account frozen",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "apply_credits_cents exceeds the pay-as-you-go balance (INSUFFICIENT_CREDITS)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Stripe, or applying credits, is not available",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription/checkout/cancel": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Expires the caller's open membership checkout session and returns the credits it applied to the pay-as-you-go balance at once (D162), instead of waiting for the session to expire on its own. The client calls it from the checkout's cancel landing. Answers 204 whether or not an open checkout existed; a checkout whose payment already went through is left alone.",
                "tags": [
                    "subscription"
                ],
                "summary": "Cancel a membership checkout that applied credits",
                "responses": {
                    "204": {
                        "description": "Nothing is pending any more"
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The checkout could not be cancelled; try again",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription/checkout/confirm": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Called the moment Stripe reports the in-app membership payment succeeded, and again by Check again. Takes only the Checkout Session id. The server reads the Session, its subscription and the subscription's latest invoice from Stripe and, when the Session is complete and paid (or needed no payment) and the invoice is paid, runs the same grant `invoice.paid` runs; the webhook that follows adds nothing. `state` is `active` (granted), `processing` (paid or paying, not granted yet: read again), `open` (still payable) or `expired`. A Session that is not the caller's membership checkout answers 404.",
                "tags": [
                    "subscription"
                ],
                "summary": "Confirm a membership paid inside the app",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SubscriptionCheckoutConfirmRequest"
                            }
                        }
                    },
                    "description": "The Checkout Session to confirm",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "What Stripe says of the Session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SubscriptionCheckoutConfirmResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No Checkout Session id (INVALID_REQUEST)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not this caller's membership checkout",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many confirms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Stripe could not be read; try again",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/subscription/recap": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns aggregated listening data for a subscription billing cycle, including\nper-artist stream counts and credit usage. Defaults to the most recent completed cycle.",
                "tags": [
                    "subscription"
                ],
                "summary": "Get subscription cycle recap",
                "parameters": [
                    {
                        "description": "Cycle ID (defaults to most recent cycle)",
                        "name": "cycle_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cycle recap",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.SubscriptionRecapResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No subscription or cycle found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/support/ask": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers one question from the published help articles. Send the conversation so far (the server keeps no transcript) and the name of the page the person asked from; never keys, drafts, wallet data, balances or logs. Known secret shapes (private keys, connection strings, recovery phrases, tokens, card numbers) are removed before the question leaves the server and from the answer. Refused before anything is sent to the provider when the bot is off or not available to the caller (403), when the request is past its limits (400), or when the account or everyone has asked today's limit (429, details carry renews_at and which limit). A question that reaches the provider is counted whether or not an answer comes back. Tier 2 only, with a NIP-98 key.",
                "tags": [
                    "support"
                ],
                "summary": "Ask the support bot a question",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SupportAskRequest"
                            }
                        }
                    },
                    "description": "The question, the conversation so far and the page",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The answer, the articles it links and today's remaining questions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SupportAskResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "INVALID_REQUEST — no question, or past a limit",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "TIER2_REQUIRED — sign in with an email account | SUPPORT_BOT_UNAVAILABLE — the bot is off or not available to this account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "SUPPORT_DAILY_LIMIT — today's questions are used up",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "EXTERNAL_SERVICE_ERROR — the provider failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE — the count could not be read, so nothing was sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "504": {
                        "description": "TIMEOUT — no answer in time",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/support/capability": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Tells the help center whether to show the support bot to this caller, and how many questions they have left today. The bot is available when the server switch is on, the caller is on its allowlist and a provider is configured; the server checks all three again on every question. Tier 2 only, with a NIP-98 key: an account signed in with email. Questions are counted per account (every key on it shares one count) per UTC day; renews_at is the next UTC midnight.",
                "tags": [
                    "support"
                ],
                "summary": "Whether the caller has the support bot",
                "responses": {
                    "200": {
                        "description": "Whether the bot is available, and today's remaining questions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SupportCapabilityResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "NIP-98 signature required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "TIER2_REQUIRED — sign in with an email account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SERVICE_UNAVAILABLE — today's count could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/nostr": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates a new track record for the authenticated user. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status with email verification). Returns track metadata including ID and upload URLs. The optional `target_d_tag` field is the Phase 2 \"Add audio\" / \"Re-upload\" hook — when set to the UUID d-tag of an existing non-deleted track owned by the caller, the new row adopts that d-tag and the old row is soft-deleted atomically. Useful when remediating an audio-less or orphaned Kind 36787.",
                "tags": [
                    "tracks"
                ],
                "summary": "Create new track",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.CreateNostrTrackRequest"
                            }
                        }
                    },
                    "description": "Track creation request with audio file extension; optional target_d_tag for adopt-d-tag re-upload",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Track created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request, unsupported format, malformed target_d_tag, a new upload without release_d_tag (RELEASE_D_TAG_REQUIRED), or a 31st item in one release (RELEASE_TOO_MANY_TRACKS)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Creator status (Tier 2) required, or a new upload naming a release_d_tag the API did not issue the caller and that is not a release they hold (RELEASE_ID_NOT_ISSUED, #5509)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "target_d_tag does not resolve to a non-deleted track owned by the caller",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An artist credit is held for a well-known artist (ARTIST_NAME_RESERVED; details: field `artist_credits`, every held credit as submitted); the artist already holds 5 unpublished draft releases (DRAFT_LIMIT_REACHED); or a purchase_price_cents on an upload, whose compressed file cannot exist yet (PURCHASE_AUDIO_NOT_READY — set the price with PATCH /tracks/{trackId}/pricing once processing finishes). Uploads are free for every content type: hosting is paid per release at publish (D146; long-form priced like music until D78).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to create track",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The reserved artist list could not be read — never admitted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/published/batch": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "The publish confirm for up to 30 tracks at once (a release's tracks, #4690). Each track is checked exactly as POST /tracks/{trackId}/published checks it — the row id or the caller's own d-tag, ownership, a deleted row, expired draft audio, per-release hosting (D146), the purchase tag (D147), and the event's home — but the Wavlake relay is read ONCE for all of them, one filter listing their d-tags, instead of once per track. The answer is 200 with one result per track, in the order asked, each carrying the status, error code and words the single confirm would have answered; only the tracks whose result is 200 are stamped. 503 when the Wavlake relay cannot be read: then nothing is stamped and the whole call can be retried.",
                "tags": [
                    "tracks"
                ],
                "summary": "Confirm a release's tracks were published, in one call",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.ConfirmPublishBatchRequest"
                            }
                        }
                    },
                    "description": "The tracks and their published event ids (1 to 30)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "One result per track",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.ConfirmPublishBatchResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No tracks, more than 30, or a track without its track_id or event_id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Wavlake relay unreachable; nothing was stamped",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/readiness": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns ready/pending counts and a failed[] list for the supplied track_ids. Studio uploads and migration both poll this endpoint; the readiness condition is identical for both. Unknown IDs (not owned by the caller, or non-UUID strings) surface in failed[] with error_code = unknown_track. Tier 2 required.",
                "tags": [
                    "tracks"
                ],
                "summary": "Aggregate readiness state for a batch of tracks",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TrackReadinessRequest"
                            }
                        }
                    },
                    "description": "Track IDs to query",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Aggregated readiness state",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TrackReadinessResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Tier 2 required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Too many IDs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/status/batch": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns processing status and verified metadata for multiple tracks owned by the authenticated user in one request. Used by the migration draft poller to avoid issuing one status request per track. Unknown, unowned and deleted track IDs (soft-deleted, or marked for deletion) are silently omitted from the response, so a deleted track never reads as ready.",
                "tags": [
                    "tracks"
                ],
                "summary": "Batch get track processing status",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.BatchTrackProcessingStatusRequest"
                            }
                        }
                    },
                    "description": "Track IDs to fetch status for",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Per-track processing statuses",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.BatchTrackProcessingStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or empty track_ids",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Too many track_ids in request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to retrieve track statuses",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/unpublished": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the IDs of every still-active, never-published nostr_content row owned by the authenticated artist. Used by DraftsTab on mount to self-heal dropped publish-pings: for each ID with a verified-metadata draft AND a corresponding kind 36787 event on the relay, the frontend replays the publish-ping. This avoids the backend needing to query relays for publish state.",
                "tags": [
                    "tracks"
                ],
                "summary": "List the caller's still-unpublished track IDs",
                "parameters": [
                    {
                        "description": "Must be '1' (kept as a query so the route is unambiguously caller-scoped)",
                        "name": "mine",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of unpublished track IDs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.UnpublishedTracksResult"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing required mine=1 query param",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}": {
            "delete": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Soft deletes a track owned by the authenticated user. Users can only delete their own tracks. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus Tier2VerificationMiddleware (requires registered user status).",
                "tags": [
                    "tracks"
                ],
                "summary": "Delete track",
                "parameters": [
                    {
                        "description": "Track ID to delete",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Track deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid track ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not authorized to delete this track or Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to delete track",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/pricing": {
            "patch": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Updates the access_mode, price_credits and buy-to-own purchase_price_cents fields on an existing track owned by the authenticated user. Same validation rules as track creation: access_mode must be free/honor/paywall; non-free modes require price_credits=1; free mode forbids price_credits. purchase_price_cents (whole US cents) is the track's whole buy-to-own state: absent or null withdraws an offer; a price must be music (400 PURCHASE_NOT_AVAILABLE), inside the configured bounds (400 PURCHASE_PRICE_OUT_OF_RANGE) and the compressed file must exist (409 PURCHASE_AUDIO_NOT_READY). Uses Tier2AuthMiddleware (Firebase JWT or NIP-98) plus Tier2VerificationMiddleware. Accepts either the canonical track UUID or the d-tag (mirrors DeleteTrack).",
                "tags": [
                    "tracks"
                ],
                "summary": "Update track pricing",
                "parameters": [
                    {
                        "description": "Track ID or d-tag",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UpdateTrackPricingRequest"
                            }
                        }
                    },
                    "description": "New pricing",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Track pricing updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not authorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A purchase price before the compressed file exists (PURCHASE_AUDIO_NOT_READY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to update pricing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/publish-failed": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Records publish_attempted_at and the relay's reason, and NOTHING else — never published_at, never the lifecycle sweep, never the deposit. The deposit is final once the upload succeeds (D63 (C)); a refused publish is fixed and retried on the same row at no extra cost. It exists so the studio's \"hosted, not yet published\" surface can show the relay's own reason beside a Retry. The path takes the row id or the caller's own d-tag, as the confirm does.",
                "tags": [
                    "tracks"
                ],
                "summary": "Record that a track publish was refused",
                "parameters": [
                    {
                        "description": "Track row ID (UUID), or the d-tag of one of the caller's own tracks",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ReportPublishFailedRequest"
                },
                "responses": {
                    "200": {
                        "description": "Failure recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing reason",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/published": {
            "post": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Verifies on the Wavlake relay — and only there — that the named event exists, is this row's event, and carries the row's home community; then idempotently stamps published_at. A deleted row — soft-deleted or marked for deletion by its owner or an operator reset — is refused with 404, the answer PATCH /tracks/{trackId}/pricing gives, before the relay is read; a confirm never brings a deleted row back. Returns 409 NOT_ON_RELAY when the Wavlake relay does not hold the event and 409 audio_not_ready when the audio has not finalized. The path takes the row id or, failing that, the d-tag of one of the caller's own live tracks (a track the legacy migration brought over keeps its legacy id as its d-tag, and a live release's editor knows only that), as on PATCH /tracks/{trackId}/pricing; another key's d-tag answers 404.",
                "tags": [
                    "tracks"
                ],
                "summary": "Confirm a track was published",
                "parameters": [
                    {
                        "description": "Track row ID (UUID), or the d-tag of one of the caller's own tracks",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/internal_handlers.ConfirmPublishRequest"
                },
                "responses": {
                    "200": {
                        "description": "Publish-ping recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.PublishTrackResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid track ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "A track or long-form item whose release's hosting is not paid for (HOSTING_PAYMENT_REQUIRED, D146) — checked before the relay is read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Track not owned by caller",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found, or deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The Wavlake relay does not hold this event (NOT_ON_RELAY), the audio is not ready, a draft's audio expired after 30 days (AUDIO_EXPIRED), or the event's purchase tag disagrees with the saved price (PURCHASE_PRICE_MISMATCH)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Wavlake relay unreachable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/replace-audio": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns a presigned PUT for a new audio file on the caller's track: a music track published or not, or a long-form (podcast episode) draft. The file goes into the same track: its id and d-tag do not change, and no hosting fee is charged (the fee was taken once, when POST /tracks/nostr created the track). The track keeps streaming its current audio until the new file is processed; poll GET /tracks/{trackId}/status for the new file, then re-sign the track event. The path takes the track's row id or, failing that, the d-tag its event carries, so a released track the legacy migration brought over is addressed by its legacy d-tag, as on DELETE /tracks/{trackId}. Ownership is checked first (a stranger gets 403 and cannot learn that a track was deleted); a deleted track, or one marked for deletion, answers 404 like an unknown one; an unpublished track a legacy migration run created answers 409 MIGRATED_DRAFT_REMOVE_ONLY (the client-rebuild Phase 3 ruling D7: Remove only); a track that is being processed right now, still takes its audio from the legacy migration, or is a PUBLISHED long-form track (refused until D78 sets the block rate) answers 409 CONFLICT.",
                "tags": [
                    "tracks"
                ],
                "summary": "Replace the audio of a track, published or draft",
                "parameters": [
                    {
                        "description": "Track ID, or the d-tag the track's event carries (a migrated track keeps its legacy d-tag)",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.TrackUploadURLRequest"
                            }
                        }
                    },
                    "description": "The replacement file about to be uploaded",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "A presigned upload URL for the replacement file",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TrackUploadURLResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing fields, unsupported format, or a file outside the size/duration limits",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the track's owner, or Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found or deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The track's audio cannot be replaced now (CONFLICT), or an unpublished migrated track can only be removed (MIGRATED_DRAFT_REMOVE_ONLY)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to issue an upload URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/status": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns the processing status and verified metadata for a track owned by the authenticated user. Used to poll processing progress and retrieve verified metadata before publishing a Kind 36787 event. A deleted track (soft-deleted, or marked for deletion) answers 404 like an unknown one, so it never reads as ready; a poller should stop on a 404. The path takes the track's row id or, failing that, the d-tag its event carries (a track the legacy migration brought over keeps its legacy d-tag), as on DELETE /tracks/{trackId}; a failure reading a well-formed id answers 500, never 404.",
                "tags": [
                    "tracks"
                ],
                "summary": "Get track processing status",
                "parameters": [
                    {
                        "description": "Track ID, or the d-tag the track's event carries",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Track processing status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TrackProcessingStatusResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid track ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not authorized to view this track's status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found or deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to retrieve track status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tracks/{trackId}/upload-url": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns a fresh presigned PUT for the caller's music track whose audio never arrived, for the file described in the body (its type may differ from the first file's; the track is re-pointed at it). Never touches the hosting deposit: the fee was taken once, when POST /tracks/nostr created the track. Ownership is checked first (a stranger gets 403 and cannot learn that a track was deleted); a deleted track, or one marked for deletion, answers 404 like an unknown one; a track that already has its audio, is being processed, failed processing, takes its audio from the legacy migration, or is not music answers 409.",
                "tags": [
                    "tracks"
                ],
                "summary": "Issue a new upload URL for a track that has no audio yet",
                "parameters": [
                    {
                        "description": "Track ID",
                        "name": "trackId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.TrackUploadURLRequest"
                            }
                        }
                    },
                    "description": "The file about to be uploaded",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "A fresh presigned upload URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.TrackUploadURLResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing fields, unsupported format, or a file outside the size/duration limits",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the track's owner, or Creator status (Tier 2) required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Track not found or deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The track is not awaiting its audio",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to issue an upload URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/transactions": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves transaction history for a user with filters. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "List transactions",
                "parameters": [
                    {
                        "description": "Transaction type (deposit, withdrawal)",
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Transaction status (pending, processing, completed, failed)",
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Maximum results (default: 50, max: 100)",
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "description": "Pagination offset (default: 0)",
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transactions retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.ListTransactionsResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid query parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required or cannot access another user's transactions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/user/earnings/personas": {
            "get": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Returns one aggregate per community the authenticated pubkey has published content into, in the given date range. Aggregates are separated by currency (never summed across currencies) and include streams, earnings, tips, and EOM subscription distributions. Communities with zero activity in the range are included. Source of truth for the user-scope /earnings page (creator-identity Phase 4).",
                "tags": [
                    "User"
                ],
                "summary": "Get per-community earnings aggregates for the logged-in user",
                "parameters": [
                    {
                        "description": "Start date (YYYY-MM-DD). Defaults to 30 days ago.",
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "End date (YYYY-MM-DD), inclusive. Defaults to today.",
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Per-community aggregates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.UserEarningsCommunitiesResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid date format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/user/nip05": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves all of the authenticated user's active NIP-05 verification entries. Uses Tier2Auth (accepts Firebase JWT or NIP-98). Returns an array of verifications (empty array if none exist). Supports an optional ?type= query filter.",
                "tags": [
                    "nip05"
                ],
                "summary": "Get current user's NIP-05 verifications",
                "parameters": [
                    {
                        "description": "Filter by type (personal, artist or community)",
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User's NIP-05 verification data (array)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Verification"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to fetch verification data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Creates or updates the caller's personal NIP-05 verification (one per user; soft-deletes the existing row on a username change). `personal` is the only creatable type: `community` names are claimed through POST /v1/communities, and the `artist` type retired with the persona model (PRD (a) Phase 7). Uses Tier2Auth (accepts Firebase JWT or NIP-98).",
                "tags": [
                    "nip05"
                ],
                "summary": "Create or update user's NIP-05 verification",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.UpsertNip05Request"
                            }
                        }
                    },
                    "description": "NIP-05 verification data",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Created or updated NIP-05 verification",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Verification"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request body, or validation failed (bad username, or a type other than personal — community names are claimed through POST /v1/communities, and artist retired with the persona model in PRD (a) Phase 7)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Username or type conflict (a takedown-blocked name included), LEGACY_NAME_RESERVED — the name belongs to an existing Wavlake account (D132) — or ARTIST_NAME_RESERVED — the name is held for a well-known artist (details: field `username`, names as submitted)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "details": {
                                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to create/update verification",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The existing-account check or the reserved artist list could not be read — claims fail closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Soft-deletes a specific NIP-05 verification by username. Uses Tier2Auth (accepts Firebase JWT or NIP-98). The username becomes available for other users. Requires the 'username' query parameter.",
                "tags": [
                    "nip05"
                ],
                "summary": "Delete user's NIP-05 verification",
                "parameters": [
                    {
                        "description": "NIP-05 username to delete",
                        "name": "username",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Verification deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing username query parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active verification found for user with that username",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "A Spark address binding still exists for this username",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Failed to delete verification",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/user/nip05/availability": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Answers what POST /v1/user/nip05 would for this caller, without claiming: `available`, `taken` (an active account name or channel address holds it, or a takedown blocked it), `reserved` (a route word or the static legacy list), `legacy_reserved` (an existing Wavlake account holds it — never says whose; its owner sees `available`) or `artist_reserved` (held for a well-known artist — never says who has asked for it; the key holding the act's grant sees `available`). Tier2Auth (Firebase JWT or NIP-98).",
                "tags": [
                    "nip05"
                ],
                "summary": "Check whether a name can be claimed as the caller's account name",
                "parameters": [
                    {
                        "description": "The name to check",
                        "name": "username",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "What a claim of this name would meet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_handlers.Nip05AvailabilityResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Missing or malformed username",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - missing authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "The name rows could not be read",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "The existing-account check or the reserved artist list could not be read — never reported as free",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/user/nip05/pointer": {
            "put": {
                "security": [
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Sets where wavlake.com/<name> routes for the caller's account name (D84). A 32-hex communityId points it at that community (ownership relay-verified, fail-closed); null clears it back to the account page. Routing only — NIP-05 and Lightning are untouched. Requires NIP-98 (a Firebase JWT alone is rejected).",
                "tags": [
                    "nip05"
                ],
                "summary": "Point the account's name at one of its communities, or back at the account page",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_handlers.SetAccountNamePointerRequest"
                            }
                        }
                    },
                    "description": "The community to point at, or null to clear",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "The updated personal name row",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Verification"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Malformed body or community id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing auth, or no NIP-98 pubkey",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The caller does not own that community",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The account has no active name to point",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The community is not on the relay",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Relay unreachable — the ownership check fails closed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/me": {
            "get": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Retrieves the currently authenticated user's profile information. Accepts Firebase JWT or NIP-98 authentication via Tier2Auth middleware. Tier is derived from record existence (tier 2+) and accounting verification status (tier 3). The email field is populated from Firebase Auth and may be omitted if unavailable.",
                "tags": [
                    "users"
                ],
                "summary": "Get current user profile",
                "responses": {
                    "200": {
                        "description": "User profile retrieved successfully. Response includes: firebase_uid, email (optional), display_name, avatar_url, created_at, updated_at",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_handlers.GetMeData"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid authentication",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/verify-user": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Verifies a user's account by checking their region via ZBD API and updating account verification status. This endpoint is idempotent - multiple verification requests from the same user will succeed. Note: Each successful call updates the verification timestamp and user data (first name, last name, IP address) to the latest values provided. The endpoint performs region validation and either creates a new account or updates existing verification data atomically. IMPORTANT: User must be Tier 2 (registered with linked Nostr account) before calling this endpoint.",
                "tags": [
                    "accounting-verification"
                ],
                "summary": "Verify user account",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.VerifyUserRequest"
                            }
                        }
                    },
                    "description": "User verification request (first and last names must not exceed 100 characters)",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "User verified successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.VerifyUserResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters (empty names or exceeds 100 character limit)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Region not supported, Tier 2 registration required, or account creation failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (10 requests per minute per user)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ZBD service unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/stripe": {
            "post": {
                "description": "Receives webhook notifications from Stripe when payments complete, expire, or disputes occur.\nVerifies Stripe signature, deduplicates events, and processes checkout completions\n(crediting the buyer's balance), session expirations (cancelling transactions), and charge disputes.",
                "tags": [
                    "stripe",
                    "webhooks"
                ],
                "summary": "Handle Stripe webhook",
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid webhook signature or payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Webhook processing failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Stripe service not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/stripe-connect": {
            "post": {
                "description": "Receives Stripe Connect webhook events (currently account.updated).\nSignature verification via Stripe-Signature header. Duplicate events are deduped by event.id.",
                "tags": [
                    "webhooks"
                ],
                "summary": "Stripe Connect webhook",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/subscription": {
            "post": {
                "description": "Receives webhook notifications from Stripe for subscription lifecycle events.\nHandles invoice.paid (issues the renewal's credits), invoice.payment_failed (past_due),\nand customer.subscription.deleted (cancelled/lapsed).\nVerified via Stripe signature (no user auth required).",
                "tags": [
                    "subscription",
                    "webhooks"
                ],
                "summary": "Handle Stripe subscription webhook",
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid webhook signature or payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Webhook processing failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/zbd/deposits": {
            "post": {
                "security": [],
                "description": "Handles ZBD charge webhook callbacks (charge.completed, charge.expired). This is a public endpoint verified via IP allowlist instead of authentication. Payload size is limited to 64KB.",
                "tags": [
                    "webhooks"
                ],
                "summary": "Receive deposit webhooks",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    },
                    "description": "ZBD charge webhook payload",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid webhook payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Unauthorized webhook source",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Payload too large (max 64KB)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/zbd/ramp": {
            "post": {
                "description": "Receives webhook notifications from ZBD when Ramp purchases complete.\nCurrently a stub that acknowledges receipt - full implementation in Phase 2.",
                "tags": [
                    "ramp",
                    "webhooks"
                ],
                "summary": "Handle ZBD Ramp webhook (Phase 2 placeholder)",
                "responses": {
                    "200": {
                        "description": "Webhook acknowledged",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/zbd/withdrawals": {
            "post": {
                "security": [],
                "description": "Handles ZBD payment webhook callbacks (payment.completed, payment.failed). This is a public endpoint verified via IP allowlist instead of authentication. Payload size is limited to 64KB.",
                "tags": [
                    "webhooks"
                ],
                "summary": "Receive withdrawal webhooks",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    },
                    "description": "ZBD payment webhook payload",
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid webhook payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Unauthorized webhook source",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Payload too large (max 64KB)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/withdrawals": {
            "post": {
                "security": [
                    {
                        "FirebaseAuth": []
                    },
                    {
                        "NIP98Auth": []
                    }
                ],
                "description": "Initiates a withdrawal using Lightning Address or BOLT11 invoice. Exactly one of lightningAddress or bolt11Invoice must be provided. Uses Tier2AuthMiddleware (accepts Firebase JWT or NIP-98) plus VerificationMiddleware (requires KYC/Tier 3 status).",
                "tags": [
                    "accounting"
                ],
                "summary": "Create withdrawal",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/internal_accounting_handlers.CreateWithdrawalRequest"
                            }
                        }
                    },
                    "description": "Withdrawal creation request",
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Withdrawal created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.StandardResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "$ref": "#/components/schemas/internal_accounting_handlers.CreateWithdrawalResponse"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Wallet limit exceeded - error codes: WALLET_PER_TX_LIMIT_EXCEEDED (per-transaction limit exceeded), WALLET_DAILY_LIMIT_EXCEEDED (daily withdrawal limit exceeded), WALLET_BALANCE_CAP_EXCEEDED (balance cap exceeded). Also: INVALID_REQUEST, INVALID_INVOICE (invalid BOLT11 format), INVOICE_REQUIRED (missing invoice), INVOICE_ZERO_AMOUNT (zero-amount invoices not supported)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_accounting_handlers.WalletLimitErrorResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required (AUTH_REQUIRED)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden - KYC verification (Tier 3) required or cannot create withdrawal for another user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Account not found (ACCOUNT_NOT_FOUND)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Insufficient balance (INSUFFICIENT_BALANCE)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error - possible error codes: INVALID_ADDRESS (invalid Lightning address), INVOICE_EXPIRED (BOLT11 invoice has expired)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error (INTERNAL_ERROR)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.ErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "servers": [
        {
            "url": "/api/v1"
        }
    ],
    "components": {
        "requestBodies": {
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationRequest"
                        }
                    }
                },
                "description": "The request id",
                "required": true
            },
            "github_com_wavlake_monorepo_internal_models.MerchConnectionRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnectionRequest"
                        }
                    }
                },
                "description": "The channel and the collection",
                "required": true
            },
            "github_com_wavlake_monorepo_internal_models.StoreProductRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProductRequest"
                        }
                    }
                },
                "description": "The product",
                "required": true
            },
            "internal_handlers.ConfirmPublishRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/internal_handlers.ConfirmPublishRequest"
                        }
                    }
                },
                "description": "The published event id",
                "required": true
            },
            "github_com_wavlake_monorepo_internal_models.UpdateScheduleRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.UpdateScheduleRequest"
                        }
                    }
                },
                "description": "Update request",
                "required": true
            },
            "internal_handlers.ReleaseHostingQuoteRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/internal_handlers.ReleaseHostingQuoteRequest"
                        }
                    }
                },
                "description": "The release and its tracks, each by row id or published id",
                "required": true
            },
            "internal_handlers.ReportPublishFailedRequest": {
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/internal_handlers.ReportPublishFailedRequest"
                        }
                    }
                },
                "description": "The relay's rejection reason",
                "required": true
            }
        },
        "securitySchemes": {
            "CloudRunIAM": {
                "description": "Google Cloud Run IAM identity token for service-to-service calls. Format: \"Bearer {identity_token}\". Only internal endpoints use this scheme.",
                "type": "apiKey",
                "name": "Authorization",
                "in": "header"
            },
            "FirebaseAuth": {
                "description": "Firebase JWT token. Format: \"Bearer {jwt_token}\". Get token from Firebase Authentication.",
                "type": "apiKey",
                "name": "Authorization",
                "in": "header"
            },
            "NIP98Auth": {
                "description": "Nostr NIP-98 event signature. Must be a valid signed Nostr event with method, URL, and payload. See https://github.com/nostr-protocol/nips/blob/master/98.md",
                "type": "apiKey",
                "name": "Authorization",
                "in": "header"
            },
            "ShopifySessionToken": {
                "description": "A Shopify session token from a store's own app embedded in its Shopify admin (merch on a channel). Format: \"Bearer {session_token}\". App Bridge's shopify.idToken() makes one; it lasts a minute.",
                "type": "apiKey",
                "name": "Authorization",
                "in": "header"
            }
        },
        "schemas": {
            "cmd_api.APIRootData": {
                "type": "object",
                "properties": {
                    "capabilities": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "docs": {
                        "type": "string"
                    },
                    "feedback": {
                        "type": "string"
                    },
                    "llms_txt": {
                        "type": "string"
                    },
                    "openapi": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    }
                }
            },
            "github_com_nbd-wtf_go-nostr.Event": {
                "type": "object",
                "properties": {
                    "content": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "pubKey": {
                        "type": "string"
                    },
                    "sig": {
                        "type": "string"
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_fraud.Report": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "finding_count": {
                        "type": "integer"
                    },
                    "generated_at": {
                        "type": "string"
                    },
                    "limit": {
                        "type": "integer"
                    },
                    "lookback_hours": {
                        "type": "integer"
                    },
                    "shared_cards": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_fraud.SharedCardFinding"
                        }
                    },
                    "thresholds": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_fraud.ReportThresholds"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_fraud.ReportThresholds": {
                "type": "object",
                "properties": {
                    "card_min_pubkeys": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_fraud.SharedCardFinding": {
                "type": "object",
                "properties": {
                    "card_fingerprint": {
                        "type": "string"
                    },
                    "checkout_count": {
                        "type": "integer"
                    },
                    "first_seen": {
                        "type": "string"
                    },
                    "last_seen": {
                        "type": "string"
                    },
                    "pubkey_count": {
                        "type": "integer"
                    },
                    "pubkeys": {
                        "description": "sample, capped",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_legacybalance.ReconcileItem": {
                "type": "object",
                "properties": {
                    "after": {
                        "type": "string"
                    },
                    "before": {
                        "type": "string"
                    },
                    "error": {
                        "description": "Error says why the move could not be brought up to date, if it could not.",
                        "type": "string"
                    },
                    "legacy_user_id": {
                        "type": "string"
                    },
                    "move_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_legacybalance.ReconcileReport": {
                "type": "object",
                "properties": {
                    "advanced": {
                        "type": "integer"
                    },
                    "examined": {
                        "type": "integer"
                    },
                    "failed": {
                        "type": "integer"
                    },
                    "moves": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_legacybalance.ReconcileItem"
                        }
                    },
                    "unchanged": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.APIUser": {
                "type": "object",
                "properties": {
                    "avatar_url": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "display_name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.AccountNotification": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "params": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.AccountNotificationParams"
                    },
                    "source_id": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.AccountNotificationParams": {
                "type": "object",
                "properties": {
                    "actor_pubkey": {
                        "type": "string"
                    },
                    "subject_coordinate": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.AccountNotificationsResponse": {
                "type": "object",
                "properties": {
                    "notifications": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.AccountNotification"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimAct": {
                "type": "object",
                "properties": {
                    "display_name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimList": {
                "type": "object",
                "properties": {
                    "claims": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimView"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimPostedRequest": {
                "type": "object",
                "properties": {
                    "url": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimProofPlace": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimRequest": {
                "type": "object",
                "properties": {
                    "act_id": {
                        "description": "ActID picks one act when several hold the name (a 409\nCLAIM_AMBIGUOUS lists them).",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name is the name as the person typed it where it was refused.",
                        "type": "string"
                    },
                    "note": {
                        "type": "string"
                    },
                    "relationship": {
                        "type": "string"
                    },
                    "role_note": {
                        "type": "string"
                    },
                    "surface": {
                        "type": "string"
                    },
                    "wants": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistClaimView": {
                "type": "object",
                "properties": {
                    "act": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimAct"
                    },
                    "code": {
                        "description": "Code is the proof code, shown as soon as the request opens.",
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "decided_at": {
                        "type": "string"
                    },
                    "has_official_links": {
                        "description": "HasOfficialLinks is false when the list knows no page for the act:\nstaff find one before asking for the code.",
                        "type": "boolean"
                    },
                    "id": {
                        "type": "string"
                    },
                    "message": {
                        "description": "Message is what staff wrote to the person when they asked for more or\nrefused.",
                        "type": "string"
                    },
                    "posted_at": {
                        "type": "string"
                    },
                    "proof_places": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistClaimProofPlace"
                        }
                    },
                    "relationship": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string"
                    },
                    "wants": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistDeposit": {
                "type": "object",
                "properties": {
                    "amount_cents": {
                        "description": "USD cents (Phase 1: currency is always USD)",
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "description": "\"USD\" in Phase 1",
                        "type": "string"
                    },
                    "external_id": {
                        "description": "Stripe Checkout session ID for stripe_checkout source",
                        "type": "string"
                    },
                    "id": {
                        "description": "UUID primary key",
                        "type": "string"
                    },
                    "release_d_tag": {
                        "description": "ReleaseDTag / ReleaseTitle are set on a release's hosting payment (D146):\nthe history shows \"Hosting for <title>\". Absent on a top-up row. A\nfailed row is a checkout that was never paid (\"Not completed\").",
                        "type": "string"
                    },
                    "release_title": {
                        "type": "string"
                    },
                    "source": {
                        "description": "\"stripe_checkout\" in Phase 1; see type doc",
                        "type": "string"
                    },
                    "status": {
                        "description": "pending | completed | failed",
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistDepositsResponse": {
                "type": "object",
                "properties": {
                    "deposits": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ArtistDeposit"
                        }
                    },
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistNameReservedDetails": {
                "type": "object",
                "properties": {
                    "field": {
                        "type": "string"
                    },
                    "names": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ArtistStatsResponse": {
                "type": "object",
                "properties": {
                    "balance": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.BalanceInfo"
                    },
                    "deposits": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.DepositInfo"
                    },
                    "payout_eligibility": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PayoutEligibilityDetail"
                    },
                    "payout_review_reason": {
                        "type": "string"
                    },
                    "payout_review_status": {
                        "description": "PayoutReviewStatus is the creator's one-time payout review state (launch\nleg 5b, D37): \"pending\", \"approved\" or \"rejected\". PayoutReviewReason is\nthe reviewer's plain-language text, populated only for \"rejected\" and\nrendered to the creator verbatim.\n\nBOTH ARE OPTIONAL (omitempty), deliberately. Backend and frontend deploy\nindependently, so a live contract never gains a required field: a frontend\nbuilt before this shipped ignores them, and a frontend built after must\ntreat their absence as \"no review information\", not as a blocker.\n\nA creator with no review row reads as \"pending\" here, matching the gate —\nabsence of a decision is not approval.\n\nNO FRAUD INTERNALS. `flagged`, the linkage heuristics and the Phase-2\nsignal snapshot are never serialized to this creator-facing response;\nstatus and the reviewer's own sentence are the whole surface.",
                        "type": "string"
                    },
                    "payout_status": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PayoutStatusInfo"
                    },
                    "period_end": {
                        "type": "string"
                    },
                    "period_start": {
                        "type": "string"
                    },
                    "streams": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StreamStats"
                    },
                    "stripe_connect": {
                        "description": "StripeConnect surfaces the artist's Stripe Connect Express onboarding\nstate for the USD ACH payout rail. Drives the frontend's \"start\nonboarding / resume / requirements due / ready to withdraw\" CTAs.\nAlways non-nil — absence of a connected account is represented by\nStripeConnectStateNotStarted.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StripeConnectInfo"
                            }
                        ]
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.BalanceInfo": {
                "type": "object",
                "properties": {
                    "available_credits": {
                        "description": "Withdrawable balance in credits",
                        "type": "integer"
                    },
                    "lifetime_earnings_credits": {
                        "description": "Total earned all-time in credits",
                        "type": "integer"
                    },
                    "pending_payout_credits": {
                        "description": "Amount in pending payouts in credits",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.BandsintownArtist": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "imageUrl": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "pageUrl": {
                        "type": "string"
                    },
                    "upcomingCount": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.BuyRequest": {
                "type": "object",
                "properties": {
                    "expected_price_cents": {
                        "description": "ExpectedPriceCents is the price the listener was shown for this method,\nin whole US cents. A different server price is 409 PRICE_CHANGED.",
                        "type": "integer"
                    },
                    "idempotency_key": {
                        "description": "IdempotencyKey is a client UUID. The same key replays the same order —\nfor card and instant, the same checkout link or invoice while it is\nstill open.",
                        "type": "string"
                    },
                    "item": {
                        "description": "Item is the address coordinate of what is bought: \"36787:<pubkey>:<d-tag>\"\nfor a track, \"34139:<pubkey>:<d-tag>\" for a whole release. Parsed\ncolon-safe; the d-tag may contain ':'.",
                        "type": "string"
                    },
                    "method": {
                        "description": "Method is \"credits\", \"card\" or \"instant\". A method this deployment does\nnot offer (GET /v1/listener/purchase-methods) answers 400\nMETHOD_NOT_AVAILABLE.",
                        "type": "string"
                    },
                    "names": {
                        "description": "Names are the names the buyer saw (PurchaseNames). Optional. They are\nkept with the order and given back only on GET /v1/listener/owned, to\nwhoever holds the purchase. A replayed key keeps the first request's.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseNames"
                            }
                        ]
                    },
                    "presentation": {
                        "description": "Presentation is how a card order asks to be paid: \"inline\" (the payment\nform inside the app) or \"hosted\" (Stripe's page, the default). Inline is\ngranted only where the music flow pays inside the app; elsewhere the\norder gets its hosted checkout, as before. Ignored for credits and\ninstant, and on a replay (the order keeps how it was first opened).",
                        "type": "string"
                    },
                    "return_origin": {
                        "description": "ReturnOrigin is the card checkout's return origin: the calling client's\nown origin, e.g. \"https://beta.wavlake.com\". It must exactly equal one\nSTRIPE_RETURN_ORIGIN_ALLOWLIST entry, or the answer is 400\nRETURN_ORIGIN_NOT_ALLOWED. Absent, the configured return URLs apply.\nIgnored for credits and instant.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CancelScheduleResponse": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ClaimedSplitInvite": {
                "type": "object",
                "properties": {
                    "amount_cents": {
                        "type": "integer"
                    },
                    "amount_millicents": {
                        "description": "AmountMillicents is what moved to the claimant's balance; AmountCents\nits whole cents (the sub-cent rest moved too, into the balance's\nremainder).",
                        "type": "integer"
                    },
                    "invite_id": {
                        "type": "string"
                    },
                    "inviter_name": {
                        "description": "InviterName is the artist's registered account name; empty when they\nhave none (the screen then says \"An artist\"). Never text they wrote.",
                        "type": "string"
                    },
                    "inviter_pubkey": {
                        "type": "string"
                    },
                    "release_title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CommunityCurrencyEarnings": {
                "type": "object",
                "properties": {
                    "base_revenue_credits": {
                        "description": "Sum of price for per-stream events (excludes EOM)",
                        "type": "integer"
                    },
                    "currency": {
                        "description": "\"USD\" or \"SAT\"",
                        "type": "string"
                    },
                    "generous_mode_credits": {
                        "description": "Generous-mode totals (stream_type IN models.GenerousModeStreamTypes) — cycle sweeps + quarterly pool legs. Kept DISTINCT from the legacy EOM field.",
                        "type": "integer"
                    },
                    "net_earnings_millicents": {
                        "description": "Exact net paid to the caller, in milli-units of Currency: what the earnings ledger credited them. Summed over every row it is the account's net for the range.",
                        "type": "integer"
                    },
                    "sales_credits": {
                        "description": "Buy-to-own sales gross (stream_type='purchase'); absent = 0. Never a stream, never a tip.",
                        "type": "integer"
                    },
                    "subscription_distribution_credits": {
                        "description": "LEGACY EOM pro-rata distribution totals (stream_type='eom_distribution')",
                        "type": "integer"
                    },
                    "tips_credits": {
                        "description": "Per-stream overpayments above base price (amount - price) for non-distribution rows. Surfaced in UI as \"Streaming income\".",
                        "type": "integer"
                    },
                    "total_earnings_credits": {
                        "description": "Sum of amount across all stream types attributed to this community (includes overpayment tips and both distribution classes)",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CommunityEarnings": {
                "type": "object",
                "properties": {
                    "community_id": {
                        "type": "string"
                    },
                    "earnings": {
                        "description": "One entry per Currency with any activity in the range",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CommunityCurrencyEarnings"
                        }
                    },
                    "stream_count": {
                        "description": "Count of rows excluding every models.SyntheticDistributionStreamTypes value (legacy stream_type='tip' rows are excluded outright)",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ContentConfigResponse": {
                "type": "object",
                "properties": {
                    "access_mode": {
                        "description": "free, honor, or paywall",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "When track was uploaded",
                        "type": "string"
                    },
                    "id": {
                        "description": "Track UUID",
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "Nostr d-tag for content lookup",
                        "type": "string"
                    },
                    "price_credits": {
                        "description": "Price in credits (null for free)",
                        "type": "integer"
                    },
                    "stream_count": {
                        "description": "Total stream count (30-day rolling)",
                        "type": "integer"
                    },
                    "updated_at": {
                        "description": "Last modification time",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreateCreditCheckoutRequest": {
                "type": "object",
                "required": [
                    "amountCents",
                    "requestId"
                ],
                "properties": {
                    "amountCents": {
                        "type": "integer",
                        "maximum": 10000,
                        "minimum": 1000,
                        "example": 2500
                    },
                    "presentation": {
                        "enum": [
                            "inline",
                            "hosted"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutPresentation"
                            }
                        ]
                    },
                    "requestId": {
                        "type": "string",
                        "example": "9d6f4b1e-5f3a-4c55-9a39-7b1f0c7e2a10"
                    },
                    "returnPath": {
                        "type": "string",
                        "maxLength": 512,
                        "example": "/account"
                    },
                    "return_origin": {
                        "type": "string",
                        "example": "https://qa.wavlake.com"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreatePayoutRequest": {
                "type": "object",
                "required": [
                    "amount",
                    "currency",
                    "payment_method"
                ],
                "properties": {
                    "amount": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "currency": {
                        "type": "string",
                        "enum": [
                            "USD",
                            "SAT"
                        ]
                    },
                    "destination": {
                        "type": "string"
                    },
                    "payment_method": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreatorDestinationResponse": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutActiveListResponse": {
                "type": "object",
                "properties": {
                    "attempts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutAttemptStatus"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutAttemptStatus": {
                "type": "object",
                "properties": {
                    "attemptId": {
                        "type": "string",
                        "example": "9d6f4b1e-5f3a-4c55-9a39-7b1f0c7e2a10"
                    },
                    "canReplace": {
                        "type": "boolean"
                    },
                    "canResume": {
                        "type": "boolean"
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "creditedCents": {
                        "type": "integer",
                        "example": 2500
                    },
                    "expiresAt": {
                        "type": "string"
                    },
                    "fulfillmentStatus": {
                        "enum": [
                            "not_started",
                            "pending",
                            "credited",
                            "needs_attention"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutFulfillmentStatus"
                            }
                        ]
                    },
                    "paymentStatus": {
                        "enum": [
                            "open",
                            "processing",
                            "paid",
                            "failed",
                            "expired",
                            "unknown"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutPaymentStatus"
                            }
                        ]
                    },
                    "presentation": {
                        "enum": [
                            "inline",
                            "hosted"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutPresentation"
                            }
                        ]
                    },
                    "returnPath": {
                        "type": "string",
                        "example": "/account"
                    },
                    "summary": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutSummary"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutChargeFrequency": {
                "type": "string",
                "enum": [
                    "one_time"
                ],
                "x-enum-varnames": [
                    "CreditCheckoutChargeOneTime"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutFulfillmentStatus": {
                "type": "string",
                "enum": [
                    "not_started",
                    "pending",
                    "credited",
                    "needs_attention"
                ],
                "x-enum-varnames": [
                    "CreditCheckoutFulfillmentNotStarted",
                    "CreditCheckoutFulfillmentPending",
                    "CreditCheckoutFulfillmentCredited",
                    "CreditCheckoutFulfillmentNeedsAttention"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutPaymentStatus": {
                "type": "string",
                "enum": [
                    "open",
                    "processing",
                    "paid",
                    "failed",
                    "expired",
                    "unknown"
                ],
                "x-enum-varnames": [
                    "CreditCheckoutPaymentOpen",
                    "CreditCheckoutPaymentProcessing",
                    "CreditCheckoutPaymentPaid",
                    "CreditCheckoutPaymentFailed",
                    "CreditCheckoutPaymentExpired",
                    "CreditCheckoutPaymentUnknown"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutPresentation": {
                "type": "string",
                "enum": [
                    "inline",
                    "hosted"
                ],
                "x-enum-varnames": [
                    "CreditCheckoutPresentationInline",
                    "CreditCheckoutPresentationHosted"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutSessionResponse": {
                "type": "object",
                "properties": {
                    "attemptId": {
                        "type": "string",
                        "example": "9d6f4b1e-5f3a-4c55-9a39-7b1f0c7e2a10"
                    },
                    "canReplace": {
                        "type": "boolean"
                    },
                    "canResume": {
                        "type": "boolean"
                    },
                    "checkoutUrl": {
                        "type": "string"
                    },
                    "clientSecret": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "creditedCents": {
                        "type": "integer",
                        "example": 2500
                    },
                    "expiresAt": {
                        "type": "string"
                    },
                    "fulfillmentStatus": {
                        "enum": [
                            "not_started",
                            "pending",
                            "credited",
                            "needs_attention"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutFulfillmentStatus"
                            }
                        ]
                    },
                    "paymentStatus": {
                        "enum": [
                            "open",
                            "processing",
                            "paid",
                            "failed",
                            "expired",
                            "unknown"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutPaymentStatus"
                            }
                        ]
                    },
                    "presentation": {
                        "enum": [
                            "inline",
                            "hosted"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutPresentation"
                            }
                        ]
                    },
                    "returnPath": {
                        "type": "string",
                        "example": "/account"
                    },
                    "sessionId": {
                        "type": "string",
                        "example": "cs_test_a1"
                    },
                    "summary": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutSummary"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreditCheckoutSummary": {
                "type": "object",
                "properties": {
                    "chargeFrequency": {
                        "enum": [
                            "one_time"
                        ],
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditCheckoutChargeFrequency"
                            }
                        ]
                    },
                    "creditsCents": {
                        "type": "integer",
                        "example": 2500
                    },
                    "currency": {
                        "type": "string",
                        "example": "USD"
                    },
                    "discountCents": {
                        "type": "integer",
                        "example": 0
                    },
                    "feeCents": {
                        "type": "integer",
                        "example": 0
                    },
                    "subtotalCents": {
                        "type": "integer",
                        "example": 2500
                    },
                    "taxCents": {
                        "type": "integer",
                        "example": 0
                    },
                    "totalCents": {
                        "type": "integer",
                        "example": 2500
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.CreditPurchase": {
                "type": "object",
                "properties": {
                    "credits": {
                        "description": "Credits received (USD cents)",
                        "type": "integer"
                    },
                    "credits_applied_cents": {
                        "description": "CreditsAppliedCents is how much of the listener's own bought\n(pay-as-you-go) credits went into this membership month (D162): the\nfirst invoice's coupon, then the prepaid balance drawn down month by\nmonth. 0 when the card paid it all, and on every top-up. It is never a\nmembership balance or remainder (R27, D157).",
                        "type": "integer"
                    },
                    "external_id": {
                        "description": "Stripe payment_intent_id (PAYG) or invoice_id (subscription)",
                        "type": "string"
                    },
                    "id": {
                        "description": "Stable per-purchase identifier (stripe_payment_intent_id for PAYG; cycle id for subscription)",
                        "type": "string"
                    },
                    "membership_started": {
                        "description": "MembershipStarted is true on a membership's FIRST month (the first paid\ninvoice of its Stripe subscription; a re-join starts a new one). Every\nother membership row is a renewal; a top-up is always false.",
                        "type": "boolean"
                    },
                    "occurred_at": {
                        "description": "When the purchase was recorded",
                        "type": "string"
                    },
                    "receipt_url": {
                        "description": "Optional Stripe receipt URL; always nil in v1",
                        "type": "string"
                    },
                    "status": {
                        "description": "\"processing\", \"completed\", \"failed\"",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseStatus"
                            }
                        ]
                    },
                    "type": {
                        "description": "\"payg\" or \"subscription\"",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseType"
                            }
                        ]
                    },
                    "usd_cents": {
                        "description": "Dollar value in cents; currently equal to credits",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.DailyEarnings": {
                "type": "object",
                "properties": {
                    "base_revenue_credits": {
                        "description": "Per-stream price portion (excludes every synthetic distribution row)",
                        "type": "integer"
                    },
                    "date": {
                        "description": "YYYY-MM-DD",
                        "type": "string"
                    },
                    "earnings_credits": {
                        "description": "Daily total — base + tips + both distribution classes",
                        "type": "integer"
                    },
                    "generous_mode_credits": {
                        "description": "Generous-mode income credited on this date (stream_type IN models.GenerousModeStreamTypes). Kept DISTINCT from the legacy EOM field.",
                        "type": "integer"
                    },
                    "sales_credits": {
                        "description": "Buy-to-own sales gross on this date (stream_type='purchase'); absent = 0.",
                        "type": "integer"
                    },
                    "stream_count": {
                        "type": "integer"
                    },
                    "subscription_distribution_credits": {
                        "description": "LEGACY pro-rata EOM distributions credited on this date (stream_type='eom_distribution')",
                        "type": "integer"
                    },
                    "tips_credits": {
                        "description": "Per-stream overpayment portion (excludes every synthetic distribution row)",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.DepositContentTypeBreakdown": {
                "type": "object",
                "properties": {
                    "content_type": {
                        "description": "ContentType is the semantic nostr_content.content_type\n(\"music_track\" | \"podcast_episode\" | \"podcast_show\" | …). Empty string\nfor legacy rows written before the discriminator existed.",
                        "type": "string"
                    },
                    "estimated_deposited_cents": {
                        "description": "EstimatedDepositedCents is RETIRED and always 0. It replayed the\nper-upload price schedule, which is gone: uploads are free and hosting is\npaid per release at publish for every content type (D146; long-form\npriced like music until D78, #3999). Kept on the wire only while the\nretired apps/web compiles against the generated types.",
                        "type": "integer"
                    },
                    "upload_count": {
                        "description": "UploadCount is EXACT — a COUNT over the artist's nostr_content rows with\nthis content type. Counts across the whole block sum to TracksUploaded.\nSoft-deleted rows are INCLUDED, matching TracksUploaded's own query.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.DepositInfo": {
                "type": "object",
                "properties": {
                    "artist_deposit_balance_cents": {
                        "description": "ArtistDepositBalanceCents reads artist_balances.artist_deposit_balance\n(USD cents): what is left of the RETIRED prepaid hosting balance. Nothing\nspends or funds it any more — hosting is paid per release at publish for\nevery content type (D146; #3999) — so it never changes; it stays on the\nwire only while the retired apps/web compiles against it.",
                        "type": "integer"
                    },
                    "deposits_by_content_type": {
                        "description": "DepositsByContentType counts the artist's uploads by semantic\ncontent_type (upload-deposit-enablement Phase 3). Sorted by content_type\nfor a stable render. The counts are exact; the per-type amount is retired\nand always 0 (DepositContentTypeBreakdown.EstimatedDepositedCents).\n\nEmpty for an artist with no artist_balances row (the same short-circuit\nthat zeroes every other field here), for an artist with no uploads, and\nwhen the breakdown query fails (it degrades rather than failing the\ndashboard) — the client must treat all three the same way: no breakdown\nto show, never \"zero uploads\".\n\nOPTIONAL (omitempty): backend and frontend deploy independently, so a\nlive contract never gains a required field.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.DepositContentTypeBreakdown"
                        }
                    },
                    "total_deposited_credits": {
                        "description": "Total deposits made in credits",
                        "type": "integer"
                    },
                    "tracks_uploaded": {
                        "description": "Number of tracks with deposits",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EarningsResponse": {
                "type": "object",
                "properties": {
                    "available_credits": {
                        "description": "Withdrawable right now (cents): balance − held earnings. Point-in-time, pubkey-level.",
                        "type": "integer"
                    },
                    "by_track": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TrackEarnings"
                        }
                    },
                    "held_credits": {
                        "description": "Earnings still inside their hold window (cents). AvailableCredits + HeldCredits == current balance.",
                        "type": "integer"
                    },
                    "next_release_at": {
                        "description": "RFC3339 UTC of the next hold release; omitted when nothing is held (omitempty keeps the wire in lock-step with the tygo-optional `next_release_at?:` TS field).",
                        "type": "string"
                    },
                    "period_end": {
                        "type": "string"
                    },
                    "period_start": {
                        "type": "string"
                    },
                    "sales": {
                        "description": "Sales is the buy-to-own block for the period (D147, design §10): orders,\ngross, fee and net. USD only, like every money figure here. Absent when\nthere were no sales in the period (additive field; absent = all zero).",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EarningsSales"
                            }
                        ]
                    },
                    "sales_list": {
                        "description": "SalesList is every sale in the period on its own line (founder ruling\n2026-10-01: every payment is tracked and shown, held or not), newest\nfirst, at most 500. Absent when there were no sales.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EarningsSale"
                        }
                    },
                    "summary": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EarningsSummary"
                    },
                    "time_series": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.DailyEarnings"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EarningsSale": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "fee_millicents": {
                        "type": "integer"
                    },
                    "gross_cents": {
                        "type": "integer"
                    },
                    "held": {
                        "type": "boolean"
                    },
                    "held_until": {
                        "description": "RFC3339 UTC; only while held",
                        "type": "string"
                    },
                    "item": {
                        "type": "string"
                    },
                    "item_kind": {
                        "type": "string"
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "owner_pubkey": {
                        "type": "string"
                    },
                    "shared": {
                        "type": "boolean"
                    },
                    "sold_at": {
                        "description": "RFC3339 UTC",
                        "type": "string"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EarningsSales": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "fee_millicents": {
                        "type": "integer"
                    },
                    "gross_cents": {
                        "type": "integer"
                    },
                    "held_count": {
                        "type": "integer"
                    },
                    "held_net_millicents": {
                        "type": "integer"
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "next_held_release_at": {
                        "description": "RFC3339 UTC",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EarningsSummary": {
                "type": "object",
                "properties": {
                    "base_revenue_credits": {
                        "description": "Sum of price_credits for per-stream events (excludes every synthetic distribution row)",
                        "type": "integer"
                    },
                    "generous_mode_credits": {
                        "description": "Generous-mode income (stream_type IN models.GenerousModeStreamTypes): per-subscriber anniversary cycle sweeps + quarterly idle-pool distributions (R4/R5/R21). Distinct from base revenue and from tips.",
                        "type": "integer"
                    },
                    "net_earnings_millicents": {
                        "description": "Exact net for the period in millicents: what was paid to the caller. Without a split = TotalEarningsCredits×1000 − PlatformFeeMillis. See type doc.",
                        "type": "integer"
                    },
                    "owner_plays": {
                        "description": "Plays by listeners who bought the track (stream_type='owned', design §9.4); absent = 0. Already inside TotalStreams; a COUNT, never money.",
                        "type": "integer"
                    },
                    "platform_fee_millicents": {
                        "description": "Exact platform fee for the period in millicents (sum of per-row fee_millicents). See type doc.",
                        "type": "integer"
                    },
                    "sales_credits": {
                        "description": "Buy-to-own sales gross (stream_type='purchase', D147); absent = 0. Part of TotalEarningsCredits; never a stream, never a tip. The orders/fee/net detail is EarningsResponse.Sales.",
                        "type": "integer"
                    },
                    "subscription_distribution_credits": {
                        "description": "LEGACY pro-rata EOM distributions from historical subscription cycles (stream_type='eom_distribution'). Read-only legacy — never merged with GenerousModeCredits.",
                        "type": "integer"
                    },
                    "tip_rate": {
                        "description": "Percentage of per-stream rows with an overpayment tip (0-1)",
                        "type": "number"
                    },
                    "tips_credits": {
                        "description": "Overpayment above base price on per-stream rows (amount - price; excludes every synthetic distribution row). Surfaced in UI as \"Streaming income\".",
                        "type": "integer"
                    },
                    "total_earnings_credits": {
                        "description": "GROSS sum of amount_credits (base + overpayment tips + both distribution classes)",
                        "type": "integer"
                    },
                    "total_streams": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPassRequest": {
                "type": "object",
                "required": [
                    "play_session_id",
                    "release_d_tag",
                    "release_pubkey",
                    "track_d_tag"
                ],
                "properties": {
                    "play_session_id": {
                        "description": "PlaySessionID is the player's UUIDv4 for this one play; the pass is\nbound to it, and so is the play record.",
                        "type": "string"
                    },
                    "release_d_tag": {
                        "type": "string"
                    },
                    "release_pubkey": {
                        "type": "string"
                    },
                    "track_d_tag": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPassResponse": {
                "type": "object",
                "properties": {
                    "expires_at": {
                        "description": "ExpiresAt is the pass's RFC3339 expiry; null when Play is \"excerpt\".",
                        "type": "string"
                    },
                    "pass": {
                        "description": "Pass goes on the audio request as ?embed_pass= and on the play record.\nIt needs no escaping. Null when Play is \"excerpt\".",
                        "type": "string"
                    },
                    "play": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPlayHost": {
                "type": "object",
                "properties": {
                    "host": {
                        "type": "string"
                    },
                    "plays": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPlayRequest": {
                "type": "object",
                "required": [
                    "play_session_id",
                    "played",
                    "release_d_tag",
                    "release_pubkey",
                    "track_d_tag"
                ],
                "properties": {
                    "host": {
                        "description": "Host is the framing page's host name (for example \"blog.example.com\"),\nwhen the browser gives one. A host name only: a full address is refused.",
                        "type": "string"
                    },
                    "pass": {
                        "description": "Pass is the play's pass from POST /v1/embed/pass. A \"full\" play of a\ntrack that needs one is recorded only with a valid pass for the same\ntrack and play session.",
                        "type": "string"
                    },
                    "play_session_id": {
                        "description": "PlaySessionID is the player's UUIDv4 for this one play: the request is\nidempotent on it.",
                        "type": "string"
                    },
                    "played": {
                        "description": "Played is \"full\" or \"excerpt\". \"full\" is accepted only for a track that\nplays in full.",
                        "type": "string"
                    },
                    "release_d_tag": {
                        "type": "string"
                    },
                    "release_pubkey": {
                        "type": "string"
                    },
                    "track_d_tag": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPlayResponse": {
                "type": "object",
                "properties": {
                    "recorded": {
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedPlaysResponse": {
                "type": "object",
                "properties": {
                    "excerpt": {
                        "type": "integer"
                    },
                    "full": {
                        "type": "integer"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "top_hosts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedPlayHost"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedReleaseResponse": {
                "type": "object",
                "properties": {
                    "mode": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.EmbedReleaseTrack"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedReleaseTrack": {
                "type": "object",
                "properties": {
                    "needs_pass": {
                        "description": "NeedsPass is true for a track that plays \"full\" only on a pass: a paid\nsong longer than 40 seconds in full-songs mode. The player asks\nPOST /v1/embed/pass before playing it and plays the excerpt on any\nanswer but a pass.",
                        "type": "boolean"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "play": {
                        "type": "string"
                    },
                    "position": {
                        "description": "Position is the 1-based place in the release's track list.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedSettingRequest": {
                "type": "object",
                "required": [
                    "mode",
                    "nostr_d_tag"
                ],
                "properties": {
                    "mode": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.EmbedSettingResponse": {
                "type": "object",
                "properties": {
                    "full_available": {
                        "description": "FullAvailable is true when \"full\" can be saved (EMBED_FULL_PLAY_ENABLED\nis on). While it is false a stored \"full\" plays as \"excerpt\".",
                        "type": "boolean"
                    },
                    "mode": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "UpdatedAt is the server's RFC3339 stamp of the last change to an \"on\"\nsetting; null when it is off.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedDownloadsRequest": {
                "type": "object",
                "required": [
                    "podcast_guids"
                ],
                "properties": {
                    "podcast_guids": {
                        "type": "array",
                        "maxItems": 100,
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedDownloadsResponse": {
                "type": "object",
                "properties": {
                    "as_of": {
                        "description": "AsOf is the day OP3 last updated, YYYY-MM-DD; empty with no shows.",
                        "type": "string"
                    },
                    "available": {
                        "type": "boolean"
                    },
                    "shows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedDownloadsShow"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedDownloadsShow": {
                "type": "object",
                "properties": {
                    "monthly_downloads": {
                        "type": "integer"
                    },
                    "podcast_guid": {
                        "type": "string"
                    },
                    "stats_page_url": {
                        "type": "string"
                    },
                    "weekly_downloads": {
                        "description": "WeeklyDownloads is oldest first, always an array.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedbackReceipt": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedbackReportContext": {
                "type": "object",
                "properties": {
                    "build": {
                        "description": "Build is the app build (the deployed commit), when the build has one.",
                        "type": "string"
                    },
                    "console_errors": {
                        "description": "ConsoleErrors are the last few errors the page logged, newest last,\nalready redacted by the app.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "path": {
                        "description": "Path is the page's path, without its query or fragment.",
                        "type": "string"
                    },
                    "user_agent": {
                        "type": "string"
                    },
                    "viewport_height": {
                        "type": "integer"
                    },
                    "viewport_width": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedbackReportReceipt": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedbackReportRequest": {
                "type": "object",
                "properties": {
                    "context": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.FeedbackReportContext"
                    },
                    "message": {
                        "type": "string"
                    },
                    "screenshot": {
                        "type": "string"
                    },
                    "screenshot_type": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FeedbackSubmission": {
                "type": "object",
                "required": [
                    "actual",
                    "category",
                    "expected",
                    "intent",
                    "service",
                    "submission_id"
                ],
                "properties": {
                    "actual": {
                        "type": "string",
                        "maxLength": 2000
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "bug",
                            "missing_capability",
                            "documentation"
                        ]
                    },
                    "correlation_id": {
                        "type": "string"
                    },
                    "expected": {
                        "type": "string",
                        "maxLength": 2000
                    },
                    "intent": {
                        "type": "string",
                        "maxLength": 2000
                    },
                    "method": {
                        "type": "string",
                        "enum": [
                            "GET",
                            "POST",
                            "PUT",
                            "PATCH",
                            "DELETE",
                            "HEAD",
                            "OPTIONS"
                        ]
                    },
                    "reproduction": {
                        "type": "string",
                        "maxLength": 4000
                    },
                    "response_status": {
                        "type": "integer",
                        "maximum": 599,
                        "minimum": 100
                    },
                    "route": {
                        "type": "string",
                        "maxLength": 256
                    },
                    "sdk_version": {
                        "type": "string",
                        "maxLength": 128
                    },
                    "service": {
                        "type": "string",
                        "enum": [
                            "api",
                            "feeds",
                            "relay",
                            "sdk",
                            "other"
                        ]
                    },
                    "submission_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FileUploadToken": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "expires_at": {
                        "type": "string"
                    },
                    "path": {
                        "type": "string"
                    },
                    "token": {
                        "type": "string"
                    },
                    "user_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FindBandsintownArtistRequest": {
                "type": "object",
                "properties": {
                    "apiKey": {
                        "type": "string"
                    },
                    "artist": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.FindBandsintownArtistResponse": {
                "type": "object",
                "properties": {
                    "artist": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.BandsintownArtist"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ImportBandsintownShowsRequest": {
                "type": "object",
                "properties": {
                    "apiKey": {
                        "type": "string"
                    },
                    "artistId": {
                        "type": "string"
                    },
                    "artistName": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ImportBandsintownShowsResponse": {
                "type": "object",
                "properties": {
                    "shows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ImportedShow"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ImportedShow": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string"
                    },
                    "date": {
                        "type": "string"
                    },
                    "details": {
                        "type": "string"
                    },
                    "sourceUrl": {
                        "type": "string"
                    },
                    "ticketUrl": {
                        "type": "string"
                    },
                    "venue": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeAsk": {
                "type": "object",
                "properties": {
                    "consent_expires_at": {
                        "description": "ConsentExpiresAt is when a consent lapses unused (24 hours after it was\ngiven); nil until the person confirms.",
                        "type": "string"
                    },
                    "consented": {
                        "description": "Consented: the person confirmed it, and the consent still stands.",
                        "type": "boolean"
                    },
                    "expires_at": {
                        "description": "ExpiresAt is when the ask lapses unconfirmed (seven days after staff\nasked).",
                        "type": "string"
                    },
                    "to_pubkey": {
                        "description": "ToPubkey is the new key staff will move the account onto (hex).",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeConsentRequest": {
                "type": "object",
                "required": [
                    "to_pubkey"
                ],
                "properties": {
                    "to_pubkey": {
                        "description": "ToPubkey is the ask's new key: 64-character lowercase hex.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeDeletion": {
                "type": "object",
                "properties": {
                    "d_tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeRefusedDetails": {
                "type": "object",
                "properties": {
                    "channel_ids": {
                        "description": "ChannelIDs names the channels the old key still owns, with\nchannels_not_handed_over.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "reasons": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeStartOverRequest": {
                "type": "object",
                "required": [
                    "to_pubkey"
                ],
                "properties": {
                    "to_pubkey": {
                        "description": "ToPubkey is the key to move onto: 64-character lowercase hex, already\nan active sign-in key of this account, and not the key signing.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.KeyChangeStatusResponse": {
                "type": "object",
                "properties": {
                    "ask": {
                        "description": "Ask is staff's open ask to move this account to a new key (#6212),\nanswered only to the key it moves off (the signing key), and only\nwhile the person can still confirm it or has confirmed it. Nil\notherwise. The Studio shows the \"Confirm it's you\" card from it.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeAsk"
                            }
                        ]
                    },
                    "by_staff": {
                        "description": "ByStaff says the change was a staff key change (accounts.key_change,\n#6179), answered finished to either key of it, not a self-service one.",
                        "type": "boolean"
                    },
                    "deletions": {
                        "description": "Deletions is what the browser deletes from the relay, signed by\nFromPubkey. Set while State is music_cleared, and on a finished staff\nchange (ByStaff): there it names the old key's moved coordinates, which\nthe new key re-signs first (the releases among them) and the old key\nthen deletes (#6205).",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.KeyChangeDeletion"
                        }
                    },
                    "eligible": {
                        "description": "Eligible says whether the signing key may start a change now. Always\nfalse while one is under way or finished for this key.",
                        "type": "boolean"
                    },
                    "from_pubkey": {
                        "description": "FromPubkey is the key the account moves off (hex): the account's main\nkey while State is none, the change's own otherwise.",
                        "type": "string"
                    },
                    "old_key_wallet": {
                        "description": "OldKeyWallet says the key the account moves off has a Wavlake wallet\n(#6101). The money in it stays with that key, which stays a sign-in\nkey; the person is told so before confirming. The account name's\naddress, if it pays that wallet, is released at the finish and answers\n\"not set up\" until the new key sets up its own. Set while State is none\nor music_cleared.",
                        "type": "boolean"
                    },
                    "reasons": {
                        "description": "Reasons names why not, in a fixed order. Empty when Eligible, and while\na change is under way.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "state": {
                        "description": "State is none, music_cleared or finished.",
                        "type": "string"
                    },
                    "to_pubkey": {
                        "description": "ToPubkey is the key the account moves onto (hex). Empty while State is\nnone.",
                        "type": "string"
                    },
                    "wait_seconds": {
                        "description": "WaitSeconds is how long an account that qualifies must still wait\nbefore it starts: the relay keeps who owns a track's audio for ten\nminutes after the old key's tracks last went out, and refuses the new\nkey's inside them. Zero (omitted) when a start would go ahead now, when\nthe account does not qualify, and while a change is under way.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LNURLError": {
                "type": "object",
                "properties": {
                    "reason": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LNURLPayMetadata": {
                "type": "object",
                "properties": {
                    "allowsNostr": {
                        "description": "NIP-57: Whether this address supports zaps",
                        "type": "boolean"
                    },
                    "callback": {
                        "description": "Callback URL for invoice generation (hex pubkey in path)",
                        "type": "string"
                    },
                    "commentAllowed": {
                        "description": "Optional comment length limit",
                        "type": "integer"
                    },
                    "maxSendable": {
                        "description": "Maximum amount in millisatoshis",
                        "type": "integer"
                    },
                    "metadata": {
                        "description": "Metadata as JSON-encoded array of arrays per LUD-06\nFormat: [[\"text/plain\", \"description\"]]",
                        "type": "string"
                    },
                    "minSendable": {
                        "description": "Minimum amount in millisatoshis",
                        "type": "integer"
                    },
                    "nostrPubkey": {
                        "description": "NIP-57: Hex pubkey that will sign zap receipts",
                        "type": "string"
                    },
                    "tag": {
                        "description": "Tag identifying this as a pay request",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyAlbum": {
                "type": "object",
                "properties": {
                    "artist_id": {
                        "type": "string"
                    },
                    "artwork_url": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "deleted": {
                        "type": "boolean"
                    },
                    "description": {
                        "type": "string"
                    },
                    "genre_id": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "string"
                    },
                    "is_draft": {
                        "type": "boolean"
                    },
                    "is_feed_published": {
                        "type": "boolean"
                    },
                    "is_single": {
                        "type": "boolean"
                    },
                    "msat_total": {
                        "type": "integer"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "subgenre_id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyArtist": {
                "type": "object",
                "properties": {
                    "artist_url": {
                        "type": "string"
                    },
                    "artwork_url": {
                        "type": "string"
                    },
                    "bio": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "deleted": {
                        "type": "boolean"
                    },
                    "id": {
                        "type": "string"
                    },
                    "instagram": {
                        "type": "string"
                    },
                    "msat_total": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "npub": {
                        "type": "string"
                    },
                    "twitter": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    },
                    "user_id": {
                        "type": "string"
                    },
                    "verified": {
                        "type": "boolean"
                    },
                    "website": {
                        "type": "string"
                    },
                    "youtube": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceAddressCheck": {
                "type": "object",
                "properties": {
                    "address": {
                        "description": "Address is the address as it would be saved: trimmed, lowercased.",
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceAddressRequest": {
                "type": "object",
                "required": [
                    "address"
                ],
                "properties": {
                    "address": {
                        "description": "Address is a Lightning address, name@host.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceDestination": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceMove": {
                "type": "object",
                "properties": {
                    "amount_msat": {
                        "description": "AmountMsat is the invoice amount: what the wallet is paid.",
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "destination_address": {
                        "type": "string"
                    },
                    "fee_msat": {
                        "description": "FeeMsat is the routing fee the person was charged; set once settled.\nNever more than FeeReserveMsat: a fee above the reserve is absorbed by\nthe platform. The rest of the reserve went back to the OLD balance, not\nto the wallet.",
                        "type": "integer"
                    },
                    "fee_reserve_msat": {
                        "description": "FeeReserveMsat was set aside beside the amount for the routing fee.",
                        "type": "integer"
                    },
                    "move_id": {
                        "type": "string"
                    },
                    "payment_hash": {
                        "description": "PaymentHash (hex) matches the wallet's own history entry.",
                        "type": "string"
                    },
                    "refusal_code": {
                        "description": "RefusalCode is set on a `refused` move: a LEGACY_BALANCE_* code.",
                        "type": "string"
                    },
                    "route": {
                        "description": "Route says which of the account's destinations the move paid.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceRoute"
                            }
                        ]
                    },
                    "settled_at": {
                        "type": "string"
                    },
                    "state": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMoveState"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceMoveRequest": {
                "type": "object",
                "required": [
                    "expected_amount_msat",
                    "move_id"
                ],
                "properties": {
                    "confirmed_address": {
                        "description": "ConfirmedAddress is required with \"own_address\": the saved address the\nperson was shown in full and confirmed. It is compared with the address\nsaved on the account and never paid; a mismatch is a 409\nLEGACY_BALANCE_OWN_ADDRESS_CHANGED.",
                        "type": "string"
                    },
                    "expected_amount_msat": {
                        "description": "ExpectedAmountMsat is the preview's `amount_msat` the person confirmed.",
                        "type": "integer"
                    },
                    "extra_confirmed": {
                        "description": "ExtraConfirmed is the second confirmation a large move needs.",
                        "type": "boolean"
                    },
                    "move_id": {
                        "description": "MoveID is a lowercase UUID v4 the client generates: the idempotency key.",
                        "type": "string"
                    },
                    "route": {
                        "description": "Route is \"wallet\" (the default when empty) or \"own_address\".",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceRoute"
                            }
                        ]
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceMoveState": {
                "type": "string",
                "enum": [
                    "created",
                    "submitted",
                    "on_hold",
                    "settled",
                    "failed_refunded",
                    "refused"
                ],
                "x-enum-varnames": [
                    "LegacyBalanceMoveCreated",
                    "LegacyBalanceMoveSubmitted",
                    "LegacyBalanceMoveOnHold",
                    "LegacyBalanceMoveSettled",
                    "LegacyBalanceMoveFailedRefunded",
                    "LegacyBalanceMoveRefused"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceOwnAddress": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "description": "MinSendableMsat / MaxSendableMsat are zero when the address could not\nbe read just now (its blocker says why).",
                        "type": "integer"
                    },
                    "saved_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceOwnAddressRoute": {
                "type": "object",
                "properties": {
                    "address": {
                        "description": "Address is the saved address; null until one is saved.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceOwnAddress"
                            }
                        ]
                    },
                    "blockers": {
                        "description": "Blockers lists EVERY reason a move to the saved address cannot start\nnow: the account's own (as in the wallet route's `blockers`, less its\nwallet set-up codes) and the address's\n(LEGACY_BALANCE_OWN_ADDRESS_*, LEGACY_BALANCE_DESTINATION_LIMIT).\nLEGACY_BALANCE_OWN_ADDRESS_MOVE_CAP is here, saved address or not, when\nan operator's maximum for one move is below the whole amount.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "preview": {
                        "description": "Preview is what one move to an address would do: the whole available\nbalance. It is never reduced to what an address or an operator's\nmaximum allows: either is refused (LEGACY_BALANCE_OWN_ADDRESS_CAP,\nLEGACY_BALANCE_OWN_ADDRESS_MOVE_CAP), never paid in parts.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalancePreview"
                            }
                        ]
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalancePreview": {
                "type": "object",
                "properties": {
                    "amount_msat": {
                        "description": "AmountMsat is \"you'll receive about\": the invoice amount.",
                        "type": "integer"
                    },
                    "debit_msat": {
                        "description": "DebitMsat = AmountMsat + FeeReserveMsat leaves the old balance at the move.",
                        "type": "integer"
                    },
                    "fee_reserve_msat": {
                        "description": "FeeReserveMsat is set aside for the routing fee; the unused part\nreturns to the old balance.",
                        "type": "integer"
                    },
                    "partial": {
                        "description": "Partial: a limit, not the balance, set the amount. The rest moves in a\nlater move.",
                        "type": "boolean"
                    },
                    "remaining_msat": {
                        "description": "RemainingMsat stays on the old balance.",
                        "type": "integer"
                    },
                    "requires_extra_confirmation": {
                        "description": "RequiresExtraConfirmation: the move must carry `extra_confirmed: true`.",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceResponse": {
                "type": "object",
                "properties": {
                    "active_move": {
                        "description": "ActiveMove is the account's one move in flight, if any.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMove"
                            }
                        ]
                    },
                    "available_msat": {
                        "description": "AvailableMsat is the balance less anything already on its way out.",
                        "type": "integer"
                    },
                    "balance_msat": {
                        "type": "integer"
                    },
                    "blockers": {
                        "description": "Blockers lists EVERY reason a move cannot start now (LEGACY_BALANCE_*\ncodes). Empty means a move may start.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "confirm_above_msat": {
                        "description": "ConfirmAboveMsat: a move above this needs the extra confirmation.",
                        "type": "integer"
                    },
                    "destination": {
                        "description": "Destination is null until the wallet checks pass, and always for a\ncaller with no signing key.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceDestination"
                            }
                        ]
                    },
                    "dust_msat": {
                        "description": "DustMsat: an available balance below this does not move.",
                        "type": "integer"
                    },
                    "fee_reserve_ppm": {
                        "description": "FeeReservePPM is the routing-fee reserve in parts per million.",
                        "type": "integer"
                    },
                    "has_legacy_user": {
                        "description": "HasLegacyUser is false when no legacy account exists for the sign-in;\nevery other field is then zero or null.",
                        "type": "boolean"
                    },
                    "last_move": {
                        "description": "LastMove is the account's newest finished move, if any.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceMove"
                            }
                        ]
                    },
                    "own_address": {
                        "description": "OwnAddress is the own-address route (#4158), beside the wallet route\nthat `blockers`, `destination` and `preview` describe. Null with no\nlegacy account, and while the old system's switch is off.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalanceOwnAddressRoute"
                            }
                        ]
                    },
                    "preview": {
                        "description": "Preview is null with no legacy account or below the dust line.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyBalancePreview"
                            }
                        ]
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceRoute": {
                "type": "string",
                "enum": [
                    "wallet",
                    "own_address"
                ],
                "x-enum-varnames": [
                    "LegacyBalanceRouteWallet",
                    "LegacyBalanceRouteOwnAddress"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.LegacyBalanceSavedAddress": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "type": "integer"
                    },
                    "saved_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyFeedHandoffFeed": {
                "type": "object",
                "properties": {
                    "identifier": {
                        "type": "string"
                    },
                    "level": {
                        "type": "string"
                    },
                    "path": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyFeedHandoffResponse": {
                "type": "object",
                "properties": {
                    "account_feed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyFeedHandoffFeed"
                    },
                    "feed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyFeedHandoffFeed"
                    },
                    "handoff_since": {
                        "description": "HandoffSince is when this id's redirect trial started (#4067 §1a;\nlegacy_feed_handoff_trials, 000118): the caller answers a temporary\nredirect until LEGACY_HANDOFF_PROBATION_DAYS have passed, then a 301.\nOMITTED when it could not be recorded — the caller must read absence\nas \"inside the trial\", never as \"permanent\".",
                        "type": "string"
                    },
                    "legacy_id": {
                        "description": "LegacyID echoes the requested UUID, lower-cased (the stored ids are\nlowercase UUID text; either case is accepted on the request).",
                        "type": "string"
                    },
                    "legacy_kind": {
                        "description": "LegacyKind is what that UUID was in the legacy catalog: \"artist\" or\n\"album\". A legacy artist maps to a channel feed (D109), an album to a\nrelease feed.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyRssGateRequest": {
                "type": "object",
                "required": [
                    "continue_rss"
                ],
                "properties": {
                    "continue_rss": {
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyRssGateResponse": {
                "type": "object",
                "properties": {
                    "continue_rss": {
                        "type": "boolean"
                    },
                    "decided_at": {
                        "type": "string"
                    },
                    "destination_path": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyTrack": {
                "type": "object",
                "properties": {
                    "album_id": {
                        "type": "string"
                    },
                    "artist_id": {
                        "type": "string"
                    },
                    "compressor_error": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "deleted": {
                        "type": "boolean"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "string"
                    },
                    "is_draft": {
                        "type": "boolean"
                    },
                    "is_explicit": {
                        "type": "boolean"
                    },
                    "is_processing": {
                        "type": "boolean"
                    },
                    "live_url": {
                        "type": "string"
                    },
                    "lyrics": {
                        "type": "string"
                    },
                    "msat_total": {
                        "type": "integer"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "play_count": {
                        "type": "integer"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "raw_url": {
                        "type": "string"
                    },
                    "size": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LegacyUser": {
                "type": "object",
                "properties": {
                    "amp_msat": {
                        "type": "integer"
                    },
                    "artwork_url": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "is_locked": {
                        "type": "boolean"
                    },
                    "lightning_address": {
                        "type": "string"
                    },
                    "msat_balance": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "profile_url": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.LinkedPubkeyInfo": {
                "type": "object",
                "properties": {
                    "is_auto_generated": {
                        "type": "boolean"
                    },
                    "is_primary": {
                        "type": "boolean"
                    },
                    "last_used_at": {
                        "type": "string"
                    },
                    "linked_at": {
                        "type": "string"
                    },
                    "passkey_credential_ids": {
                        "description": "PasskeyCredentialIDs are the passkeys this key was proven with (#3949),\nnewest first, base64url: the client passes them as `allowCredentials` so\nthe browser offers only this account's passkey. Absent when none is\nrecorded or the read failed. Served only to the account's owner.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ListenerPurchasesResponse": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "purchases": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CreditPurchase"
                        }
                    },
                    "total_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ListenerReceiptResponse": {
                "type": "object",
                "properties": {
                    "distribution": {
                        "description": "Distribution is the subscriber-only month-end distribution section, or\nnil for PAYG listeners (and Tier-1 listeners with no subscription).",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceiptDistributionSection"
                            }
                        ]
                    },
                    "isSubscriber": {
                        "description": "IsSubscriber is true when the requesting listener had a subscription\ncycle covering the requested month.",
                        "type": "boolean"
                    },
                    "month": {
                        "description": "Month is the requested month in YYYY-MM format (UTC); empty when the\nreceipt was asked for by a start/end window.",
                        "type": "string"
                    },
                    "perStream": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceiptPerStreamArtist"
                        }
                    },
                    "totalSpentCredits": {
                        "description": "TotalSpentCredits is the sum of SpentCredits across the per-stream\nsection, in credits (USD cents).",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ListenerStream": {
                "type": "object",
                "properties": {
                    "amount": {
                        "description": "Amount paid in cents (0 for free streams)",
                        "type": "integer"
                    },
                    "artist_name": {
                        "description": "Always empty: read the track off the relay by track_pubkey + track_d_tag",
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "stream_type": {
                        "description": "paid, free_tier, free_access, honor_paid, honor_unpaid, owned",
                        "type": "string"
                    },
                    "streamed_at": {
                        "description": "When the stream occurred",
                        "type": "string"
                    },
                    "track_d_tag": {
                        "description": "Nostr d-tag for the track",
                        "type": "string"
                    },
                    "track_name": {
                        "description": "Always empty: read the track off the relay by track_pubkey + track_d_tag",
                        "type": "string"
                    },
                    "track_pubkey": {
                        "description": "Signer of the track (64-char hex); empty when the d-tag has no content row",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ListenerStreamsResponse": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "streams": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ListenerStream"
                        }
                    },
                    "total_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MembershipRecapArtist": {
                "type": "object",
                "properties": {
                    "artistName": {
                        "type": "string"
                    },
                    "artistPubkey": {
                        "type": "string"
                    },
                    "channelId": {
                        "type": "string"
                    },
                    "streamCount": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MembershipRecapCycle": {
                "type": "object",
                "properties": {
                    "artistCount": {
                        "description": "ArtistCount is the number of distinct artists played (distinct\nMembershipRecapArtist entries, so distinct credited names); Artists may list\nfewer (capped, most played first).",
                        "type": "integer"
                    },
                    "artists": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MembershipRecapArtist"
                        }
                    },
                    "current": {
                        "description": "Current is true while the cycle is still running.",
                        "type": "boolean"
                    },
                    "cycleEnd": {
                        "type": "string"
                    },
                    "cycleStart": {
                        "description": "CycleStart is absent only when the invoice's period start was not\nrecorded.",
                        "type": "string"
                    },
                    "share": {
                        "description": "Share is one of the MembershipShare* outcomes.",
                        "type": "string"
                    },
                    "streamCount": {
                        "description": "StreamCount is every membership-paid play in the cycle, including plays\nof content no longer listed (which have no artist entry below).",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MembershipRecapResponse": {
                "type": "object",
                "properties": {
                    "cycles": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MembershipRecapCycle"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchChannel": {
                "type": "object",
                "properties": {
                    "collection_title": {
                        "type": "string"
                    },
                    "collection_url": {
                        "description": "CollectionURL is the whole collection on the store; empty when the store\nshows it nowhere on its website.",
                        "type": "string"
                    },
                    "products": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchProduct"
                        }
                    },
                    "store_name": {
                        "type": "string"
                    },
                    "store_url": {
                        "type": "string"
                    },
                    "truncated": {
                        "description": "Truncated says the collection holds more products than are listed.",
                        "type": "boolean"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchChannelRequests": {
                "type": "object",
                "properties": {
                    "accepted": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                    },
                    "pending": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCheckout": {
                "type": "object",
                "properties": {
                    "checkout_url": {
                        "type": "string"
                    },
                    "short": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCheckoutShortLine"
                        }
                    },
                    "store_name": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCheckoutLine": {
                "type": "object",
                "properties": {
                    "community_id": {
                        "description": "the channel the product shows on, 32 hex",
                        "type": "string"
                    },
                    "quantity": {
                        "type": "integer"
                    },
                    "variant_id": {
                        "description": "gid://shopify/ProductVariant/<n>",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCheckoutRequest": {
                "type": "object",
                "properties": {
                    "lines": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCheckoutLine"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCheckoutShortLine": {
                "type": "object",
                "properties": {
                    "in_cart": {
                        "description": "InCart is how many the store's cart holds: 0 when it sold out.",
                        "type": "integer"
                    },
                    "requested": {
                        "type": "integer"
                    },
                    "variant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCollection": {
                "type": "object",
                "properties": {
                    "handle": {
                        "type": "string"
                    },
                    "has_products": {
                        "description": "HasProducts is false when the store's storefront sees no product in the\ncollection: an empty collection, or one not published to it.",
                        "type": "boolean"
                    },
                    "id": {
                        "description": "gid://shopify/Collection/<n>",
                        "type": "string"
                    },
                    "image_url": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchCollectionsResponse": {
                "type": "object",
                "properties": {
                    "collections": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchCollection"
                        }
                    },
                    "next_cursor": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchConnection": {
                "type": "object",
                "properties": {
                    "collection_handle": {
                        "type": "string"
                    },
                    "collection_id": {
                        "type": "string"
                    },
                    "collection_title": {
                        "type": "string"
                    },
                    "community_id": {
                        "type": "string"
                    },
                    "decided_at": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "removed_at": {
                        "type": "string"
                    },
                    "removed_by": {
                        "description": "RemovedBy is \"store\" or \"owner\" on a removed connection.",
                        "type": "string"
                    },
                    "requested_at": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "store_id": {
                        "type": "string"
                    },
                    "store_name": {
                        "type": "string"
                    },
                    "store_url": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchConnectionRequest": {
                "type": "object",
                "properties": {
                    "collection_id": {
                        "type": "string"
                    },
                    "community_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchConnectionsResponse": {
                "type": "object",
                "properties": {
                    "connections": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchConnection"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchOption": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "values": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchPrice": {
                "type": "object",
                "properties": {
                    "amount": {
                        "type": "string"
                    },
                    "currency_code": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchProduct": {
                "type": "object",
                "properties": {
                    "image_alt": {
                        "type": "string"
                    },
                    "image_url": {
                        "type": "string"
                    },
                    "options": {
                        "description": "Options are the product's options; none for a product sold in one\nversion. Variants are what the cart can hold; a product with none (a\nsnapshot read before Phase 4, or variants the store wrote badly) only\nlinks to its page.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchOption"
                        }
                    },
                    "price": {
                        "description": "Price is the lowest price; PriceVaries says some options cost more.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchPrice"
                            }
                        ]
                    },
                    "price_varies": {
                        "type": "boolean"
                    },
                    "sold_out": {
                        "type": "boolean"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "variants": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchVariant"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchStore": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "display_name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "shop_domain": {
                        "type": "string"
                    },
                    "store_url": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchStoresResponse": {
                "type": "object",
                "properties": {
                    "stores": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchStore"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MerchVariant": {
                "type": "object",
                "properties": {
                    "id": {
                        "description": "gid://shopify/ProductVariant/<n>",
                        "type": "string"
                    },
                    "price": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MerchPrice"
                    },
                    "sold_out": {
                        "type": "boolean"
                    },
                    "title": {
                        "description": "Title is the store's name for it (\"M / Black\"); empty for a product sold\nin one version.",
                        "type": "string"
                    },
                    "values": {
                        "description": "Values is its value of each of the product's options, in order.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationAlbumSeed": {
                "type": "object",
                "properties": {
                    "artist_credits": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "community_id": {
                        "description": "Same creator identity as the track seed.",
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "draft_track_ids": {
                        "description": "DraftTrackIDs: a PUBLISHED album's legacy draft (or scheduled) tracks,\nheld out of `track_ids` (which then lists only the tracks that publish,\nso the live release lists exactly those), in legacy order.\nEach has its own track seed marked `is_draft`, and the studio keeps each\nas a track draft the artist can add to the live release (#4111). Empty\nfor a draft album.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "genre_id": {
                        "type": "integer"
                    },
                    "image_url": {
                        "type": "string"
                    },
                    "is_draft": {
                        "description": "IsDraft: the legacy album was a draft (#4099), or was scheduled — its\n`published_at` still in the future when the run prepared it (#4111). The\nrelease lands as a NIP-37 draft with every track in `track_ids` and is\nnever published.",
                        "type": "boolean"
                    },
                    "legacy_album_id": {
                        "type": "string"
                    },
                    "legacy_artist_id": {
                        "type": "string"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "release_id": {
                        "description": "ReleaseID is the `releases` row prepare minted for this album\n(source='import'). The importer's track rows exist before any 34139 does,\nso the row has to come from prepare, not from a confirm (C40 (ii)); the\nclient confirms the publish against it.",
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "track_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationChannelSeed": {
                "type": "object",
                "properties": {
                    "artist_url": {
                        "type": "string"
                    },
                    "artwork_url": {
                        "type": "string"
                    },
                    "bio": {
                        "type": "string"
                    },
                    "community_id": {
                        "type": "string"
                    },
                    "instagram": {
                        "type": "string"
                    },
                    "legacy_artist_id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "twitter": {
                        "type": "string"
                    },
                    "website": {
                        "type": "string"
                    },
                    "youtube": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationPrepareConflict": {
                "type": "object",
                "properties": {
                    "community_id": {
                        "type": "string"
                    },
                    "legacy_album_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationPrepareError": {
                "type": "object",
                "properties": {
                    "error_code": {
                        "type": "string"
                    },
                    "legacy_id": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationPrepareItem": {
                "type": "object",
                "properties": {
                    "album_seed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationAlbumSeed"
                    },
                    "legacy_id": {
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    },
                    "track_seed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationTrackSeed"
                    },
                    "type": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationPrepareRequest": {
                "type": "object",
                "required": [
                    "legacy_track_ids"
                ],
                "properties": {
                    "community_id": {
                        "description": "CommunityID names the home community every row this run creates belongs\nto — its `h`. OPTIONAL (D83: `h` is 0..1). Omitted, the run imports\nSTANDALONE rows: the catalog lands under the importing key alone, its\n`releases` rows carry community_id = NULL, and no owner check runs\nbecause there is nothing to own. Supplied, the importing account must own\nthat community, proved by the same relay read the upload path makes (D71).\n\nA label importing several legacy artists runs ONE IMPORT PER HOME\nCOMMUNITY; the solo path is a single run. There is deliberately no\nper-artist community choice — a legacy artist is a NAME under this model\n(D47), not a container.",
                        "type": "string"
                    },
                    "legacy_track_ids": {
                        "description": "LegacyTrackIDs is the set of legacy `track.id` values the caller\nwants prepared. Per-call cap = 200 (PRD line 152: 500 total across\nall three arrays; Phase 1 only ships the track array, so the\neffective cap is 200 for Phase 1 to leave headroom for batched\n/readiness polls).",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationPrepareResponse": {
                "type": "object",
                "properties": {
                    "errors": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationPrepareError"
                        }
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationPrepareItem"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationRunAudio": {
                "type": "object",
                "properties": {
                    "failed": {
                        "type": "integer"
                    },
                    "pending": {
                        "type": "integer"
                    },
                    "ready": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationRunItemResponse": {
                "type": "object",
                "properties": {
                    "album_seed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationAlbumSeed"
                    },
                    "channel_seed": {
                        "description": "ChannelSeed is set for `type=channel` items, which only runs prepared\nbefore #3946 hold (Phase 4b; retired — the run makes no channels).",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationChannelSeed"
                            }
                        ]
                    },
                    "cursor": {
                        "type": "integer"
                    },
                    "error_code": {
                        "type": "string"
                    },
                    "legacy_id": {
                        "type": "string"
                    },
                    "title": {
                        "description": "Title names an ERROR item (#3435). An error item has no seed, and the\nseed is where a title otherwise lives, so without this the fix list can\nshow a refused track only as its legacy id. Set from the legacy row the\nworker refused; omitted on a seeded item (read the seed's title) and on\nan error the worker could not name (`not_owned`, or an item persisted\nbefore migration 000099) — the client falls back to legacy_id there.",
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    },
                    "track_seed": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationTrackSeed"
                    },
                    "type": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationRunResponse": {
                "type": "object",
                "properties": {
                    "audio": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationRunAudio"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "failed": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.MigrationRunItemResponse"
                        }
                    },
                    "last_error": {
                        "type": "string"
                    },
                    "next_cursor": {
                        "type": "integer"
                    },
                    "prepared": {
                        "type": "integer"
                    },
                    "run_id": {
                        "type": "string"
                    },
                    "signer_pubkey": {
                        "type": "string"
                    },
                    "signer_replaced": {
                        "description": "SignerReplaced says a key change moved the account off SignerPubkey\n(#6205): the run is over for every key. A client publishes nothing for\nit, signed with either key. The kick still refuses the old key\n(MIGRATION_KEY_REPLACED) and lets the new key through.",
                        "type": "boolean"
                    },
                    "state": {
                        "type": "string"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationStatusResponse": {
                "type": "object",
                "properties": {
                    "has_legacy_account": {
                        "type": "boolean"
                    },
                    "legacy_rss_answer": {
                        "description": "LegacyRssAnswer is the account's answer to the RETIRED legacy RSS gate\n(\"Keep distributing on podcast apps?\", legacy_rss_gate_decisions):\n\"yes\", \"no\", or null when the account never answered. Historical\nintent only: it gates nothing, and a setting saved through\n/v1/artist/feed-settings always outranks it. A client uses it to\nrecognise an artist who already answered before asking again.",
                        "type": "string"
                    },
                    "migrated": {
                        "type": "boolean"
                    },
                    "partially_migrated": {
                        "type": "boolean"
                    },
                    "rss_gate_pending": {
                        "type": "boolean"
                    },
                    "run_id": {
                        "type": "string"
                    },
                    "run_state": {
                        "type": "string"
                    },
                    "signer_replaced": {
                        "description": "SignerReplaced is the run's MigrationRunResponse.SignerReplaced: a key\nchange moved the account off the key the run signs with (#6205). False\nwith no run.",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.MigrationTrackSeed": {
                "type": "object",
                "properties": {
                    "access_mode": {
                        "description": "AccessMode + PriceCredits are the PAID DEFAULT every migrated release\nlands at (D99): `paywall` / 1 credit — the exact pair validatePricing\n(handlers/tracks.go) accepts for music, and the pair the nostr_content\nrow this seed describes was upserted with. The client renders the\ndisclosure from these; the artist can change any track later.",
                        "type": "string"
                    },
                    "album_genre_id": {
                        "type": "integer"
                    },
                    "album_pointer": {
                        "type": "string"
                    },
                    "album_title": {
                        "type": "string"
                    },
                    "artist_credits": {
                        "description": "ArtistCredits is the legacy artist's NAME (D47) — a credit, not a key and\nnot a container. A label importing 100 releases writes names here and\ncreates no identity, no event and no profile.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "artist_name": {
                        "type": "string"
                    },
                    "community_id": {
                        "description": "CommunityID is the home every hosted event carries as `[\"h\", <id>]`,\nalone: no pointer to the community definition (D55 as amended\n2026-10-16). The client threads it into the canonical builder.",
                        "type": "string"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "image_url": {
                        "type": "string"
                    },
                    "is_draft": {
                        "description": "IsDraft marks a track that is NEVER published (#4099, D95 as amended\n2026-10-05): the legacy track, or its legacy album, was a draft — or was\nscheduled, its `published_at` still in the future when the run prepared\nit (#4111). It still migrated (its API row and audio exist); the client\nnever signs a 36787 for it by itself, and it is not in a published album\nseed's `track_ids`. Absent on a seed stored before #4099 — every one of\nthose was a published track.",
                        "type": "boolean"
                    },
                    "is_explicit": {
                        "type": "boolean"
                    },
                    "legacy_album_id": {
                        "type": "string"
                    },
                    "legacy_artist_id": {
                        "type": "string"
                    },
                    "legacy_track_id": {
                        "type": "string"
                    },
                    "lyrics": {
                        "type": "string"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "price_credits": {
                        "type": "integer"
                    },
                    "streaming_url": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ModerationHiddenList": {
                "type": "object",
                "properties": {
                    "banned_pubkeys": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "generated_at": {
                        "type": "string"
                    },
                    "hidden_event_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.Nip05Response": {
                "type": "object",
                "properties": {
                    "names": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "relays": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.Nip05Type": {
                "type": "string",
                "enum": [
                    "personal",
                    "artist",
                    "community"
                ],
                "x-enum-varnames": [
                    "Nip05TypePersonal",
                    "Nip05TypeArtist",
                    "Nip05TypeCommunity"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.Nip05Verification": {
                "type": "object",
                "properties": {
                    "blockedAt": {
                        "description": "BlockedAt marks a revoked name. Revocation is a BLOCKED state, never a\nfreed name (I3-D8): the row keeps its username forever, so the global\nUNIQUE keeps holding and no squatter can re-reserve it.",
                        "type": "string"
                    },
                    "communityId": {
                        "description": "CommunityID is the 32-hex community id when type = \"community\", omitted\notherwise. There is no foreign key behind it: the relay is the authority\nfor whether that community exists (D71).\nD84 retired the fold. A community row is SLUG ROUTING and nothing else:\nit never answers /.well-known/nostr.json, never carries a Lightning\naddress and has no payment surface, so there is no `answers_owner_key`\nflag and no `folded_from_personal` audit column to read. The\n`<name>@wavlake.com` pointer set is one per ACCOUNT, and it hangs off the\naccount's own name row.",
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "isActive": {
                        "type": "boolean"
                    },
                    "pointsToCommunityId": {
                        "description": "PointsToCommunityID is the D84 account-name → community pointer, set\nonly on a personal (account) row: where `wavlake.com/<name>` routes.\nNULL/omitted = the account page (the default); a 32-hex community id =\nthat community's page, reversibly. ROUTING ONLY — the name still\nanswers the account key on /.well-known and still pays the owner's\nwallet. Ownership of the pointed community is relay-verified at write\ntime (the one owner-check mechanism) and never stored.",
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "Hex pubkey",
                        "type": "string"
                    },
                    "relays": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "description": "\"personal\", \"artist\" (pre-reset) or \"community\"",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Nip05Type"
                            }
                        ]
                    },
                    "updatedAt": {
                        "type": "string"
                    },
                    "userId": {
                        "type": "string"
                    },
                    "username": {
                        "description": "The NIP-05 identifier (e.g., \"josh\")",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.OwnedDownloadRequest": {
                "type": "object",
                "properties": {
                    "artist": {
                        "type": "string"
                    },
                    "title": {
                        "description": "Title and Artist are optional display hints the client read off the\nrelay; they only name the saved file (sanitised, length-capped). The API\nholds no title, and the artist defaults to the track's credited names.",
                        "type": "string"
                    },
                    "track": {
                        "description": "Track is the \"36787:<pubkey>:<d-tag>\" coordinate of a track the signer\nholds.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.OwnedDownloadResponse": {
                "type": "object",
                "properties": {
                    "expires_at": {
                        "description": "ExpiresAt is RFC3339 UTC (five minutes after issue).",
                        "type": "string"
                    },
                    "filename": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.OwnedPurchase": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "item": {
                        "type": "string"
                    },
                    "item_kind": {
                        "type": "string"
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "price_paid_cents": {
                        "type": "integer"
                    },
                    "purchased_at": {
                        "description": "PurchasedAt is RFC3339 UTC.",
                        "type": "string"
                    },
                    "release_artist": {
                        "type": "string"
                    },
                    "release_title": {
                        "description": "ReleaseTitle and ReleaseArtist are the release's names the order kept\n(PurchaseNames). Absent when it kept none.",
                        "type": "string"
                    },
                    "track_details": {
                        "description": "TrackDetails is one entry per Tracks coordinate, in the same order: the\nnames the track was bought under, when the order kept any, and where its\naudio is served. Every answer of this revision carries it. It is typed\noptional because the client is deployed ahead of the API (on merge; the\nAPI by its release), so the client must read an answer without it.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.OwnedPurchaseTrack"
                        }
                    },
                    "tracks": {
                        "description": "Tracks are the coordinates the buyer holds, in release order.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.OwnedPurchaseTrack": {
                "type": "object",
                "properties": {
                    "artist": {
                        "type": "string"
                    },
                    "audio_url": {
                        "description": "AudioURL is the track's streaming address, the one its event carries\nwhile it is published: \"<audio base>/v1/audio/<d-tag>\". It lets the\nholder play a track whose event is gone; the audio route still decides\nwhether to serve it. Absent when no audio base is configured.",
                        "type": "string"
                    },
                    "coordinate": {
                        "description": "Coordinate is \"36787:<pubkey>:<d-tag>\", verbatim from Tracks.",
                        "type": "string"
                    },
                    "title": {
                        "description": "Title and Artist are the names the order kept (PurchaseNames): what the\nbuyer saw when they bought it. Absent when it kept none. For music the\nrelay still has, the relay's own names are the ones to show.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.OwnedPurchasesResponse": {
                "type": "object",
                "properties": {
                    "purchases": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.OwnedPurchase"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.Payout": {
                "type": "object",
                "properties": {
                    "amount": {
                        "description": "Payout amount in smallest unit of Currency.",
                        "type": "integer"
                    },
                    "artist_pubkey": {
                        "type": "string"
                    },
                    "completed_at": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "description": "'USD' (cents) or 'SAT' (whole sats). See type doc.",
                        "type": "string"
                    },
                    "destination": {
                        "description": "Format depends on PaymentMethod; see type doc.",
                        "type": "string"
                    },
                    "error_message": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "payment_method": {
                        "type": "string"
                    },
                    "processed_at": {
                        "type": "string"
                    },
                    "provider": {
                        "description": "Lightning service provider (zbd, strike, etc.)",
                        "type": "string"
                    },
                    "provider_payment_id": {
                        "description": "External payment ID from provider",
                        "type": "string"
                    },
                    "quoted_amount_msats": {
                        "description": "QuotedAmountMsats is the whole-sat msats amount (always divisible by 1000)\nthe worker must dispatch for this payout. Computed at CreatePayout time\nfrom (Amount, QuotedBTCUSDRate). NULL for non-Lightning rails.",
                        "type": "integer"
                    },
                    "quoted_btc_usd_rate": {
                        "description": "QuotedBTCUSDRate is the USD-per-BTC rate captured at CreatePayout time for\nLightning/USD payouts. NULL for rails that do not require conversion (ACH,\nSAT-denominated). Surfaced so the UI and the actual dispatched amount\nreconcile — pre-migration-000039 the worker re-quoted the rate at dispatch\nand drifted from whatever the UI showed the artist.",
                        "type": "number"
                    },
                    "status": {
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PayoutEligibilityDetail": {
                "type": "object",
                "properties": {
                    "default_destination_masked": {
                        "description": "DefaultDestinationMasked is the masked form of the stored default\ndestination, or nil. Never returns the raw destination.",
                        "type": "string"
                    },
                    "default_method": {
                        "description": "DefaultMethod is the artist's stored default payout method, or nil.",
                        "type": "string"
                    },
                    "max_payout_credits": {
                        "description": "MaxPayoutCredits is the most one cash-out may take, in credits, on either\nrail (#5861, D177). A larger request is refused with 400 PAYOUT_OVER_CAP.",
                        "type": "integer"
                    },
                    "min_payout_by_method": {
                        "description": "MinPayoutByMethod is the per-method on-demand minimum payout in credits.\nKeys are PayoutMethod* constants (e.g., \"lightning\", \"ach\"). Lightning and\nACH carry different floors because their per-transfer cost profiles differ.",
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    },
                    "pending_payout_id": {
                        "description": "PendingPayoutID is the id of the current pending/processing payout, or nil.",
                        "type": "integer"
                    },
                    "rate_limit_remaining_seconds": {
                        "description": "RateLimitRemainingSeconds is 0 when the artist is eligible now; otherwise\nthe number of seconds until the 24h rate limit clears.",
                        "type": "integer"
                    },
                    "tier_status": {
                        "description": "TierStatus reflects the artist's verification tier — \"tier_3\" when KYC\nis complete, otherwise \"tier_0\". Informational only: no payout rail\nrequires Tier 3 (D149), so clients must not gate a cash-out on it.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PayoutListResponse": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "payouts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Payout"
                        }
                    },
                    "total": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PayoutPreferences": {
                "type": "object",
                "properties": {
                    "default_payout_destination": {
                        "type": "string"
                    },
                    "default_payout_method": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PayoutStatusInfo": {
                "type": "object",
                "properties": {
                    "eligible_for_payout": {
                        "description": "Balance >= min payout for at least one method",
                        "type": "boolean"
                    },
                    "hold_period_complete": {
                        "description": "7-day new artist hold passed",
                        "type": "boolean"
                    },
                    "last_payout_at": {
                        "description": "Last successful payout",
                        "type": "string"
                    },
                    "min_payout_credits_by_method": {
                        "description": "Per-method minimum payout threshold in credits",
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    },
                    "next_payout_allowed": {
                        "description": "When rate limit resets",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ProcessingStats": {
                "type": "object",
                "properties": {
                    "avg_duration_seconds": {
                        "type": "number"
                    },
                    "currently_processing": {
                        "type": "integer"
                    },
                    "failed_last_24h": {
                        "type": "integer"
                    },
                    "recently_failed_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "stuck_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseMethodsResponse": {
                "type": "object",
                "properties": {
                    "methods": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseNames": {
                "type": "object",
                "properties": {
                    "release_artist": {
                        "description": "ReleaseArtist is a whole release's credited names, joined for one line.",
                        "type": "string"
                    },
                    "release_title": {
                        "description": "ReleaseTitle is the release bought whole, or the release a track bought\non its own belongs to.",
                        "type": "string"
                    },
                    "tracks": {
                        "description": "Tracks names the order's tracks: one entry for a track order.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseTrackNames"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseOrderResponse": {
                "type": "object",
                "properties": {
                    "amount_sats": {
                        "description": "AmountSats is what Invoice asks the payer's wallet for, in whole sats —\nthe quote the invoice was opened with, so a client can check the code it\nis about to pay against it. Present only beside Invoice. Never what is\ncredited: that is ChargedPriceCents, fixed when the order opened.",
                        "type": "integer"
                    },
                    "charged_price_cents": {
                        "type": "integer"
                    },
                    "checkout_session_id": {
                        "description": "CheckoutSessionID and ClientSecret are how a pending card order paid\nINSIDE THE APP is paid: the Stripe Checkout Session and the secret its\npayment form opens with. Present only while that Session is open and the\nbuyer may still pay (never for a frozen or card-blocked account, nor\nwhere card purchases are off). The secret is read from Stripe on each\nanswer, never stored, and every answer carrying it is no-store.",
                        "type": "string"
                    },
                    "checkout_url": {
                        "description": "CheckoutURL is where a pending CARD order is paid (a hosted checkout\npage). Present only while the order is pending.",
                        "type": "string"
                    },
                    "client_secret": {
                        "type": "string"
                    },
                    "completed_at": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "expires_at": {
                        "type": "string"
                    },
                    "invoice": {
                        "description": "Invoice is the payment request a pending INSTANT order is paid with —\nshown as a code to scan with any wallet app. Present only while the\norder is pending; it lapses at ExpiresAt.",
                        "type": "string"
                    },
                    "item": {
                        "description": "Item is the bought coordinate, verbatim; ItemKind \"track\" or \"release\".",
                        "type": "string"
                    },
                    "item_kind": {
                        "type": "string"
                    },
                    "list_price_cents": {
                        "description": "ListPriceCents is the artist's price; ChargedPriceCents what this order\ncosts on its method (equal at launch). Whole US cents.",
                        "type": "integer"
                    },
                    "method": {
                        "type": "string"
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "refunded": {
                        "description": "Refunded reports that support refunded the order, or the payment was\ndisputed: the price went back as credits and the music is no longer\nheld through this order.",
                        "type": "boolean"
                    },
                    "status": {
                        "description": "Status is \"pending\", \"complete\", \"funded_not_bought\" or \"expired\".",
                        "type": "string"
                    },
                    "tracks": {
                        "description": "Tracks is the order's frozen track list (one entry for a track order).",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.PurchaseOrderTrack"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseOrderTrack": {
                "type": "object",
                "properties": {
                    "coordinate": {
                        "description": "Coordinate is \"36787:<pubkey>:<d-tag>\", verbatim.",
                        "type": "string"
                    },
                    "owned": {
                        "description": "Owned reports whether the buyer holds this track now (bought in this\norder or an earlier one).",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchasePriceBoundsResponse": {
                "type": "object",
                "properties": {
                    "currency": {
                        "description": "Currency is always \"usd\".",
                        "type": "string"
                    },
                    "floor_cents": {
                        "description": "FloorCents is the lowest price for a track or a release.",
                        "type": "integer"
                    },
                    "release_ceiling_cents": {
                        "description": "ReleaseCeilingCents is the highest price for a whole release.",
                        "type": "integer"
                    },
                    "release_min_tracks": {
                        "description": "ReleaseMinTracks is the fewest tracks a release needs for its own offer\n(2): a single's offer lives on its track.",
                        "type": "integer"
                    },
                    "track_ceiling_cents": {
                        "description": "TrackCeilingCents is the highest price for a track.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseStatus": {
                "type": "string",
                "enum": [
                    "processing",
                    "completed",
                    "failed"
                ],
                "x-enum-varnames": [
                    "PurchaseStatusProcessing",
                    "PurchaseStatusCompleted",
                    "PurchaseStatusFailed"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseTrackNames": {
                "type": "object",
                "properties": {
                    "artist": {
                        "description": "Artist is the track's credited names, joined for one line.",
                        "type": "string"
                    },
                    "coordinate": {
                        "description": "Coordinate is the track's \"36787:<pubkey>:<d-tag>\" (colon-safe). A\ncoordinate the order does not cover is dropped.",
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.PurchaseType": {
                "type": "string",
                "enum": [
                    "payg",
                    "subscription"
                ],
                "x-enum-varnames": [
                    "PurchaseTypePAYG",
                    "PurchaseTypeSubscription"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.ReceiptDistributionArtist": {
                "type": "object",
                "properties": {
                    "artistPubkey": {
                        "type": "string"
                    },
                    "distributedCredits": {
                        "description": "DistributedCredits is the credits allocated to this artist from the\nsubscriber's unspent subscription credits at month end, in credits (USD\ncents). For a finalized cycle this comes from\nsubscription_distributions.amount_credits.",
                        "type": "integer"
                    },
                    "streamCount": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReceiptDistributionSection": {
                "type": "object",
                "properties": {
                    "artists": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceiptDistributionArtist"
                        }
                    },
                    "cycleId": {
                        "description": "CycleID identifies the subscription cycle covering the requested month.",
                        "type": "integer"
                    },
                    "status": {
                        "description": "Status is pending until the cycle closes and EOMDistribution runs.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceiptMonthStatus"
                            }
                        ]
                    },
                    "totalDistributedCredits": {
                        "description": "TotalDistributedCredits is the sum of DistributedCredits across artists,\nin credits (USD cents). 0 while pending or when the subscriber spent all\nof their credits.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReceiptMonthStatus": {
                "type": "string",
                "enum": [
                    "pending",
                    "finalized"
                ],
                "x-enum-varnames": [
                    "ReceiptStatusPending",
                    "ReceiptStatusFinalized"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.ReceiptPerStreamArtist": {
                "type": "object",
                "properties": {
                    "artistName": {
                        "type": "string"
                    },
                    "artistPubkey": {
                        "type": "string"
                    },
                    "channelId": {
                        "type": "string"
                    },
                    "spentCredits": {
                        "description": "SpentCredits is the listener's own per-stream spend toward this artist\n(sum of stream_events.amount), in credits (USD cents).",
                        "type": "integer"
                    },
                    "streamCount": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReceivedSplit": {
                "type": "object",
                "properties": {
                    "owner_pubkey": {
                        "type": "string"
                    },
                    "total_weight": {
                        "type": "integer"
                    },
                    "track_id": {
                        "type": "string"
                    },
                    "weight": {
                        "description": "Weight combines direct and claimed-invite legs paid to the caller.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReceivedSplitsResponse": {
                "type": "object",
                "properties": {
                    "next_cursor": {
                        "type": "string"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReceivedSplit"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RecentStream": {
                "type": "object",
                "properties": {
                    "amount_credits": {
                        "type": "integer"
                    },
                    "amount_millicents": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "cycle_end": {
                        "type": "string"
                    },
                    "cycle_start": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "owner_pubkey": {
                        "type": "string"
                    },
                    "payment_method": {
                        "type": "string"
                    },
                    "settlement_event_id": {
                        "type": "string"
                    },
                    "shared": {
                        "type": "boolean"
                    },
                    "stream_type": {
                        "type": "string"
                    },
                    "subscriber_pubkey": {
                        "type": "string"
                    },
                    "track_breakdown": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.Release": {
                "type": "object",
                "properties": {
                    "artist_credits": {
                        "description": "ArtistCredits are NAMES, not keys (D47). A 100-release label import writes\nnames here and creates no identity, no event and no profile.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "community_id": {
                        "description": "CommunityID is the release's home community — its `h`. NIL when the\nrelease is STANDALONE: `h` is 0..1 (D83), so a release signed by its\npublisher alone, with no community anywhere in the flow, is the ordinary\ncase and not a transitional one. No foreign key either way: the relay is\nthe authority for a community's existence (D71).",
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "deleted": {
                        "type": "boolean"
                    },
                    "event_id": {
                        "type": "string"
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "NostrDTag is the release d-tag the album builder mints.",
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "Pubkey is the publisher: the key that SIGNS the release and is paid for\nit. Money follows the signer (D46) — never the community, never a\ncross-listing.",
                        "type": "string"
                    },
                    "publish_attempted_at": {
                        "description": "Informational only (D63 (C)): what the relay said when a publish was\nrefused, so the studio can show it beside a Retry. No sweep, no revert\nand no deposit path reads these. The deposit is final once the upload\nsucceeds; a refused publish is retried on the same row at no extra cost.",
                        "type": "string"
                    },
                    "publish_reject_reason": {
                        "type": "string"
                    },
                    "published_at": {
                        "description": "PublishedAt is stamped only after the API has READ the 34139 off the\nWavlake relay itself — never on the client's word.",
                        "type": "string"
                    },
                    "purchase_price_cents": {
                        "description": "PurchasePriceCents is the buy-to-own price of the WHOLE release in whole\nUS cents (D147, migration 000112); nil = not for sale. Only a release of\ntwo or more tracks carries one — a single's offer lives on its track.\nThe public fact is the release's [\"purchase\", \"<dollars>\", \"USD\"] tag; the\nverified release confirm refuses an event that disagrees with it.",
                        "type": "integer"
                    },
                    "source": {
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": "string"
                    },
                    "unpublished_at": {
                        "description": "UnpublishedAt is when the release was last TAKEN DOWN (#4412, migration\n000124): POST /v1/releases/unpublish clears PublishedAt, EventID and\nPurchasePriceCents and stamps it; the next publish confirm clears it.\nNil = never taken down.",
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReleaseHostingCheckout": {
                "type": "object",
                "properties": {
                    "amount_cents": {
                        "type": "integer"
                    },
                    "amount_sats": {
                        "type": "integer"
                    },
                    "charge_id": {
                        "type": "string"
                    },
                    "checkout_url": {
                        "type": "string"
                    },
                    "client_secret": {
                        "description": "ClientSecret is the inline Session's secret, for Stripe's form only:\nnever put in a URL, browser storage, a log or a cache. Empty on a hosted\nSession.",
                        "type": "string"
                    },
                    "expires_at": {
                        "description": "ExpiresAt is when the invoice, or an inline card Session, runs out.",
                        "type": "string"
                    },
                    "invoice_bolt11": {
                        "description": "Lightning.",
                        "type": "string"
                    },
                    "method": {
                        "type": "string"
                    },
                    "payment_id": {
                        "description": "PaymentID is the payment's id, shown in the hosting history.",
                        "type": "string"
                    },
                    "presentation": {
                        "description": "Card.\nPresentation is \"inline\" or \"hosted\" (the card only): which one the\nserver made, whatever the client asked for.",
                        "type": "string"
                    },
                    "session_id": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReleaseHostingMethodPrice": {
                "type": "object",
                "properties": {
                    "amount_cents": {
                        "description": "AmountCents is what this method charges, in USD cents. Card, earnings\nand credits charge the amount due; Lightning charges it less the\ndiscount.",
                        "type": "integer"
                    },
                    "discount_bps": {
                        "description": "DiscountBps is the discount this method applies, in basis points\n(2000 = 20 %). Present on Lightning only, and only when non-zero.",
                        "type": "integer"
                    },
                    "method": {
                        "description": "Method is \"stripe\" (card), \"earnings\", \"credits\" or \"lightning\".",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReleaseHostingPaymentInProgress": {
                "type": "object",
                "properties": {
                    "invoice_expires_at": {
                        "description": "InvoiceExpiresAt is when the open invoice runs out (RFC3339). It may\nalready have passed: for up to a minute afterwards the API still waits\nto hear that the invoice closed unpaid, and refuses the same way.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ReleaseHostingQuote": {
                "type": "object",
                "properties": {
                    "amount_due_cents": {
                        "type": "integer"
                    },
                    "covered_cents": {
                        "type": "integer"
                    },
                    "methods": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ReleaseHostingMethodPrice"
                        }
                    },
                    "paid": {
                        "type": "boolean"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "release_d_tag": {
                        "type": "string"
                    },
                    "track_count": {
                        "type": "integer"
                    },
                    "waived": {
                        "description": "Waived: a founder gave this person free hosting (D174), so the release\nowes nothing; WaivedCents is what it would have cost. Publishing still\ngoes through a checkout, for $0, which records the grant's use.",
                        "type": "boolean"
                    },
                    "waived_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RssFeedOwnerEmailRequest": {
                "type": "object",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RssFeedSetting": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "updated_at": {
                        "description": "UpdatedAt is the server's RFC3339 stamp for the last change.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RssFeedSettingsAccountRequest": {
                "type": "object",
                "required": [
                    "enabled"
                ],
                "properties": {
                    "enabled": {
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RssFeedSettingsOverrideRequest": {
                "type": "object",
                "required": [
                    "enabled"
                ],
                "properties": {
                    "enabled": {
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.RssFeedSettingsResponse": {
                "type": "object",
                "properties": {
                    "account": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSetting"
                    },
                    "overrides": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RssFeedSetting"
                        }
                    },
                    "owner_email": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduleAlbumRequest": {
                "type": "object",
                "required": [
                    "album_content_id",
                    "album_d_tag",
                    "album_signed_event",
                    "scheduled_at",
                    "tracks"
                ],
                "properties": {
                    "album_content_id": {
                        "description": "AlbumContentID is a caller-supplied UUID for the new album row.",
                        "type": "string"
                    },
                    "album_d_tag": {
                        "description": "AlbumDTag is the d-tag of the signed album event. Stored on the parent\nrow so validation does not need a JOIN.",
                        "type": "string"
                    },
                    "album_signed_event": {
                        "description": "AlbumSignedEvent is the pre-signed Kind 34139 album event. Required.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "notify_email": {
                        "description": "NotifyEmail is the optional email to notify when the group publishes.",
                        "type": "string"
                    },
                    "notify_on_publish": {
                        "description": "NotifyOnPublish enables/disables the email hook (default: true).",
                        "type": "boolean"
                    },
                    "relay_urls": {
                        "description": "RelayURLs applies to the entire group (parent + children): relays written\nas well as the platform's, which are always written.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheduled_at": {
                        "description": "ScheduledAt is the UTC timestamp when the album (and all child tracks)\nshould be published. Must be at least 15 minutes in the future.",
                        "type": "string"
                    },
                    "timezone": {
                        "description": "Timezone is the user's timezone for display purposes.",
                        "type": "string"
                    },
                    "tracks": {
                        "description": "Tracks is the ordered list of child tracks. All tracks must be owned by\nthe authenticated artist and carry their own signed Kind 36787 event.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledAlbumTrack"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduleAlbumResponse": {
                "type": "object",
                "properties": {
                    "album_content_id": {
                        "description": "AlbumContentID mirrors the request's AlbumContentID for caller convenience.",
                        "type": "string"
                    },
                    "album_release_id": {
                        "description": "AlbumReleaseID is the parent row's ID.",
                        "type": "integer"
                    },
                    "created_at": {
                        "description": "CreatedAt is the group's creation timestamp.",
                        "type": "string"
                    },
                    "scheduled_at": {
                        "description": "ScheduledAt is the group's scheduled publish time.",
                        "type": "string"
                    },
                    "status": {
                        "description": "Status is the initial status (always \"pending\" immediately after create).",
                        "type": "string"
                    },
                    "track_release_ids": {
                        "description": "TrackReleaseIDs lists the child track row IDs, ordered the same as the\nrequest's Tracks array.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduleReleaseRequest": {
                "type": "object",
                "required": [
                    "scheduled_at",
                    "signed_event"
                ],
                "properties": {
                    "notify_email": {
                        "description": "NotifyEmail is the optional email to notify when published",
                        "type": "string"
                    },
                    "notify_on_publish": {
                        "description": "NotifyOnPublish enables/disables email notification (default: true)",
                        "type": "boolean"
                    },
                    "relay_urls": {
                        "description": "RelayURLs are relays written as well as the platform's, which are always\nwritten (SCHEDULED_PUBLISHER_RELAY_URLS). Only a platform relay counts as\npublished.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheduled_at": {
                        "description": "ScheduledAt is the UTC timestamp when the content should be published\nMust be at least 15 minutes in the future",
                        "type": "string"
                    },
                    "signed_event": {
                        "description": "SignedEvent is the pre-signed Nostr event JSON. Required.\nSee scheduled_release_service.validateSignedEvent for acceptance rules.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "timezone": {
                        "description": "Timezone is the user's timezone for display purposes (not stored, for validation)",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduleReleaseResponse": {
                "type": "object",
                "properties": {
                    "content_id": {
                        "type": "string"
                    },
                    "content_type": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "notify_email": {
                        "type": "string"
                    },
                    "scheduled_at": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduledAlbumTrack": {
                "type": "object",
                "required": [
                    "signed_event",
                    "track_d_tag"
                ],
                "properties": {
                    "signed_event": {
                        "description": "SignedEvent is the pre-signed Kind 36787 track event.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "track_d_tag": {
                        "description": "TrackDTag is the Nostr d-tag identifier for this track. The backend\nresolves this to nostr_content.id (owned by the authenticated artist)\nbefore inserting the scheduled_releases row.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduledRelease": {
                "type": "object",
                "properties": {
                    "artist_pubkey": {
                        "description": "Hex pubkey",
                        "type": "string"
                    },
                    "broadcasting_at": {
                        "type": "string"
                    },
                    "content_id": {
                        "description": "UUID of the track/album",
                        "type": "string"
                    },
                    "content_type": {
                        "description": "track | album",
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "error_message": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "last_publish_error": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "NostrDTag is the denormalized d-tag stored on the row itself. Required\nfor album parent rows (no nostr_albums table); optional for track rows\nwhich can still JOIN against nostr_content.nostr_d_tag.",
                        "type": "string"
                    },
                    "notify_email": {
                        "type": "string"
                    },
                    "notify_on_publish": {
                        "type": "boolean"
                    },
                    "parent_release_id": {
                        "description": "Phase 2: album-group fields (migration 000038)\nParentReleaseID is the parent album row's ID for child track rows. NULL\nfor standalone releases and for the parent of a group.",
                        "type": "integer"
                    },
                    "publish_attempts": {
                        "type": "integer"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "relay_urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheduled_at": {
                        "description": "When to publish (UTC)",
                        "type": "string"
                    },
                    "signed_event": {
                        "description": "Phase 1: backend-broadcast fields (migration 000037)",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "status": {
                        "description": "pending | broadcasting | published | failed | cancelled",
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduledReleaseDetail": {
                "type": "object",
                "properties": {
                    "broadcasting_at": {
                        "type": "string"
                    },
                    "community_id": {
                        "type": "string"
                    },
                    "content_id": {
                        "type": "string"
                    },
                    "content_type": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "error_message": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "last_publish_error": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "notify_email": {
                        "type": "string"
                    },
                    "parent_release_id": {
                        "type": "integer"
                    },
                    "publish_attempts": {
                        "type": "integer"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "relay_urls": {
                        "description": "RelayURLs are relays written as well as the platform's, which are always\nwritten.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheduled_at": {
                        "type": "string"
                    },
                    "signed_event": {
                        "description": "SignedEvent is the stored Nostr event the backend will broadcast at\nscheduled_at. The frontend uses this as the source of kind/tags/content\nwhen re-signing for a reschedule (only created_at changes).",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduledReleaseItem": {
                "type": "object",
                "properties": {
                    "broadcasting_at": {
                        "type": "string"
                    },
                    "community_id": {
                        "description": "CommunityID carries the row's home community id so the catalog UI can\nrender the community name/avatar on scheduled rows — it resolves that from\nthe definition on the relay (D71: the API holds no copy). Sourced from\nnostr_content.community_id via LEFT JOIN; nil for album parent rows (no\nnostr_content match) and for wave-1 rows uploaded before the re-key.",
                        "type": "string"
                    },
                    "content_id": {
                        "type": "string"
                    },
                    "content_type": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "error_message": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "last_publish_error": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "For Nostr lookup",
                        "type": "string"
                    },
                    "notify_email": {
                        "type": "string"
                    },
                    "parent_release_id": {
                        "description": "Phase 2: non-nil when this row is a child of an album group.",
                        "type": "integer"
                    },
                    "publish_attempts": {
                        "type": "integer"
                    },
                    "published_at": {
                        "type": "string"
                    },
                    "scheduled_at": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.ScheduledReleasesListResponse": {
                "type": "object",
                "properties": {
                    "releases": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ScheduledReleaseItem"
                        }
                    },
                    "total_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SharedEarnings": {
                "type": "object",
                "properties": {
                    "earnings": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CommunityCurrencyEarnings"
                        }
                    },
                    "stream_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationOpenRequest": {
                "type": "object",
                "properties": {
                    "purpose": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationOpened": {
                "type": "object",
                "properties": {
                    "expires_at": {
                        "description": "ExpiresAt is when the request stops waiting for the link (RFC 3339).",
                        "type": "string"
                    },
                    "id": {
                        "description": "ID rides the emailed link and names the request on the move. 64 hex\ncharacters, random.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationRequest": {
                "type": "object",
                "required": [
                    "id"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationState": {
                "type": "string",
                "enum": [
                    "pending",
                    "confirmed",
                    "used",
                    "expired"
                ],
                "x-enum-varnames": [
                    "SignInConfirmationPending",
                    "SignInConfirmationConfirmed",
                    "SignInConfirmationUsed",
                    "SignInConfirmationExpired"
                ]
            },
            "github_com_wavlake_monorepo_internal_models.SignInConfirmationStatus": {
                "type": "object",
                "properties": {
                    "expires_at": {
                        "description": "ExpiresAt is when the request stops waiting for the link (RFC 3339).",
                        "type": "string"
                    },
                    "state": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SignInConfirmationState"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SpendingStatus": {
                "type": "object",
                "properties": {
                    "cap_credits": {
                        "type": "integer"
                    },
                    "cap_reached": {
                        "type": "boolean"
                    },
                    "free_tier_stream_count": {
                        "type": "integer"
                    },
                    "mtd_spent_credits": {
                        "type": "integer"
                    },
                    "paid_stream_count": {
                        "type": "integer"
                    },
                    "today_spent_credits": {
                        "type": "integer"
                    },
                    "total_spent_credits": {
                        "type": "integer"
                    },
                    "ytd_spent_credits": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SplitInviteClaimResult": {
                "type": "object",
                "properties": {
                    "invites": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.ClaimedSplitInvite"
                        }
                    },
                    "total_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SplitInviteResendResponse": {
                "type": "object",
                "properties": {
                    "sent": {
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SplitRecipient": {
                "type": "object",
                "properties": {
                    "claimed_pubkey": {
                        "description": "ClaimedPubkey is the key that accepted a claimed invite, so the studio\ncan name it in the public zap tags. Empty until then: an invite never\nsays whether its email has an account.",
                        "type": "string"
                    },
                    "email": {
                        "description": "Email is an invite's address, lower-cased and trimmed; empty on a key.",
                        "type": "string"
                    },
                    "held_cents": {
                        "type": "integer"
                    },
                    "invite_emailed": {
                        "description": "InviteEmailed: the invite's email has gone out at least once. A legacy\nmigration's invites have not, until the artist sends them (Phase 4).",
                        "type": "boolean"
                    },
                    "invite_id": {
                        "description": "The invite behind an email recipient, in an answer: its id, where it\nstands (a SplitInvite* constant) and the whole cents held for it.",
                        "type": "string"
                    },
                    "invite_status": {
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "Pubkey is the recipient's key; empty on an invite.",
                        "type": "string"
                    },
                    "returned_cents": {
                        "description": "ReturnedCents, on a pending invite, is what this artist's earlier\ninvite for the same email returned to them from plays and membership\npayouts when it expired: when this one is claimed it moves on to the\ninvitee, as far as the artist's available balance then covers it, never\nas debt. A sale's share returned at an expiry stays the artist's.",
                        "type": "integer"
                    },
                    "role": {
                        "description": "Role is one of the Role* constants. The owner defaults to RoleArtist,\neveryone else to RoleCollaborator.",
                        "type": "string"
                    },
                    "weight": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreAddress": {
                "type": "object",
                "properties": {
                    "city": {
                        "type": "string"
                    },
                    "country": {
                        "type": "string"
                    },
                    "line1": {
                        "type": "string"
                    },
                    "line2": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "postal_code": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreCardPayment": {
                "type": "object",
                "properties": {
                    "client_secret": {
                        "type": "string"
                    },
                    "expires_at": {
                        "type": "string"
                    },
                    "session_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreCartItem": {
                "type": "object",
                "properties": {
                    "product_id": {
                        "type": "string"
                    },
                    "quantity": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreChannelProduct": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "in_stock": {
                        "type": "boolean"
                    },
                    "listed_at": {
                        "type": "string"
                    },
                    "listing_event_id": {
                        "type": "string"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "product_id": {
                        "type": "string"
                    },
                    "seller_pubkey": {
                        "type": "string"
                    },
                    "shipping_alone_cents": {
                        "type": "integer"
                    },
                    "shipping_each_extra_cents": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreChannelProductsResponse": {
                "type": "object",
                "properties": {
                    "products": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreChannelProduct"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreCheckoutRequest": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreCartItem"
                        }
                    },
                    "payment_method": {
                        "type": "string"
                    },
                    "request_id": {
                        "type": "string"
                    },
                    "return_origin": {
                        "type": "string"
                    },
                    "ship_to": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreAddress"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreListRequest": {
                "type": "object",
                "properties": {
                    "event": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSignedEvent"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreOrder": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "disputed_cents": {
                        "description": "DisputedCents is what a chargeback for LESS than what was left of the\norder took (#5075): Status stays paid for the rest. Zero with no\nchargeback, on one that reversed everything left (Status reversed) and\nonce it is won.",
                        "type": "integer"
                    },
                    "fulfilment": {
                        "type": "string"
                    },
                    "hold_expires_at": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "lines": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderLine"
                        }
                    },
                    "paid_at": {
                        "type": "string"
                    },
                    "payment_method": {
                        "description": "PaymentMethod is how the order was paid, card or credits: absent until\nit is paid, and kept once it is refunded or reversed. A refund goes back\nthe way the order was paid (a credits order's to the buyer's credits).",
                        "type": "string"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "refunded_cents": {
                        "description": "RefundedCents is what went back to the buyer so far, to their card or\n(an order paid with credits) their credits (Phase 5); a partial refund\nleaves Status paid.",
                        "type": "integer"
                    },
                    "seller_pubkey": {
                        "type": "string"
                    },
                    "shipment": {
                        "description": "Shipment is the artist's parcel, once the order shipped.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreShipment"
                            }
                        ]
                    },
                    "shipping_cents": {
                        "type": "integer"
                    },
                    "shipping_tax_cents": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "tax_cents": {
                        "type": "integer"
                    },
                    "total_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreOrderLine": {
                "type": "object",
                "properties": {
                    "amount_cents": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "string"
                    },
                    "product_id": {
                        "type": "string"
                    },
                    "quantity": {
                        "type": "integer"
                    },
                    "refunded_quantity": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "unit_price_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreOrderResponse": {
                "type": "object",
                "properties": {
                    "order": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrder"
                    },
                    "payment": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreCardPayment"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreProduct": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "channel_id": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "image_urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "listed_at": {
                        "type": "string"
                    },
                    "listing_event_id": {
                        "type": "string"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "seller_pubkey": {
                        "type": "string"
                    },
                    "shipping_alone_cents": {
                        "type": "integer"
                    },
                    "shipping_each_extra_cents": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "stock": {
                        "type": "integer"
                    },
                    "summary": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreProductRequest": {
                "type": "object",
                "properties": {
                    "category": {
                        "type": "string"
                    },
                    "channel_id": {
                        "description": "the channel it shows on, 32 hex; a draft may leave it empty",
                        "type": "string"
                    },
                    "image_urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "shipping_alone_cents": {
                        "type": "integer"
                    },
                    "shipping_each_extra_cents": {
                        "type": "integer"
                    },
                    "stock": {
                        "type": "integer"
                    },
                    "summary": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreProductsResponse": {
                "type": "object",
                "properties": {
                    "products": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreProduct"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreQuote": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "lines": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderLine"
                        }
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "seller_pubkey": {
                        "type": "string"
                    },
                    "shipping_cents": {
                        "type": "integer"
                    },
                    "shipping_tax_cents": {
                        "type": "integer"
                    },
                    "tax_cents": {
                        "type": "integer"
                    },
                    "total_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreQuoteRequest": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreCartItem"
                        }
                    },
                    "ship_to": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreAddress"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerCancelResponse": {
                "type": "object",
                "properties": {
                    "order": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrder"
                    },
                    "refund_cents": {
                        "type": "integer"
                    },
                    "replayed": {
                        "type": "boolean"
                    },
                    "ship_to": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreAddress"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerOrder": {
                "type": "object",
                "properties": {
                    "cancelling": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "dispute": {
                        "type": "string"
                    },
                    "disputed_cents": {
                        "type": "integer"
                    },
                    "earned_at": {
                        "type": "string"
                    },
                    "fee_millicents": {
                        "type": "integer"
                    },
                    "fee_owed_millicents": {
                        "type": "integer"
                    },
                    "fulfilment": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "lines": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreOrderLine"
                        }
                    },
                    "paid_at": {
                        "type": "string"
                    },
                    "price_cents": {
                        "type": "integer"
                    },
                    "refunded_cents": {
                        "description": "Phase 5. RefundedCents is what went back to the buyer's card so far (a\npartial refund leaves Status paid). ShareTakenMillicents is what refunds\nand a chargeback took back from the artist's share, ShareOwedMillicents\nwhat their balance could not give (recorded, never collected); both\nMILLI-units. FeeOwedMillicents is the fee Wavlake keeps on the order's\nchargeback, owed by the seller on top of the share, whether or not the\norder had shipped (recorded, never taken from their balance; zero again\nonce the chargeback is won, and never set by a refund); MILLI-units too. Dispute is the order's chargeback: open, won or lost, absent\nwhen there is none. DisputedCents is what a chargeback for LESS than\nwhat was left took, in cents: Status stays paid for the rest (zero on a\nchargeback of everything left, where Status is reversed, and once it is\nwon). ShipStopped means a chargeback, a refused late\nrefund (#5075) or the artist's cancel stopped the shipment: don't ship.\nCancelling (#5356) means the artist asked to cancel it and its refund\nmay still be on its way: asking again finishes it.",
                        "type": "integer"
                    },
                    "share_held_until": {
                        "type": "string"
                    },
                    "share_millicents": {
                        "type": "integer"
                    },
                    "share_owed_millicents": {
                        "type": "integer"
                    },
                    "share_taken_millicents": {
                        "type": "integer"
                    },
                    "ship_stopped": {
                        "type": "boolean"
                    },
                    "shipment": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreShipment"
                    },
                    "shipping_cents": {
                        "type": "integer"
                    },
                    "shipping_tax_cents": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "tax_cents": {
                        "type": "integer"
                    },
                    "total_cents": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerOrderResponse": {
                "type": "object",
                "properties": {
                    "order": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrder"
                    },
                    "ship_to": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreAddress"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerOrdersResponse": {
                "type": "object",
                "properties": {
                    "orders": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerOrder"
                        }
                    },
                    "to_ship": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerRequestState": {
                "type": "object",
                "properties": {
                    "decided_at": {
                        "description": "DecidedAt is when the Wavlake team said no (RFC 3339); absent while\npending.",
                        "type": "string"
                    },
                    "requested_at": {
                        "description": "RequestedAt is when the key asked (RFC 3339).",
                        "type": "string"
                    },
                    "status": {
                        "description": "Status is \"pending\" or \"denied\".",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSellerResponse": {
                "type": "object",
                "properties": {
                    "can_sell": {
                        "type": "boolean"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "request": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.StoreSellerRequestState"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreShipRequest": {
                "type": "object",
                "properties": {
                    "carrier": {
                        "type": "string"
                    },
                    "tracking_number": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreShipment": {
                "type": "object",
                "properties": {
                    "carrier": {
                        "type": "string"
                    },
                    "shipped_at": {
                        "type": "string"
                    },
                    "tracking_number": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreSignedEvent": {
                "type": "object",
                "properties": {
                    "content": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "sig": {
                        "type": "string"
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StoreStatusResponse": {
                "type": "object",
                "properties": {
                    "credits_enabled": {
                        "description": "CreditsEnabled is whether an order can be paid with credits here\n(STORE_CREDITS_ENABLED): a client offers that way to pay only when it is\ntrue. CreditsMaxCents is the largest order total credits can pay, in\ncents; absent when credits are off.",
                        "type": "boolean"
                    },
                    "credits_max_cents": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "ships_to": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StreamStats": {
                "type": "object",
                "properties": {
                    "free_access": {
                        "description": "Free content streams",
                        "type": "integer"
                    },
                    "free_tier": {
                        "description": "Cap-reached streams (NIP-98 users at $10 limit)",
                        "type": "integer"
                    },
                    "honor_paid": {
                        "description": "Honor mode with payment",
                        "type": "integer"
                    },
                    "honor_unpaid": {
                        "description": "Honor mode without payment",
                        "type": "integer"
                    },
                    "paid": {
                        "description": "Paywall streams (ecash/lightning)",
                        "type": "integer"
                    },
                    "total": {
                        "description": "Sum of all stream types",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StreamsResponse": {
                "type": "object",
                "properties": {
                    "streams": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.RecentStream"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.StripeConnectInfo": {
                "type": "object",
                "properties": {
                    "charges_enabled": {
                        "type": "boolean"
                    },
                    "country": {
                        "type": "string"
                    },
                    "payouts_enabled": {
                        "type": "boolean"
                    },
                    "requirements_currently_due": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "resume_url": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SupportAskRequest": {
                "type": "object",
                "properties": {
                    "conversation": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SupportMessage"
                        }
                    },
                    "page": {
                        "type": "string"
                    },
                    "question": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SupportAskResponse": {
                "type": "object",
                "properties": {
                    "answer": {
                        "description": "Answer is the bot's reply, with known secret shapes removed. Empty when\nDeclined.",
                        "type": "string"
                    },
                    "declined": {
                        "description": "Declined is true when the provider declined to answer: the client\noffers Contact support instead of an answer.",
                        "type": "boolean"
                    },
                    "lookup": {
                        "description": "Lookup is true when the answer is the plain article lookup (#5742,\nSUPPORT_BOT_LOOKUP_ONLY), not the provider's: Answer is then only the\nmatching articles' titles and links, one Markdown link a line, in the\norder of Sources, or the fixed line when none matches. No provider was\ncalled and the question was not counted.",
                        "type": "boolean"
                    },
                    "remaining_today": {
                        "type": "integer"
                    },
                    "renews_at": {
                        "description": "RenewsAt is the next UTC midnight, RFC 3339.",
                        "type": "string"
                    },
                    "sources": {
                        "description": "Sources are the ids of the published help articles the answer links, in\nthe order it first links them.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SupportCapabilityResponse": {
                "type": "object",
                "properties": {
                    "available": {
                        "description": "Available is true when the switch is on, the caller is on the\nallowlist and a provider is configured.",
                        "type": "boolean"
                    },
                    "daily_limit": {
                        "description": "DailyLimit is the questions an account may ask per UTC day.",
                        "type": "integer"
                    },
                    "remaining_today": {
                        "description": "RemainingToday is what the account has left today (0 when unavailable).",
                        "type": "integer"
                    },
                    "renews_at": {
                        "description": "RenewsAt is the next UTC midnight, RFC 3339.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SupportMessage": {
                "type": "object",
                "properties": {
                    "role": {
                        "description": "Role is \"user\" or \"assistant\".",
                        "type": "string"
                    },
                    "text": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.SwapPrimaryRefusedDetails": {
                "type": "object",
                "properties": {
                    "reasons": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TipDestinationHealth": {
                "type": "object",
                "properties": {
                    "checked_at": {
                        "type": "string"
                    },
                    "max_sendable_msat": {
                        "type": "integer"
                    },
                    "min_sendable_msat": {
                        "type": "integer"
                    },
                    "reason": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TipDestinationResponse": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "health": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TipDestinationHealth"
                    },
                    "payable": {
                        "type": "boolean"
                    },
                    "state": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TrackEarnings": {
                "type": "object",
                "properties": {
                    "average_tip_credits": {
                        "type": "number"
                    },
                    "base_revenue_credits": {
                        "type": "integer"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "owner_plays": {
                        "description": "OwnerPlays is how many of StreamCount were plays by listeners who\nbought the track (design §9.4) — a count, never money. Absent = 0.",
                        "type": "integer"
                    },
                    "owner_pubkey": {
                        "description": "OwnerPubkey is the track's owner (hex), the way the royalty engine picks\nit: the live content row first, then the newest. The signer is public on\nthe relay already.",
                        "type": "string"
                    },
                    "sales_count": {
                        "description": "SalesCount is how many buy-to-own orders included this track (an album\nsale counts once for each of its tracks); SalesGrossCents is this\ntrack's share of their gross (its purchase legs). Never streams.\nBoth are absent when zero (additive fields; absent = 0).",
                        "type": "integer"
                    },
                    "sales_gross_cents": {
                        "type": "integer"
                    },
                    "shared": {
                        "description": "Shared is true when the caller is not the owner: another artist's track\nthat paid the caller a share.",
                        "type": "boolean"
                    },
                    "stream_count": {
                        "type": "integer"
                    },
                    "tips_credits": {
                        "type": "integer"
                    },
                    "track_title": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TrackReadinessFailure": {
                "type": "object",
                "properties": {
                    "error_code": {
                        "type": "string"
                    },
                    "error_detail": {
                        "type": "string"
                    },
                    "legacy_id": {
                        "type": "string"
                    },
                    "retryable": {
                        "type": "boolean"
                    },
                    "track_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TrackReadinessRequest": {
                "type": "object",
                "required": [
                    "track_ids"
                ],
                "properties": {
                    "track_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TrackReadinessResponse": {
                "type": "object",
                "properties": {
                    "failed": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TrackReadinessFailure"
                        }
                    },
                    "last_progress_at": {
                        "description": "LastProgressAt is the most recent worker activity timestamp across\nthe batch (max(nostr_content.updated_at) of migration rows still\nin-flight). Null when no migration rows are in-flight (e.g., all\nready/failed, or batch has no migration rows). UI consumers compare\nagainst Date.now() to detect stalls.",
                        "type": "string"
                    },
                    "pending_count": {
                        "type": "integer"
                    },
                    "ready_count": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.TrackSplit": {
                "type": "object",
                "properties": {
                    "recipients": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SplitRecipient"
                        }
                    },
                    "source": {
                        "description": "Source is where the record was first made (SplitSourceStudio or\nSplitSourceLegacyMigration); empty when there is no split.",
                        "type": "string"
                    },
                    "subject": {
                        "description": "Subject is the track's coordinate, \"<track-kind>:<owner>:<d-tag>\", the\nd-tag verbatim (it may contain ':').",
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    },
                    "version": {
                        "description": "Version counts changes to the recipients, from 1; 0 = no split.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.UpdateContentRequest": {
                "type": "object",
                "required": [
                    "access_mode"
                ],
                "properties": {
                    "access_mode": {
                        "description": "Required: free, honor, or paywall",
                        "type": "string",
                        "enum": [
                            "free",
                            "honor",
                            "paywall"
                        ]
                    },
                    "price_credits": {
                        "description": "Required for honor/paywall modes (in credits)",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.UpdatePayoutPreferencesRequest": {
                "type": "object",
                "properties": {
                    "default_payout_destination": {
                        "type": "string"
                    },
                    "default_payout_method": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.UpdateScheduleRequest": {
                "type": "object",
                "properties": {
                    "notify_email": {
                        "type": "string"
                    },
                    "notify_on_publish": {
                        "type": "boolean"
                    },
                    "relay_urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheduled_at": {
                        "type": "string"
                    },
                    "signed_event": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_models.UserEarningsCommunitiesResponse": {
                "type": "object",
                "properties": {
                    "communities": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.CommunityEarnings"
                        }
                    },
                    "period_end": {
                        "description": "YYYY-MM-DD (exclusive upper bound in service layer)",
                        "type": "string"
                    },
                    "period_start": {
                        "description": "YYYY-MM-DD",
                        "type": "string"
                    },
                    "shared_with_you": {
                        "description": "SharedWithYou is what tracks other artists shared with the caller paid\nthem in the range, whatever channel those tracks are in. Absent when\nnothing shared paid them in the range.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.SharedEarnings"
                            }
                        ]
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.AggSide": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer"
                    },
                    "sum_amount": {
                        "type": "integer"
                    },
                    "sum_fee_millis": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.AggregateRow": {
                "type": "object",
                "properties": {
                    "amount_delta": {
                        "type": "integer"
                    },
                    "count_delta": {
                        "type": "integer"
                    },
                    "db": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.AggSide"
                    },
                    "fee_millis_delta": {
                        "type": "integer"
                    },
                    "relay": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.AggSide"
                    },
                    "stream_type": {
                        "type": "string"
                    },
                    "unit": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegIssue": {
                "type": "object",
                "properties": {
                    "detail": {
                        "type": "string"
                    },
                    "distribution_id": {
                        "type": "integer"
                    },
                    "event_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegReport": {
                "type": "object",
                "properties": {
                    "amount_mismatches": {
                        "description": "event present, amount tag ≠ amount_credits",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegIssue"
                        }
                    },
                    "db_distributions": {
                        "type": "integer"
                    },
                    "found_on_relay": {
                        "type": "integer"
                    },
                    "missing_event_id": {
                        "description": "publish failed or receipts OFF at distribution time",
                        "type": "integer"
                    },
                    "missing_on_relay": {
                        "description": "id recorded but event absent (relay gap/retention)",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegIssue"
                        }
                    },
                    "with_event_id": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.GrantAmountIssue": {
                "type": "object",
                "properties": {
                    "detail": {
                        "type": "string"
                    },
                    "direction": {
                        "type": "string"
                    },
                    "entry_amount": {
                        "type": "integer"
                    },
                    "entry_id": {
                        "type": "integer"
                    },
                    "entry_present": {
                        "type": "boolean"
                    },
                    "grant_amount": {
                        "description": "GrantAmount / EntryAmount are whole cents. A missing side reports 0 and\nsets the matching *Present flag false — 0 alone would read as \"granted\nnothing\", which is a different finding.",
                        "type": "integer"
                    },
                    "grant_id": {
                        "type": "integer"
                    },
                    "grant_present": {
                        "type": "boolean"
                    },
                    "grant_status": {
                        "type": "string"
                    },
                    "stripe_invoice_id": {
                        "description": "StripeInvoiceID is the join key on both sides (grant.stripe_invoice_id ==\nentry.source_ref == entry.cycle_ref).",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.GrantReport": {
                "type": "object",
                "properties": {
                    "amount_mismatches": {
                        "description": "AmountMismatches holds BOTH directions; read Direction on each entry.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.GrantAmountIssue"
                        }
                    },
                    "drift_count": {
                        "description": "DriftCount totals everything that deserves a human look: every amount\ndisagreement, every missed invoice, and every `unissuable` grant in the\nwindow (a paid invoice that produced no credits — deliberate, but still\nworth an operator's eyes).",
                        "type": "integer"
                    },
                    "missed_invoices": {
                        "description": "MissedInvoices is un-windowed by design.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.MissedInvoice"
                        }
                    },
                    "since": {
                        "type": "string"
                    },
                    "status_counts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.GrantStatusCount"
                        }
                    },
                    "truncated": {
                        "description": "Truncated is set when any findings list hit IssueLimit.",
                        "type": "boolean"
                    },
                    "until": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.GrantStatusCount": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "sum_amount": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.MissedInvoice": {
                "type": "object",
                "properties": {
                    "current_period_end": {
                        "type": "string"
                    },
                    "elapsed_seconds": {
                        "type": "integer"
                    },
                    "grant_count": {
                        "type": "integer"
                    },
                    "latest_grant_cycle_end": {
                        "type": "string"
                    },
                    "stripe_subscription_id": {
                        "type": "string"
                    },
                    "subscription_id": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.Report": {
                "type": "object",
                "properties": {
                    "aggregates": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.AggregateRow"
                        }
                    },
                    "drift_count": {
                        "description": "DriftCount totals everything that deserves a human look: aggregate rows\nwith any non-zero delta, every exact-leg issue class, and every shared\nplay.",
                        "type": "integer"
                    },
                    "eom": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegReport"
                    },
                    "generous": {
                        "description": "Generous is the exact leg over generous_distribution_legs (Phase 5).\n\nIT IS NOT OPTIONAL COVERAGE. The two generous stream types are excluded\nfrom the AGGREGATE leg above — correctly, since they are not playbacks —\nso without this section a leg that pays an artist and publishes no receipt\nwould be checked by NOTHING, and the report would read clean having never\nlooked. That is strictly worse than reported drift.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.ExactLegReport"
                            }
                        ]
                    },
                    "malformed_events": {
                        "type": "integer"
                    },
                    "relay_events": {
                        "type": "integer"
                    },
                    "relay_url": {
                        "type": "string"
                    },
                    "service_pubkey": {
                        "type": "string"
                    },
                    "shared_plays": {
                        "description": "SharedPlays lists every set of two or more receipts in the window that\nsettle ONE play: the same `a` and the same `leg` (#4643). One play is\none receipt, so each entry is drift. Never null.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_receiptreconcile.SharedPlay"
                        }
                    },
                    "since": {
                        "type": "string"
                    },
                    "truncated": {
                        "description": "Truncated is true when pagination hit MaxPages or a same-second wall\n(more same-timestamp events than one page holds) — relay-side totals are\nthen a lower bound, not a census.",
                        "type": "boolean"
                    },
                    "until": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_receiptreconcile.SharedPlay": {
                "type": "object",
                "properties": {
                    "a": {
                        "type": "string"
                    },
                    "event_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "leg": {
                        "type": "string"
                    },
                    "payers": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.AcceptedMethod": {
                "type": "object",
                "properties": {
                    "auth": {
                        "description": "Auth is the authentication scheme Endpoint requires (\"nip98\").",
                        "type": "string"
                    },
                    "endpoint": {
                        "description": "Endpoint is the path the client submits the payment to, with `{dtag}` left\nas a literal placeholder the client substitutes.",
                        "type": "string"
                    },
                    "method": {
                        "description": "Method is the rail identifier — one of the AcceptedMethod* constants.\nNOTE: these are WIRE names and are deliberately not the same vocabulary as\nmodels.PaymentMethod* (the stream_events column values). \"ledger_debit\"\nnames an action a client performs; \"ledger\" names how a settled stream was\npaid for.",
                        "type": "string"
                    },
                    "price_sats": {
                        "description": "PriceSats is set only on rails whose cost is Lightning-denominated (l402).\nCredit-denominated rails carry the cost in PaymentDetail.PriceCredits.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.ErrorDetailsResponse": {
                "type": "object",
                "properties": {
                    "details": {},
                    "error": {
                        "type": "string"
                    },
                    "errorCode": {
                        "type": "string"
                    },
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.ErrorResponse": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "example": "Invalid request"
                    },
                    "errorCode": {
                        "type": "string",
                        "example": "INVALID_REQUEST"
                    },
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.PaymentDetail": {
                "type": "object",
                "properties": {
                    "accepted_methods": {
                        "description": "AcceptedMethods is the extensible, ORDERED list of rails this deployment\naccepts for the resource. Clients pick the first entry they support and\nMUST ignore entries they do not recognize (spec §2), which is what lets a\nsecond rail light up without an envelope redesign.\n\nIt supersedes the flat PaymentMethods string list on both paywall surfaces\n(audio and content). PaymentMethods survives only on the standalone L402\ndemo challenge.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.AcceptedMethod"
                        }
                    },
                    "balance_credits": {
                        "description": "BalanceCredits is the listener's current credit balance, set on\nINSUFFICIENT_BALANCE bodies so the client can route to top-up without a\nsecond round trip.\n\nPOINTER ON PURPOSE. The overwhelmingly common value here is 0 — a listener\ngets INSUFFICIENT_BALANCE precisely because they are broke — and a plain\n`int` with omitempty would silently drop the field in exactly that case,\nleaving the client unable to distinguish \"balance is zero\" from \"the server\ndid not tell me\". nil = not applicable to this branch; &0 = genuinely zero.",
                        "type": "integer"
                    },
                    "contract_version": {
                        "description": "ContractVersion is the integer version of the paywall spend contract this\nbody speaks (v1 = 1). Present on paywall-reason bodies only: the\nartist_deposit branch is not part of the spend contract and deliberately\nomits it (hence omitempty, whose zero value means \"not a spend-contract\nbody\" rather than \"version 0\").",
                        "type": "integer"
                    },
                    "currency": {
                        "description": "Currency is the credit currency (defaults to \"usd\" when omitted).",
                        "type": "string"
                    },
                    "payment_methods": {
                        "description": "PaymentMethods lists the accepted payment methods for this resource.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "price_credits": {
                        "description": "PriceCredits is the content cost in USD credits (cents) for paywall reasons.",
                        "type": "integer"
                    },
                    "price_sats": {
                        "description": "PriceSats is the content cost in sats, set on L402-rail challenges (the gated\nL402 invoice is Lightning-denominated). It is DISTINCT from PriceCredits (USD\ncents): an L402 challenge carries PriceSats; a credit-denominated paywall\ncarries PriceCredits. A dual-rail 402 may carry both. Clients must not read\nprice_credits as USD when the cost is L402/sats — read price_sats.",
                        "type": "integer"
                    },
                    "reason": {
                        "description": "Reason discriminates the payment branch: \"paywall\" | \"artist_deposit\" |\n\"release_hosting\" (the per-release hosting 402, D146).",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.PaymentErrorResponse": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string"
                    },
                    "errorCode": {
                        "type": "string"
                    },
                    "payment": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_responses.PaymentDetail"
                    },
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_responses.StandardResponse": {
                "type": "object",
                "properties": {
                    "data": {},
                    "message": {
                        "type": "string"
                    },
                    "success": {
                        "type": "boolean",
                        "example": true
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.GenerousCyclePlan": {
                "type": "object",
                "properties": {
                    "cycle_ref": {
                        "type": "string"
                    },
                    "eligible": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "legs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.GenerousLegPlan"
                        }
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "outcome": {
                        "type": "string"
                    },
                    "pooled_credits": {
                        "description": "PooledCents is the part routed to the idle pool (the whole remainder on an\nidle cycle, zero otherwise).",
                        "type": "integer"
                    },
                    "remainder_credits": {
                        "description": "RemainderCents is what was taken. On a DRY RUN this is the enumerated\nremainder and is advisory: a live run re-derives it under the balance row\nlock and may find less if the listener spent in between.",
                        "type": "integer"
                    },
                    "retained_fee_millicents": {
                        "description": "RetainedFeeMillicents / NetMillicents are MILLI-units (1/1000 cent) and\nare what the royalty engine ACTUALLY took, summed from the legs — never\n10% of gross. Zero on a dry run (the engine has not been consulted).",
                        "type": "integer"
                    },
                    "subscriber_pubkey": {
                        "type": "string"
                    },
                    "total_streams": {
                        "description": "TotalStreams is the weighting DENOMINATOR: the subscriber's paid streams\nin the window. A stream count, never a catalog size (D37/#2800).",
                        "type": "integer"
                    },
                    "window_end": {
                        "type": "string"
                    },
                    "window_start": {
                        "description": "WindowStart / WindowEnd bound the listening this allocation counted.",
                        "type": "string"
                    },
                    "withheld_reason": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.GenerousLegPlan": {
                "type": "object",
                "properties": {
                    "communityID": {
                        "type": "string"
                    },
                    "contentDTag": {
                        "type": "string"
                    },
                    "grossCents": {
                        "type": "integer"
                    },
                    "legIndex": {
                        "type": "integer"
                    },
                    "paidStreamCount": {
                        "type": "integer"
                    },
                    "recipientPubkey": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.GenerousSweepReport": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "cycles_empty": {
                        "type": "integer"
                    },
                    "cycles_examined": {
                        "type": "integer"
                    },
                    "cycles_failed": {
                        "type": "integer"
                    },
                    "cycles_idle": {
                        "type": "integer"
                    },
                    "cycles_in_progress": {
                        "description": "CyclesInProgress counts cycles another live job was already working, which\nthis job left alone (#3496). Its own counter, not folded into skipped or\nfailed: nonzero means two jobs overlapped, which an operator wants to see,\nand it is not a failure, which an alert must not be told it is.",
                        "type": "integer"
                    },
                    "cycles_skipped": {
                        "type": "integer"
                    },
                    "cycles_swept": {
                        "type": "integer"
                    },
                    "cycles_withheld": {
                        "type": "integer"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "limit": {
                        "type": "integer"
                    },
                    "plans": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.GenerousCyclePlan"
                        }
                    },
                    "tenant_id": {
                        "type": "string"
                    },
                    "total_moved_credits": {
                        "description": "TotalMovedCents is everything debited from subscriber balances this run —\nTotalSweptCents + TotalPooledCents. This is what the old\ntotal_swept_credits was accidentally reporting; kept as its own field so\nthe rename loses no information.",
                        "type": "integer"
                    },
                    "total_net_millicents": {
                        "type": "integer"
                    },
                    "total_pooled_credits": {
                        "description": "TotalPooledCents is cents routed to the platform idle pool (R21), awaiting\nthe quarterly distribution. Today a cycle is wholly pooled or wholly swept.",
                        "type": "integer"
                    },
                    "total_retained_fee_millicents": {
                        "description": "TotalRetainedFeeMillicents / TotalNetMillicents are MILLI-units (1/1000 of\na cent) and are what the royalty engine ACTUALLY took and paid, summed\nfrom the legs — never 10 % of gross (the fee is 0 % until an artist's\ndeposit is recouped, so it resolves per recipient inside one run).\n\nOPERATOR CHECK, and it is exact arithmetic on this report alone:\n\n\ttotal_swept_credits × 1000 == total_retained_fee_millicents + total_net_millicents\n\nIt holds when cycles_failed == 0 on a LIVE run. A failed cycle still\ncounts its swept cents (TX1 committed — the money did leave the listener)\nwhile only its settled legs contributed fee/net, so the identity is short\nby the unsettled remainder. On a DRY RUN both milli fields are 0 by design:\nthe royalty engine is never consulted, so there is no fee split to report.",
                        "type": "integer"
                    },
                    "total_swept_credits": {
                        "description": "TotalSweptCents is GROSS cents that reached ARTISTS, before the platform\nfee — the part of each cycle's take that was allocated to legs. Pooled\nmoney is excluded. Computed as remainder − pooled per plan rather than by\nfiltering on outcome, so a future partially-pooled cycle stays correct.",
                        "type": "integer"
                    },
                    "truncated": {
                        "description": "Truncated is true when the limit was reached, i.e. more cycles are due.\nReported so a bounded run never reads as \"there was nothing left\".",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetCounts": {
                "type": "object",
                "properties": {
                    "channels": {
                        "description": "Channels counts the run's `channel` items (runs prepared before #3946).\nThe reset KEEPS every one of those channels — its NIP-29 chain, its\nrelay-signed mirrors, its catalog set and its name rows (#5457): a\nchannel outlives the import that once made it (D173: a tester's channel\nis never deleted). See channelsKeptNote.",
                        "type": "integer"
                    },
                    "nostr_content_marked": {
                        "type": "integer"
                    },
                    "podcast_guids_released": {
                        "description": "PodcastGuidsReleased counts the podcast guid claims (music_podcast_guids)\nreleased for the rows this reset cleared (#6049). See step 5b.",
                        "type": "integer"
                    },
                    "releases_reset": {
                        "type": "integer"
                    },
                    "run_items": {
                        "type": "integer"
                    },
                    "runs": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetKindCount": {
                "type": "object",
                "properties": {
                    "d_tags": {
                        "type": "integer"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "label": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetRelayFilter": {
                "type": "object",
                "properties": {
                    "author": {
                        "type": "string"
                    },
                    "chunk": {
                        "type": "integer"
                    },
                    "d_tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "delete": {
                        "type": "string"
                    },
                    "dry_run": {
                        "type": "string"
                    },
                    "filter": {
                        "description": "Filter is the raw strfry/NIP-01 filter JSON.",
                        "type": "string"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "label": {
                        "type": "string"
                    },
                    "scan": {
                        "description": "Scan / DryRun / Delete are the three commands, in the order the takedown\nprocedure requires them to be run.",
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetRelayPlan": {
                "type": "object",
                "properties": {
                    "filters": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetRelayFilter"
                        }
                    },
                    "kind_counts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetKindCount"
                        }
                    },
                    "relay_target": {
                        "description": "RelayTarget is the environment whose relay VM the commands name\n(#4052): \"production\", \"staging\", or \"none\" when this API does not know\nwhich VM holds its events — in which case Scan / DryRun / Delete and\nSSHWrapper are EMPTY and only the filters are handed over.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetRelayTarget"
                            }
                        ]
                    },
                    "relay_vm": {
                        "description": "RelayVM is the GCE instance the commands ssh to; empty for \"none\".",
                        "type": "string"
                    },
                    "signer_pubkeys": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "ssh_wrapper": {
                        "description": "SSHWrapper shows the SHAPE of a relay invocation for ad-hoc use. Every\nfilter's Scan / DryRun / Delete is ALREADY composed into it and is ready\nto paste as-is — do not re-wrap them. Empty for RelayTarget \"none\".",
                        "type": "string"
                    },
                    "unsafe_for_shell": {
                        "description": "UnsafeForShell lists d-tags carrying a character that cannot cross the\nremote shell boundary (see migrationResetQuoteHazard). Empty in every\nexpected case; when it is not, those events must be deleted by hand and\nthe notes say so.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetRelayTarget": {
                "type": "string",
                "enum": [
                    "production",
                    "staging",
                    "qa",
                    "none"
                ],
                "x-enum-varnames": [
                    "MigrationResetRelayTargetProduction",
                    "MigrationResetRelayTargetStaging",
                    "MigrationResetRelayTargetQA",
                    "MigrationResetRelayTargetNone"
                ]
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetReport": {
                "type": "object",
                "properties": {
                    "counts": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetCounts"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "generated_at": {
                        "type": "string"
                    },
                    "notes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "relay": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetRelayPlan"
                    },
                    "runs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.MigrationResetRun"
                        }
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MigrationResetRun": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "item_count": {
                        "type": "integer"
                    },
                    "run_id": {
                        "type": "string"
                    },
                    "signer_pubkey": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.MonthlyPayoutCronResult": {
                "type": "object",
                "properties": {
                    "artists": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.PayoutCronArtistResult"
                        }
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "eligible_count": {
                        "type": "integer"
                    },
                    "failed_count": {
                        "type": "integer"
                    },
                    "method": {
                        "description": "Method is the payout method the run was limited to; empty means every\nmethod.",
                        "type": "string"
                    },
                    "ran_at": {
                        "type": "string"
                    },
                    "skipped_duplicate_count": {
                        "type": "integer"
                    },
                    "skipped_held_count": {
                        "type": "integer"
                    },
                    "skipped_lightning_hold_count": {
                        "type": "integer"
                    },
                    "skipped_rate_limited_count": {
                        "type": "integer"
                    },
                    "skipped_review_count": {
                        "type": "integer"
                    },
                    "succeeded_count": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.PayoutCronArtistResult": {
                "type": "object",
                "properties": {
                    "amount_credits": {
                        "type": "integer"
                    },
                    "artist_pubkey": {
                        "type": "string"
                    },
                    "error_message": {
                        "description": "ErrorMessage is populated when Outcome == PayoutCronOutcomeFailed.\nInternal error detail; not exposed beyond logs/admin.",
                        "type": "string"
                    },
                    "method": {
                        "type": "string"
                    },
                    "outcome": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.PayoutCronOutcome"
                    },
                    "payout_id": {
                        "description": "PayoutID is populated when Outcome == PayoutCronOutcomeSucceeded.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.PayoutCronOutcome": {
                "type": "string",
                "enum": [
                    "eligible",
                    "succeeded",
                    "skipped_duplicate",
                    "skipped_review",
                    "skipped_lightning_hold",
                    "skipped_rate_limited",
                    "skipped_held",
                    "failed"
                ],
                "x-enum-varnames": [
                    "PayoutCronOutcomeEligible",
                    "PayoutCronOutcomeSucceeded",
                    "PayoutCronOutcomeSkippedDuplicate",
                    "PayoutCronOutcomeSkippedReview",
                    "PayoutCronOutcomeSkippedLightningHold",
                    "PayoutCronOutcomeSkippedRateLimited",
                    "PayoutCronOutcomeSkippedHeld",
                    "PayoutCronOutcomeFailed"
                ]
            },
            "github_com_wavlake_monorepo_internal_services.PoolDistributionReport": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "distributed_credits": {
                        "description": "DistributedCents is what actually LEFT the pool — the sum of the payable\nlegs, never the pool total. It is the debit's amount.",
                        "type": "integer"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "legs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.GenerousLegPlan"
                        }
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "outcome": {
                        "type": "string"
                    },
                    "period_end": {
                        "type": "string"
                    },
                    "period_start": {
                        "type": "string"
                    },
                    "pool_total_credits": {
                        "description": "PoolTotalCents is the pool balance the run saw. On a DRY RUN it is read\nwithout the row lock and is advisory.",
                        "type": "integer"
                    },
                    "quarter": {
                        "type": "string"
                    },
                    "retained_fee_millicents": {
                        "description": "RetainedFeeMillicents / NetMillicents are MILLI-units (1/1000 cent) and\nare what the royalty engine ACTUALLY took, summed from the legs — NEVER\n10% of gross. Zero on a dry run (the engine has not been consulted).",
                        "type": "integer"
                    },
                    "rolled_over_credits": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    },
                    "total_streams": {
                        "description": "TotalStreams is the weighting DENOMINATOR: the platform's paid streams in\nthe quarter. A stream count, never a catalog size (D37/#2800).",
                        "type": "integer"
                    },
                    "withheld": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.PoolWithheldLeg"
                        }
                    },
                    "withheld_credits": {
                        "description": "WithheldCents is the frozen recipients' shares, which stay in the pool\n(Q4/Q5). RolledOverCents is everything that did not leave: the withheld\nshares, plus the whole pool on a no-streams quarter.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.PoolWithheldLeg": {
                "type": "object",
                "properties": {
                    "gross_credits": {
                        "type": "integer"
                    },
                    "reason": {
                        "type": "string"
                    },
                    "recipient_pubkey": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.PurchaseRedriveItem": {
                "type": "object",
                "properties": {
                    "candidates": {
                        "description": "Candidates is the order's legs in the listing; Legs is how many this\ncall settled (0 on a dry run, or when another call stamped them first).",
                        "type": "integer"
                    },
                    "error": {
                        "type": "string"
                    },
                    "legs_settled": {
                        "type": "integer"
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "outcome": {
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.PurchaseRedriveSummary": {
                "type": "object",
                "properties": {
                    "applied": {
                        "type": "integer"
                    },
                    "failed": {
                        "type": "integer"
                    },
                    "items": {
                        "description": "Items is one per order, oldest first.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.PurchaseRedriveItem"
                        }
                    },
                    "legs_settled": {
                        "type": "integer"
                    },
                    "orders": {
                        "type": "integer"
                    },
                    "truncated": {
                        "type": "boolean"
                    },
                    "unpayable": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.RoyaltyRedriveItem": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "error": {
                        "description": "Error is the error CLASS on a failed row, never the raw database text.",
                        "type": "string"
                    },
                    "fee_millicents": {
                        "description": "FeeMillicents / NetMillicents are set on RedriveOutcomeApplied only.",
                        "type": "integer"
                    },
                    "gross_smallest_unit": {
                        "type": "integer"
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "outcome": {
                        "type": "string"
                    },
                    "owed_to_pubkey": {
                        "type": "string"
                    },
                    "stream_event_id": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.RoyaltyRedriveReport": {
                "type": "object",
                "properties": {
                    "applied": {
                        "type": "integer"
                    },
                    "candidates": {
                        "type": "integer"
                    },
                    "checked_at": {
                        "type": "string"
                    },
                    "cutoff": {
                        "type": "string"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "failed": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.RoyaltyRedriveItem"
                        }
                    },
                    "purchases": {
                        "description": "Purchases is the buy-to-own block, one item per order. Nil when no\npurchase half is wired.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.PurchaseRedriveSummary"
                            }
                        ]
                    },
                    "truncated": {
                        "description": "Truncated is true when Limit cut the batch short; run again for the rest.",
                        "type": "boolean"
                    },
                    "unpayable": {
                        "description": "Unpayable counts content_missing + invalid_splits + unsupported_currency:\nrows a re-run will not fix.",
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.TrackSweepResult": {
                "type": "object",
                "properties": {
                    "bytes_deleted": {
                        "type": "integer"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "rows_expired": {
                        "description": "RowsExpired counts unpublished drafts whose audio expired this run\n(D63 as amended 2026-09-30).",
                        "type": "integer"
                    },
                    "rows_reaped": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.TrackSweepRunResult": {
                "type": "object",
                "properties": {
                    "completed_at": {
                        "type": "string"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "per_pubkey": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.TrackSweepResult"
                        }
                    },
                    "prepay_checkout_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "prepay_checkouts_completed": {
                        "type": "integer"
                    },
                    "prepay_checkouts_released": {
                        "type": "integer"
                    },
                    "prepay_checkouts_skipped": {
                        "type": "integer"
                    },
                    "prepay_dry_run": {
                        "description": "The membership prepay settlement (D162, design §4.1 step 5), the one\nquery the daily sweep gained for that feature: stale checkouts that\napplied bought credits had them given back (released), were finished\nbecause their session was paid but the completion never reached them\n(completed), or could not be settled yet (skipped). PrepaySweepError\nnames a failure in that step; the reap and the expiry above it still\nran and are reported.\nThe prepay settlement never reads the track sweep's dry_run (both\nenvironments pin that to true): it settles on every run, each step\nasking Stripe first. PrepayDryRun is its own ?prepay_dry_run=true, on\nwhich PrepayCheckoutIDs lists the rows a real run would settle.",
                        "type": "boolean"
                    },
                    "prepay_sweep_error": {
                        "type": "string"
                    },
                    "started_at": {
                        "type": "string"
                    },
                    "total_bytes_deleted": {
                        "type": "integer"
                    },
                    "total_expired": {
                        "description": "TotalExpired counts unpublished drafts whose audio expired this run.",
                        "type": "integer"
                    },
                    "total_reaped": {
                        "type": "integer"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnappliedRoyaltyReport": {
                "type": "object",
                "properties": {
                    "checked_at": {
                        "type": "string"
                    },
                    "cutoff": {
                        "description": "Cutoff is the created_at bound the in-flight margin produced; rows at or\nafter it were not examined.",
                        "type": "string"
                    },
                    "purchases": {
                        "description": "Purchases is the buy-to-own block: legs of complete orders the royalty\nsettlement never stamped (purchase_redrive.go). Nil when no purchase\nhalf is wired.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.UnsettledPurchaseListing"
                            }
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.UnappliedRoyaltyRow"
                        }
                    },
                    "totals": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.UnappliedRoyaltyTotal"
                        }
                    },
                    "truncated": {
                        "description": "Truncated is true when Limit cut the row list short; Totals still cover\neverything.",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnappliedRoyaltyRow": {
                "type": "object",
                "properties": {
                    "created_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "gross_smallest_unit": {
                        "description": "GrossSmallestUnit is stream_events.amount in the smallest unit of\nCurrency (cents for USD). Never summed across currencies.",
                        "type": "integer"
                    },
                    "listener_pubkey": {
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "owed_to_pubkey": {
                        "description": "OwedToPubkey is the content owner (nostr_content.pubkey). NULL means the\ncontent row is gone: the engine cannot pay it as things stand.",
                        "type": "string"
                    },
                    "stream_event_id": {
                        "type": "integer"
                    },
                    "stream_session_id": {
                        "description": "StreamSessionID is the client's session UUID (stream_events.idempotency_key).",
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnappliedRoyaltyTotal": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "gross_smallest_unit": {
                        "type": "integer"
                    },
                    "newest": {
                        "type": "string"
                    },
                    "oldest": {
                        "type": "string"
                    },
                    "streams_never_applied": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnsettledPurchaseLeg": {
                "type": "object",
                "properties": {
                    "completed_at": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "gross_smallest_unit": {
                        "description": "GrossSmallestUnit is purchase_legs.gross_cents (cents of Currency).",
                        "type": "integer"
                    },
                    "leg_id": {
                        "type": "integer"
                    },
                    "leg_index": {
                        "type": "integer"
                    },
                    "order_id": {
                        "type": "string"
                    },
                    "recipient_pubkey": {
                        "type": "string"
                    },
                    "royalty_applied": {
                        "description": "RoyaltyApplied: the engine already credited the artist and only the\nleg's stamp (and its receipt) is missing.",
                        "type": "boolean"
                    },
                    "stream_event_id": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    },
                    "track_coordinate": {
                        "type": "string"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnsettledPurchaseListing": {
                "type": "object",
                "properties": {
                    "legs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.UnsettledPurchaseLeg"
                        }
                    },
                    "totals": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_services.UnsettledPurchaseTotal"
                        }
                    },
                    "truncated": {
                        "description": "Truncated is true when Limit cut the leg list short; Totals still cover\neverything.",
                        "type": "boolean"
                    }
                }
            },
            "github_com_wavlake_monorepo_internal_services.UnsettledPurchaseTotal": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "gross_smallest_unit": {
                        "type": "integer"
                    },
                    "legs": {
                        "type": "integer"
                    },
                    "newest": {
                        "type": "string"
                    },
                    "oldest": {
                        "type": "string"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.AccountStatusResponse": {
                "type": "object",
                "properties": {
                    "accountId": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440000"
                    },
                    "verified": {
                        "type": "boolean",
                        "example": true
                    }
                }
            },
            "internal_accounting_handlers.BillingPortalResponse": {
                "type": "object",
                "properties": {
                    "url": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.CheckoutCapabilityResponse": {
                "type": "object",
                "properties": {
                    "inlineFlows": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "credits"
                        ]
                    },
                    "publishableKey": {
                        "type": "string",
                        "example": "pk_test_51Example"
                    }
                }
            },
            "internal_accounting_handlers.CreateAccountRequest": {
                "type": "object",
                "required": [
                    "userId"
                ],
                "properties": {
                    "userId": {
                        "type": "string",
                        "example": "user_123"
                    }
                }
            },
            "internal_accounting_handlers.CreateAccountResponse": {
                "type": "object",
                "properties": {
                    "balanceMsats": {
                        "type": "integer",
                        "example": 0
                    },
                    "createdAt": {
                        "type": "string",
                        "example": "2025-01-01T12:00:00Z"
                    },
                    "id": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440000"
                    },
                    "userId": {
                        "type": "string",
                        "example": "user_123"
                    }
                }
            },
            "internal_accounting_handlers.CreateCheckoutRequest": {
                "type": "object",
                "required": [
                    "amountCents"
                ],
                "properties": {
                    "amountCents": {
                        "type": "integer",
                        "maximum": 10000,
                        "minimum": 1000,
                        "example": 2500
                    },
                    "return_origin": {
                        "type": "string",
                        "example": "https://beta.wavlake.com"
                    }
                }
            },
            "internal_accounting_handlers.CreateCustodialWalletRequest": {
                "type": "object",
                "required": [
                    "clientPubkey"
                ],
                "properties": {
                    "clientPubkey": {
                        "type": "string",
                        "example": "abc123def456..."
                    },
                    "deviceName": {
                        "type": "string",
                        "example": "Chrome on MacBook"
                    }
                }
            },
            "internal_accounting_handlers.CreateDepositRequest": {
                "type": "object",
                "required": [
                    "amount",
                    "description",
                    "userId"
                ],
                "properties": {
                    "amount": {
                        "type": "integer",
                        "example": 1000000
                    },
                    "description": {
                        "type": "string",
                        "example": "Wallet top-up"
                    },
                    "idempotencyKey": {
                        "type": "string",
                        "example": "deposit_abc123"
                    },
                    "nwcClientPubkey": {
                        "type": "string",
                        "example": "8ffec676fba3aa33531f30c3651abe5430cbf8f28653b2ea9847e16a00021402"
                    },
                    "userId": {
                        "type": "string",
                        "example": "user_123"
                    }
                }
            },
            "internal_accounting_handlers.CreateDepositResponse": {
                "type": "object",
                "properties": {
                    "expiresAt": {
                        "description": "ExpiresAt is the invoice expiration time in RFC3339 format.\nMay be empty if ZBD did not return an expiry time.",
                        "type": "string",
                        "example": "2025-01-01T12:15:00Z"
                    },
                    "invoice": {
                        "type": "string",
                        "example": "lnbc10m1..."
                    },
                    "status": {
                        "type": "string",
                        "example": "pending"
                    },
                    "transactionId": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440000"
                    }
                }
            },
            "internal_accounting_handlers.CreateNWCConnectionRequest": {
                "type": "object",
                "required": [
                    "pubkey",
                    "requestMethods"
                ],
                "properties": {
                    "maxMsatPaymentAmount": {
                        "type": "integer",
                        "example": 100000
                    },
                    "msatBudget": {
                        "type": "integer",
                        "example": 1000000
                    },
                    "name": {
                        "type": "string",
                        "example": "My Wallet"
                    },
                    "pubkey": {
                        "type": "string",
                        "example": "02a1b2c3d4e5f6..."
                    },
                    "relayUrls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "wss://relay.wavlake.com"
                        ]
                    },
                    "requestMethods": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "get_balance",
                            "pay_invoice"
                        ]
                    }
                }
            },
            "internal_accounting_handlers.CreateRampSessionRequest": {
                "type": "object",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "type": "string",
                        "example": "user@example.com"
                    }
                }
            },
            "internal_accounting_handlers.CreateRampSessionResponse": {
                "type": "object",
                "properties": {
                    "sessionId": {
                        "type": "string",
                        "example": "sess_123456789"
                    },
                    "sessionToken": {
                        "type": "string",
                        "example": "ramp_session_abc123..."
                    }
                }
            },
            "internal_accounting_handlers.CreateWithdrawalRequest": {
                "type": "object",
                "required": [
                    "description",
                    "userId"
                ],
                "properties": {
                    "amount": {
                        "type": "integer",
                        "example": 500000
                    },
                    "bolt11Invoice": {
                        "type": "string",
                        "example": "lnbc10m1pjqnqzspp5..."
                    },
                    "description": {
                        "type": "string",
                        "example": "Withdrawal to wallet"
                    },
                    "idempotencyKey": {
                        "type": "string",
                        "example": "withdrawal_def456"
                    },
                    "lightningAddress": {
                        "type": "string",
                        "example": "user@getalby.com"
                    },
                    "nwcClientPubkey": {
                        "type": "string",
                        "example": "8ffec676fba3aa33531f30c3651abe5430cbf8f28653b2ea9847e16a00021402"
                    },
                    "userId": {
                        "type": "string",
                        "example": "user_123"
                    }
                }
            },
            "internal_accounting_handlers.CreateWithdrawalResponse": {
                "type": "object",
                "properties": {
                    "estimatedFee": {
                        "type": "integer",
                        "example": 1000
                    },
                    "isInternalTransfer": {
                        "description": "IsInternalTransfer indicates this was a Wavlake-to-Wavlake transfer (no Lightning Network)\nWhen true, EstimatedFee will be 0 and the transfer completed instantly",
                        "type": "boolean",
                        "example": false
                    },
                    "isSelfTransfer": {
                        "description": "IsSelfTransfer indicates the sender and recipient are the same user (no balance change)\nOnly populated when IsInternalTransfer is true",
                        "type": "boolean",
                        "example": false
                    },
                    "recipientUsername": {
                        "description": "RecipientUsername is the NIP-05 username of the recipient (for Lightning Address internal transfers)\nOnly populated when IsInternalTransfer is true and detection was via Lightning Address",
                        "type": "string",
                        "example": "alice"
                    },
                    "status": {
                        "type": "string",
                        "example": "processing"
                    },
                    "transactionId": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440000"
                    }
                }
            },
            "internal_accounting_handlers.CreditPack": {
                "type": "object",
                "properties": {
                    "amountCents": {
                        "type": "integer"
                    },
                    "credits": {
                        "type": "integer"
                    },
                    "label": {
                        "type": "string"
                    },
                    "priceId": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.CreditPurchaseResult": {
                "type": "object",
                "properties": {
                    "amount": {
                        "type": "integer"
                    },
                    "checkoutUrl": {
                        "type": "string"
                    },
                    "sessionId": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.CustodialWalletResponse": {
                "type": "object",
                "properties": {
                    "alias": {
                        "type": "string",
                        "example": "Wavlake Custodial Wallet"
                    },
                    "clientPubkey": {
                        "type": "string",
                        "example": "abc123def456..."
                    },
                    "connectionId": {
                        "type": "string",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "connectionUri": {
                        "type": "string",
                        "example": "nostr+walletconnect://abc123def456...?relay=wss://relay.wavlake.com"
                    },
                    "createdAt": {
                        "type": "string",
                        "example": "2024-01-01T00:00:00Z"
                    },
                    "isCustodial": {
                        "type": "boolean",
                        "example": true
                    },
                    "permissions": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "get_balance",
                            "list_transactions"
                        ]
                    },
                    "relayUrl": {
                        "type": "string",
                        "example": "wss://relay.wavlake.com"
                    },
                    "walletPubkey": {
                        "type": "string",
                        "example": "abc123def456..."
                    }
                }
            },
            "internal_accounting_handlers.GetBalanceResponse": {
                "type": "object",
                "properties": {
                    "availableMsats": {
                        "type": "integer",
                        "example": 950000
                    },
                    "balanceMsats": {
                        "type": "integer",
                        "example": 1000000
                    },
                    "escrowMsats": {
                        "description": "EscrowMsats represents funds held in escrow due to balance cap overflow.\nThese are user funds that couldn't be credited to the main balance because\nthe balance cap was reached. Escrow funds are automatically released when\nthe user withdraws and creates space under the balance cap.",
                        "type": "integer",
                        "example": 0
                    },
                    "lastUpdated": {
                        "type": "string",
                        "example": "2025-01-01T12:00:00Z"
                    },
                    "reservedMsats": {
                        "type": "integer",
                        "example": 50000
                    },
                    "userId": {
                        "type": "string",
                        "example": "user_123"
                    }
                }
            },
            "internal_accounting_handlers.GetCreditPacksResponse": {
                "type": "object",
                "properties": {
                    "creditPacks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_accounting_handlers.CreditPack"
                        }
                    },
                    "customAmount": {
                        "type": "object",
                        "properties": {
                            "maxCents": {
                                "type": "integer",
                                "example": 10000
                            },
                            "minCents": {
                                "type": "integer",
                                "example": 1000
                            }
                        }
                    }
                }
            },
            "internal_accounting_handlers.GetTransactionResponse": {
                "type": "object",
                "properties": {
                    "amount": {
                        "type": "integer",
                        "example": 1000000
                    },
                    "completedAt": {
                        "type": "string",
                        "example": "2025-01-01T12:00:15Z"
                    },
                    "description": {
                        "type": "string",
                        "example": "Wallet top-up"
                    },
                    "failedAt": {
                        "type": "string",
                        "example": "2025-01-01T12:00:30Z"
                    },
                    "failureReason": {
                        "type": "string",
                        "example": "Payment failed: Route not found"
                    },
                    "fee": {
                        "type": "integer",
                        "example": 1000
                    },
                    "fromAccountId": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440001"
                    },
                    "id": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440000"
                    },
                    "idempotencyKey": {
                        "type": "string",
                        "example": "deposit_abc123"
                    },
                    "initiatedAt": {
                        "type": "string",
                        "example": "2025-01-01T12:00:00Z"
                    },
                    "lightningAddress": {
                        "type": "string",
                        "example": "user@getalby.com"
                    },
                    "metadata": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "metadataError": {
                        "type": "string",
                        "example": "Failed to parse metadata"
                    },
                    "paymentMethod": {
                        "type": "string",
                        "example": "lightning_address"
                    },
                    "status": {
                        "type": "string",
                        "example": "completed"
                    },
                    "toAccountId": {
                        "type": "string",
                        "example": "550e8400-e29b-41d4-a716-446655440002"
                    },
                    "type": {
                        "type": "string",
                        "example": "deposit"
                    },
                    "zbdChargeId": {
                        "type": "string",
                        "example": "charge_123abc"
                    },
                    "zbdInvoice": {
                        "type": "string",
                        "example": "lnbc10m1..."
                    },
                    "zbdPaymentId": {
                        "type": "string",
                        "example": "payment_456def"
                    }
                }
            },
            "internal_accounting_handlers.GridSetupWithdrawalsResponse": {
                "type": "object",
                "properties": {
                    "gridCustomerId": {
                        "type": "string",
                        "example": "cust_grid_123"
                    }
                }
            },
            "internal_accounting_handlers.ListTransactionsResponse": {
                "type": "object",
                "properties": {
                    "pagination": {
                        "$ref": "#/components/schemas/internal_accounting_handlers.PaginationInfo"
                    },
                    "transactions": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_accounting_handlers.GetTransactionResponse"
                        }
                    }
                }
            },
            "internal_accounting_handlers.NWCConnectionResponse": {
                "type": "object",
                "properties": {
                    "clientPubkey": {
                        "type": "string",
                        "example": "02a1b2c3d4e5f6..."
                    },
                    "connectionName": {
                        "type": "string",
                        "example": "My Wallet"
                    },
                    "createdAt": {
                        "type": "string",
                        "example": "2024-01-01T00:00:00Z"
                    },
                    "deviceName": {
                        "type": "string",
                        "example": "Chrome on MacBook"
                    },
                    "expiresAt": {
                        "type": "string",
                        "example": "2024-12-31T23:59:59Z"
                    },
                    "id": {
                        "type": "string",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "isExpired": {
                        "type": "boolean",
                        "example": false
                    },
                    "isRevoked": {
                        "type": "boolean",
                        "example": false
                    },
                    "lastUsedAt": {
                        "type": "string",
                        "example": "2024-01-01T12:00:00Z"
                    },
                    "maxMsatPaymentAmount": {
                        "type": "integer",
                        "example": 100000
                    },
                    "msatBudget": {
                        "type": "integer",
                        "example": 1000000
                    },
                    "msatBudgetUsed": {
                        "type": "integer",
                        "example": 50000
                    },
                    "relayUrls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "wss://relay.wavlake.com"
                        ]
                    },
                    "requestMethods": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "get_balance",
                            "pay_invoice"
                        ]
                    }
                }
            },
            "internal_accounting_handlers.OnrampSessionRequest": {
                "type": "object",
                "required": [
                    "amountCents",
                    "btcAddress"
                ],
                "properties": {
                    "amountCents": {
                        "type": "integer",
                        "example": 2500
                    },
                    "btcAddress": {
                        "type": "string",
                        "example": "bc1p..."
                    }
                }
            },
            "internal_accounting_handlers.OnrampSessionResult": {
                "type": "object",
                "properties": {
                    "redirectUrl": {
                        "type": "string"
                    },
                    "sessionId": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.PaginationInfo": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer",
                        "example": 50
                    },
                    "offset": {
                        "type": "integer",
                        "example": 0
                    },
                    "total": {
                        "type": "integer",
                        "example": 127
                    }
                }
            },
            "internal_accounting_handlers.StripeConnectOnboardResponse": {
                "type": "object",
                "properties": {
                    "onboardingUrl": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.StripeConnectStatusResponse": {
                "type": "object",
                "properties": {
                    "chargesEnabled": {
                        "type": "boolean"
                    },
                    "country": {
                        "type": "string"
                    },
                    "onboardingComplete": {
                        "type": "boolean"
                    },
                    "payoutsEnabled": {
                        "type": "boolean"
                    },
                    "requirementsCurrentlyDue": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "stripeConnectAccountId": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.UpdateConnectionRequest": {
                "type": "object",
                "required": [
                    "deviceName"
                ],
                "properties": {
                    "deviceName": {
                        "type": "string",
                        "example": "My MacBook Pro"
                    }
                }
            },
            "internal_accounting_handlers.UserLimitsResponse": {
                "type": "object",
                "properties": {
                    "currentTier": {
                        "description": "CurrentTier is the user's current wallet tier (T1, T2, T3 for users; A1, A2, A3 for artists)",
                        "type": "string",
                        "example": "T2"
                    },
                    "dailyWithdrawnMsats": {
                        "description": "DailyWithdrawnMsats is the amount withdrawn today in millisats (resets at midnight UTC)",
                        "type": "integer",
                        "example": 0
                    },
                    "escrowMsats": {
                        "description": "EscrowMsats is the total amount currently held in escrow (in millisats)",
                        "type": "integer",
                        "example": 0
                    },
                    "firebaseUid": {
                        "description": "FirebaseUID is the user's Firebase identifier",
                        "type": "string",
                        "example": "abc123xyz"
                    },
                    "hasOverrides": {
                        "description": "HasOverrides indicates if any admin override is active",
                        "type": "boolean",
                        "example": false
                    },
                    "maxBalanceSats": {
                        "description": "MaxBalanceSats is the maximum wallet balance in satoshis",
                        "type": "integer",
                        "example": 100000
                    },
                    "maxDailyWithdrawSats": {
                        "description": "MaxDailyWithdrawSats is the maximum total withdrawals per day in satoshis",
                        "type": "integer",
                        "example": 50000
                    },
                    "maxPerTxSats": {
                        "description": "MaxPerTxSats is the maximum single withdrawal amount in satoshis",
                        "type": "integer",
                        "example": 25000
                    },
                    "overrideReason": {
                        "description": "OverrideReason is the audit trail reason for the override",
                        "type": "string"
                    },
                    "overrideSetAt": {
                        "description": "OverrideSetAt is when the override was set",
                        "type": "string"
                    },
                    "overrideSetBy": {
                        "description": "OverrideSetBy is the firebase_uid of the admin who set the override (if any)",
                        "type": "string"
                    },
                    "tierUpgradedAt": {
                        "description": "TierUpgradedAt is when the tier was last upgraded",
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.VerifyUserRequest": {
                "type": "object",
                "required": [
                    "firstName",
                    "lastName"
                ],
                "properties": {
                    "firstName": {
                        "type": "string",
                        "maxLength": 100,
                        "minLength": 1,
                        "example": "John"
                    },
                    "lastName": {
                        "type": "string",
                        "maxLength": 100,
                        "minLength": 1,
                        "example": "Doe"
                    }
                }
            },
            "internal_accounting_handlers.VerifyUserResponse": {
                "type": "object",
                "properties": {
                    "verified": {
                        "type": "boolean",
                        "example": true
                    },
                    "verifiedAt": {
                        "type": "string",
                        "example": "2025-11-10T12:00:00Z"
                    }
                }
            },
            "internal_accounting_handlers.WalletLimitDetails": {
                "type": "object",
                "properties": {
                    "currentTier": {
                        "description": "CurrentTier is the user's current wallet tier",
                        "type": "string",
                        "example": "T1"
                    },
                    "currentValue": {
                        "description": "CurrentValue is the value that exceeded the limit (in sats)",
                        "type": "integer",
                        "example": 15000
                    },
                    "excessAmount": {
                        "description": "ExcessAmount is how much over the limit (in sats)",
                        "type": "integer",
                        "example": 5000
                    },
                    "limitType": {
                        "description": "LimitType is which limit was exceeded: \"per_tx\", \"daily_withdraw\", or \"balance_cap\"",
                        "type": "string",
                        "example": "per_tx"
                    },
                    "limitValue": {
                        "description": "LimitValue is the maximum allowed value (in sats)",
                        "type": "integer",
                        "example": 10000
                    },
                    "upgradeInfo": {
                        "description": "UpgradeInfo explains how to get higher limits (nil if at max tier)",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_accounting_handlers.WalletUpgradeInfo"
                            }
                        ]
                    }
                }
            },
            "internal_accounting_handlers.WalletLimitErrorResponse": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "example": "amount exceeds per-transaction limit"
                    },
                    "errorCode": {
                        "type": "string",
                        "example": "WALLET_PER_TX_LIMIT_EXCEEDED"
                    },
                    "limitDetails": {
                        "description": "LimitDetails contains the specific limit that was exceeded",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_accounting_handlers.WalletLimitDetails"
                            }
                        ]
                    },
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_handlers.WalletPubkeyResponse": {
                "type": "object",
                "properties": {
                    "pubkey": {
                        "type": "string",
                        "example": "abc123def456..."
                    }
                }
            },
            "internal_accounting_handlers.WalletUpgradeInfo": {
                "type": "object",
                "properties": {
                    "currentAccountAgeDays": {
                        "description": "Progress shows current progress toward requirements",
                        "type": "integer",
                        "example": 15
                    },
                    "currentTransactionCount": {
                        "type": "integer",
                        "example": 3
                    },
                    "nextTier": {
                        "description": "NextTier is the next available tier",
                        "type": "string",
                        "example": "T2"
                    },
                    "nextTierMaxBalanceSats": {
                        "description": "NextTierLimits shows what limits the next tier provides (in sats)",
                        "type": "integer",
                        "example": 100000
                    },
                    "nextTierMaxDailyWithdrawSats": {
                        "type": "integer",
                        "example": 50000
                    },
                    "nextTierMaxPerTxSats": {
                        "type": "integer",
                        "example": 25000
                    },
                    "requiredAccountAgeDays": {
                        "description": "Requirements shows what's needed to reach the next tier",
                        "type": "integer",
                        "example": 30
                    },
                    "requiredTransactionCount": {
                        "type": "integer",
                        "example": 5
                    }
                }
            },
            "internal_accounting_limits.SetAdminOverrideRequest": {
                "type": "object",
                "required": [
                    "reason"
                ],
                "properties": {
                    "maxBalanceSats": {
                        "description": "MaxBalanceSats overrides the tier's max balance (omit to keep tier default)",
                        "type": "integer"
                    },
                    "maxDailyWithdrawSats": {
                        "description": "MaxDailyWithdrawSats overrides the tier's max daily withdrawal (omit to keep tier default)",
                        "type": "integer"
                    },
                    "maxPerTxSats": {
                        "description": "MaxPerTxSats overrides the tier's max per-transaction limit (omit to keep tier default)",
                        "type": "integer"
                    },
                    "reason": {
                        "description": "Reason is required for audit trail",
                        "type": "string"
                    }
                }
            },
            "internal_accounting_limits.SetUserTierRequest": {
                "type": "object",
                "required": [
                    "tier"
                ],
                "properties": {
                    "tier": {
                        "type": "string"
                    }
                }
            },
            "internal_accounting_limits.TierEvaluationJobResult": {
                "type": "object",
                "properties": {
                    "durationMs": {
                        "description": "Duration is how long the job took",
                        "type": "integer"
                    },
                    "errors": {
                        "description": "Errors lists any errors that occurred during evaluation",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "totalAccountsEvaluated": {
                        "description": "TotalAccountsEvaluated is the number of accounts processed",
                        "type": "integer"
                    },
                    "upgradeDetails": {
                        "description": "UpgradeDetails lists each upgrade that occurred",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_accounting_limits.TierEvaluationResult"
                        }
                    },
                    "upgradesPerformed": {
                        "description": "UpgradesPerformed is the number of accounts that were upgraded",
                        "type": "integer"
                    }
                }
            },
            "internal_accounting_limits.TierEvaluationResult": {
                "type": "object",
                "properties": {
                    "accountAgeDays": {
                        "description": "EvaluationDetails provides context about the evaluation",
                        "type": "integer"
                    },
                    "currentTier": {
                        "description": "CurrentTier is the user's current tier before evaluation",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_accounting_limits.WalletTier"
                            }
                        ]
                    },
                    "eligibleTier": {
                        "description": "EligibleTier is the highest tier the user is eligible for",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_accounting_limits.WalletTier"
                            }
                        ]
                    },
                    "firebaseUid": {
                        "description": "FirebaseUID is the user identifier (nil for Tier 1 Nostr-only users)",
                        "type": "string"
                    },
                    "isArtist": {
                        "type": "boolean"
                    },
                    "transactionCount": {
                        "type": "integer"
                    },
                    "wasUpgraded": {
                        "description": "WasUpgraded indicates if the tier was changed",
                        "type": "boolean"
                    }
                }
            },
            "internal_accounting_limits.UserLimits": {
                "type": "object",
                "properties": {
                    "currentTier": {
                        "description": "CurrentTier is the user's current wallet tier",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_accounting_limits.WalletTier"
                            }
                        ]
                    },
                    "dailyWithdrawnMsats": {
                        "description": "DailyWithdrawnMsats is the amount withdrawn today (resets at midnight UTC)",
                        "type": "integer"
                    },
                    "escrowMsats": {
                        "description": "EscrowMsats is the total amount currently held in escrow (not yet released)\nThis is funds that exceeded the balance cap and will be released on withdrawal",
                        "type": "integer"
                    },
                    "firebaseUid": {
                        "description": "FirebaseUID is the user's Firebase identifier (nil for Tier 1 Nostr-only users)",
                        "type": "string"
                    },
                    "hasOverrides": {
                        "description": "HasOverrides indicates if any admin override is active",
                        "type": "boolean"
                    },
                    "maxBalanceSats": {
                        "description": "EffectiveLimits are the actual limits in effect (tier defaults + any overrides)",
                        "type": "integer"
                    },
                    "maxDailyWithdrawSats": {
                        "type": "integer"
                    },
                    "maxPerTxSats": {
                        "type": "integer"
                    },
                    "overrideReason": {
                        "type": "string"
                    },
                    "overrideSetAt": {
                        "type": "string"
                    },
                    "overrideSetBy": {
                        "description": "Override details (only populated if HasOverrides is true)",
                        "type": "string"
                    },
                    "tierUpgradedAt": {
                        "description": "TierUpgradedAt is when the tier was last upgraded (nil if never upgraded from T1)",
                        "type": "string"
                    }
                }
            },
            "internal_accounting_limits.WalletTier": {
                "type": "string",
                "enum": [
                    "T1",
                    "T2",
                    "T3",
                    "A1",
                    "A2",
                    "A3"
                ],
                "x-enum-comments": {
                    "TierA1": "Has artist profile (nostr_content)",
                    "TierA2": "30+ days AND 10+ transactions",
                    "TierA3": "90+ days AND 100+ transactions",
                    "TierT1": "Default for new accounts",
                    "TierT2": "30+ days AND 5+ transactions",
                    "TierT3": "90+ days AND 25+ transactions"
                },
                "x-enum-varnames": [
                    "TierT1",
                    "TierT2",
                    "TierT3",
                    "TierA1",
                    "TierA2",
                    "TierA3"
                ]
            },
            "internal_feeaddress.CallbackResponse": {
                "type": "object",
                "properties": {
                    "pr": {
                        "type": "string"
                    },
                    "routes": {
                        "type": "array",
                        "items": {}
                    }
                }
            },
            "internal_handlers.ArtistCreditAvailabilityResponse": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "Name is the name asked about, as sent.",
                        "type": "string"
                    },
                    "status": {
                        "description": "Status is one of \"available\", \"artist_reserved\".",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.AttachLiveProofRequest": {
                "type": "object",
                "required": [
                    "hostProof"
                ],
                "properties": {
                    "hostProof": {
                        "description": "HostProof is the hex BIP-340 signature over the proof challenge (required).",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.BatchTrackProcessingStatusRequest": {
                "type": "object",
                "required": [
                    "track_ids"
                ],
                "properties": {
                    "track_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.BatchTrackProcessingStatusResponse": {
                "type": "object",
                "properties": {
                    "statuses": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.TrackProcessingStatusResponse"
                        }
                    }
                }
            },
            "internal_handlers.CheckPubkeyLinkRequest": {
                "type": "object",
                "required": [
                    "pubkey"
                ],
                "properties": {
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.CheckPubkeyLinkResponse": {
                "type": "object",
                "properties": {
                    "is_linked": {
                        "type": "boolean"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.CommunitySlugAvailabilityResponse": {
                "type": "object",
                "properties": {
                    "slug": {
                        "description": "Slug is the name asked about, lower-cased and trimmed as the registration does.",
                        "type": "string"
                    },
                    "status": {
                        "description": "Status is one of \"available\", \"taken\", \"reserved\", \"legacy_reserved\", \"artist_reserved\".",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ConfirmPublishBatchItem": {
                "type": "object",
                "properties": {
                    "event_id": {
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ConfirmPublishBatchRequest": {
                "type": "object",
                "properties": {
                    "tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.ConfirmPublishBatchItem"
                        }
                    }
                }
            },
            "internal_handlers.ConfirmPublishBatchResponse": {
                "type": "object",
                "properties": {
                    "results": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.ConfirmPublishBatchResult"
                        }
                    }
                }
            },
            "internal_handlers.ConfirmPublishBatchResult": {
                "type": "object",
                "properties": {
                    "error_code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "published_at": {
                        "description": "RFC3339, on 200",
                        "type": "string"
                    },
                    "status": {
                        "type": "integer"
                    },
                    "track_id": {
                        "description": "as the request named it",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ConfirmPublishRequest": {
                "type": "object",
                "required": [
                    "event_id"
                ],
                "properties": {
                    "event_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ConfirmRequest": {
                "type": "object",
                "properties": {
                    "sessionId": {
                        "type": "string"
                    },
                    "streamType": {
                        "type": "string"
                    },
                    "stream_session_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ConfirmResponse": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    },
                    "success": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.CreateLiveAccessRequest": {
                "type": "object",
                "properties": {
                    "channelId": {
                        "description": "ChannelID is the channel the person was in when they asked (32 lowercase\nhex), a hint for the operator. Optional.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.CreateLiveStreamRequest": {
                "type": "object",
                "required": [
                    "communityId",
                    "title"
                ],
                "properties": {
                    "audioOnly": {
                        "description": "AudioOnly requests an audio-only stream (no video).",
                        "type": "boolean"
                    },
                    "communityId": {
                        "description": "CommunityID is the stream's home community id, 32-hex (required). Combined\nwith the authenticated pubkey to build the D55 home pointer; also emitted\nas the event's required `h` tag.",
                        "type": "string"
                    },
                    "hostProof": {
                        "description": "HostProof is the optional hex BIP-340 signature over the proof challenge.\nOmit it here and attach later via PATCH /live/streams/{id}/proof.",
                        "type": "string"
                    },
                    "image": {
                        "description": "Image is an optional preview image URL.",
                        "type": "string"
                    },
                    "scheduledStart": {
                        "description": "ScheduledStart is the announced start (unix seconds). 0/absent = start now.",
                        "type": "integer"
                    },
                    "summary": {
                        "description": "Summary is an optional short description.",
                        "type": "string"
                    },
                    "title": {
                        "description": "Title is the human-readable event title (required).",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.CreateLiveStreamResponse": {
                "type": "object",
                "properties": {
                    "credentials": {
                        "$ref": "#/components/schemas/internal_handlers.LiveStreamCredentialsResponse"
                    },
                    "proofChallenge": {
                        "type": "string"
                    },
                    "stream": {
                        "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                    }
                }
            },
            "internal_handlers.CreateNostrTrackRequest": {
                "type": "object",
                "required": [
                    "duration_seconds",
                    "extension",
                    "size_bytes"
                ],
                "properties": {
                    "access_mode": {
                        "description": "Optional: free, honor, or paywall (defaults to free)",
                        "type": "string"
                    },
                    "artist_credits": {
                        "description": "ArtistCredits are NAMES (D47) — 0..N, no key, no event, no profile. A\ncredited-but-keyless artist has no on-platform money path, because money\nfollows the signer (D46); the studio discloses that at upload.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "community_id": {
                        "description": "---- Creator-identity fields (wave 1) -------------------------------\n\nCommunityID is the content's home community — the `h` the published event\nwill carry. When present the handler proves, before any row is made,\nthat the uploader is that community's current owner, reading the Wavlake\nrelay (D71). This runs for EVERY content_type — music, podcasts, articles,\nvideo alike (D56).\n\nOPTIONAL AT THE HANDLER IN WAVE 1, and deliberately so: the community-aware\nstudio is PRD (c), the column is nullable until wave 2 makes it NOT NULL\n(migration 000087 §3), and the spec's lockstep has the API deployed before\nthe clients that emit `h` (§9 steps 2→3). Requiring it here would 400 every\ndeployed upload the moment this merges. What is NOT optional is the\nchecking: a community_id that IS supplied is fully validated or the upload\nis refused.",
                        "type": "string"
                    },
                    "content_type": {
                        "description": "ContentType is the optional content_type discriminator (music_track |\npodcast_episode | podcast_show). Empty defaults to music_track,\npreserving the existing studio music flow. When set to a non-music type\nthe upload constraints (e.g. podcast 4-hour duration ceiling), Nostr kind,\nand GCS storage root are all derived from it. Unknown values are rejected\n400 — the DB CHECK is the hard backstop.",
                        "type": "string"
                    },
                    "credit_pubkeys": {
                        "description": "CreditPubkeys are the OPTIONAL identity links for those credits. Not\nrendered at launch unless counter-claimed (D54).",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "duration_seconds": {
                        "type": "integer"
                    },
                    "extension": {
                        "type": "string"
                    },
                    "preview_end_byte": {
                        "description": "Optional: artist-set preview boundary (byte offset)",
                        "type": "integer"
                    },
                    "price_credits": {
                        "description": "Optional: price in credits (required for non-free modes)",
                        "type": "integer"
                    },
                    "purchase_price_cents": {
                        "description": "PurchasePriceCents is the buy-to-own track price (D147), whole US cents.\nAccepted for symmetry with the pricing PATCH and validated (music only,\ninside the configured bounds), but a NEW upload is always refused with\n409 PURCHASE_AUDIO_NOT_READY: an offer switches on only once the\ncompressed file exists (design §9.1), which it cannot at upload. Set the\nprice with PATCH /v1/tracks/{id}/pricing once processing finishes.",
                        "type": "integer"
                    },
                    "release_d_tag": {
                        "description": "ReleaseDTag is the d-tag of the release (draft or live) this track\nbelongs to — the id the API issued when the release draft was started\n(POST /v1/releases/ids, #5509), before any record exists; a new upload\nmay name only an id issued to the uploader or a release they already\nhold (403 RELEASE_ID_NOT_ISSUED). Per-release hosting (D146) counts DRAFT\nRELEASES by it: a new artist holds at most 5 unpublished draft releases\n(409 DRAFT_LIMIT_REACHED) and a release at most 30 tracks (400\nRELEASE_TOO_MANY_TRACKS), and a release's hosting price counts the\ntracks uploaded for it. REQUIRED on a new upload of any content type\n(400 RELEASE_D_TAG_REQUIRED) so no client can skip the cap — long-form\nis hosted like music until D78 (#3999); a re-upload\n(target_d_tag) keeps its row's. Colons are legal and ride verbatim.",
                        "type": "string"
                    },
                    "release_id": {
                        "description": "ReleaseID is the parent release the studio minted through POST /v1/releases\nbefore this upload (release-first, §7.2 step 1). ADVISORY — several publish\npaths legitimately have none — but when it IS sent, the parent's\ncommunity_id must equal this track's home, or the upload is refused before\nthe debit.",
                        "type": "string"
                    },
                    "size_bytes": {
                        "description": "SizeBytes and DurationSeconds are required — the client must report\nboth before the handler will mint a presigned URL. The handler\nenforces the per-content-type size/duration constraints (size ceiling,\nmin/max duration) before any row is made. The `gt=0` binding tag is\nrequired because Gin's `required` only catches missing keys on integer\ntypes, not zero values.",
                        "type": "integer"
                    },
                    "target_d_tag": {
                        "description": "TargetDTag is the Phase 2 \"Add audio\" / \"Re-upload\" remediation hook.\nWhen present, the new track row adopts this d-tag (UUID format,\nmatching nostr_content.id). The caller must own a non-deleted row with\nnostr_d_tag = target_d_tag, which is soft-deleted atomically with the\nnew row's insert. Leaving this unset (the default) produces a brand-new\nd-tag — the existing CreateTrack behavior.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.CreateReleaseRequest": {
                "type": "object",
                "properties": {
                    "artist_credits": {
                        "description": "ArtistCredits are NAMES (D47). No key, no event, no profile required — a\nlabel importing 100 releases writes names and creates nothing else.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "community_id": {
                        "description": "CommunityID is the release's home community — its `h`. OPTIONAL (D83:\n`h` is 0..1). Absent means STANDALONE: the release is the publisher's own\ncontent with no community anywhere in the flow, and no owner check runs\nbecause there is nothing to own. Present means homed, and every check\nthat applied before still applies unchanged.",
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "NostrDTag is the release's id: one the API issued to the caller\n(POST /v1/releases/ids, #5509), or absent, and the API mints one here.\nA d-tag the API did not issue to the caller is refused (403\nRELEASE_ID_NOT_ISSUED), unless the caller already holds that release\n(409, as before). A live release d-tag names one release across every\npublisher, as a track's does.",
                        "type": "string"
                    },
                    "purchase_price_cents": {
                        "description": "PurchasePriceCents is the buy-to-own price of the WHOLE release (D147),\nwhole US cents; absent = not for sale. Checked against the configured\nfloor and release ceiling (GET /v1/artist/sale-price-bounds). Whether\nthe release has the two or more tracks an offer needs is checked at the\npublish confirm, against the verified 34139 — a single's offer lives on\nits track.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.DeleteImageResponse": {
                "type": "object",
                "properties": {
                    "deleted": {
                        "description": "Deleted is true when the image left the owner's gallery.",
                        "type": "boolean"
                    },
                    "file_removed": {
                        "description": "FileRemoved is true when its stored file was removed as well.",
                        "type": "boolean"
                    },
                    "kept_reason": {
                        "description": "KeptReason says why the image, or only its file, was kept: \"in_use\"\n(the owner's content still shows it), \"usage_unverified\" (that could\nnot be checked, so nothing changed) or \"shared_file\" (the image left the\ngallery, but another account's image stores the same file). Empty when\nboth went.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedChannelGuidItem": {
                "type": "object",
                "properties": {
                    "community_id": {
                        "type": "string"
                    },
                    "feed_guid": {
                        "type": "string"
                    },
                    "found": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.FeedChannelGuidsResponse": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedChannelGuidItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedDataBatchResponse": {
                "type": "object",
                "properties": {
                    "audio_base_url": {
                        "description": "AudioBaseURL is AUDIO_STREAMING_BASE_URL: the public host a feed's\nenclosures name (GET /v1/feed-audio/..., #5195). CompressedURL is a\nbucket address that answers 403 to anyone without a credential, so it\ntells a feed that the compressed file exists and is never published.",
                        "type": "string"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedDataItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedDataItem": {
                "type": "object",
                "properties": {
                    "access_mode": {
                        "type": "string"
                    },
                    "compressed_url": {
                        "type": "string"
                    },
                    "content_type": {
                        "type": "string"
                    },
                    "d_tag": {
                        "type": "string"
                    },
                    "duration_seconds": {
                        "type": "integer"
                    },
                    "file_size_bytes": {
                        "type": "integer"
                    },
                    "kind": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.FeedDestinationItem": {
                "type": "object",
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedDestinationsResponse": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedDestinationItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedKeySuccessorResponse": {
                "type": "object",
                "properties": {
                    "pubkey": {
                        "type": "string"
                    },
                    "successor": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedOptInItem": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "decided_by": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedOptInResponse": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedOptInItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedOwnerEmailsItem": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedOwnerEmailsResponse": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedOwnerEmailsItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedReleaseOriginItem": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "imported": {
                        "type": "boolean"
                    },
                    "legacy_album_id": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FeedReleaseOriginsResponse": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.FeedReleaseOriginItem"
                        }
                    }
                }
            },
            "internal_handlers.FeedReleaseTracksResponse": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "imported": {
                        "type": "boolean"
                    },
                    "legacy_track_ids": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.FraudReportCaps": {
                "type": "object",
                "properties": {
                    "currency": {
                        "type": "string"
                    },
                    "purchase_daily_cents": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.FraudReportResponse": {
                "type": "object",
                "properties": {
                    "caps_in_effect": {
                        "$ref": "#/components/schemas/internal_handlers.FraudReportCaps"
                    },
                    "report": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_fraud.Report"
                    }
                }
            },
            "internal_handlers.GenerateDeleteTokenRequest": {
                "type": "object",
                "required": [
                    "path"
                ],
                "properties": {
                    "expiration": {
                        "description": "Expiration in minutes",
                        "type": "integer"
                    },
                    "path": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.GenerateUploadTokenRequest": {
                "type": "object",
                "required": [
                    "path"
                ],
                "properties": {
                    "expiration": {
                        "description": "Expiration in minutes",
                        "type": "integer"
                    },
                    "path": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.GetLinkedPubkeysData": {
                "type": "object",
                "properties": {
                    "email": {
                        "description": "Email is the account's Firebase email address, resolved from Firebase Auth\n(it is NOT stored in our Postgres). Surfaced here so clients authenticated\nvia NIP-98 — which have no client-side Firebase session and therefore no\n`user.email` to read — can still display which email backs the account.\nEmpty when the Firebase user has no email or Firebase Auth is unavailable.",
                        "type": "string"
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "linked_pubkeys": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LinkedPubkeyInfo"
                        }
                    }
                }
            },
            "internal_handlers.GetMeData": {
                "type": "object",
                "properties": {
                    "user": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.APIUser"
                    }
                }
            },
            "internal_handlers.HasPublishedResponse": {
                "type": "object",
                "properties": {
                    "has_published": {
                        "type": "boolean"
                    },
                    "relay_unavailable": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.HeartbeatResponse": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.HeldNameAct": {
                "type": "object",
                "properties": {
                    "display_name": {
                        "type": "string"
                    },
                    "musicbrainz_url": {
                        "type": "string"
                    },
                    "website": {
                        "type": "string"
                    },
                    "wikidata_url": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.HeldNameMatch": {
                "type": "object",
                "properties": {
                    "display_name": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.HeldNameResponse": {
                "type": "object",
                "properties": {
                    "acts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.HeldNameAct"
                        }
                    },
                    "name": {
                        "description": "Name is the address as asked, lower-cased.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.HeldNameSearchResponse": {
                "type": "object",
                "properties": {
                    "matches": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.HeldNameMatch"
                        }
                    }
                }
            },
            "internal_handlers.HostingPromoClaimRequest": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.HostingPromoClaimResponse": {
                "type": "object",
                "properties": {
                    "again": {
                        "description": "Again: this account had already claimed the link; nothing changed.",
                        "type": "boolean"
                    },
                    "free_until": {
                        "description": "FreeUntil is when their free hosting ends; absent is no end date.",
                        "type": "string"
                    },
                    "kept_existing": {
                        "description": "KeptExisting: they already had free hosting lasting at least as long,\nwhich they keep; the link is spent all the same.",
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.HostingPromoStatusResponse": {
                "type": "object",
                "properties": {
                    "free_for_days": {
                        "description": "FreeForDays is how long the free hosting lasts once claimed; absent is\nno end date.",
                        "type": "integer"
                    },
                    "state": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.IssuedReleaseID": {
                "type": "object",
                "properties": {
                    "nostr_d_tag": {
                        "description": "NostrDTag is the new release's id: its d-tag, a UUID. It is issued to the\ncaller's key alone.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.L402DemoResponse": {
                "type": "object",
                "properties": {
                    "message": {
                        "description": "Message is a human-readable confirmation that access was granted.",
                        "type": "string"
                    },
                    "resource": {
                        "description": "Resource echoes the gated resource coordinate that was unlocked.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyAccountProbeResponse": {
                "type": "object",
                "properties": {
                    "has_legacy_account": {
                        "type": "boolean"
                    },
                    "has_legacy_balance": {
                        "type": "boolean"
                    },
                    "has_legacy_user": {
                        "type": "boolean"
                    },
                    "legacy_linked_pubkeys": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.LegacyArtistMove": {
                "type": "object",
                "properties": {
                    "community_id": {
                        "description": "CommunityID is the channel's permanent id (32 hex characters).",
                        "type": "string"
                    },
                    "path": {
                        "description": "Path is the channel page's own address on the client: the bare\n`/<name>` (the owner's account name pointed at it, else its own\naddress), or `/c/id/<id>` when no name reliably opens it.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyArtistURLResponse": {
                "type": "object",
                "properties": {
                    "artist_url": {
                        "description": "ArtistURL is the name in lower case, as the legacy site looks it up.",
                        "type": "string"
                    },
                    "moved_to": {
                        "description": "MovedTo is the channel that took the act, when one has. Absent when\nnone has, and when that could not be read (no legacy catalog, a fault):\nthe caller then sends the visitor to the legacy site, as before.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/internal_handlers.LegacyArtistMove"
                            }
                        ]
                    }
                }
            },
            "internal_handlers.LegacyLinkResponse": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "event_kind": {
                        "type": "integer"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "legacy_id": {
                        "type": "string"
                    },
                    "naddr": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyNameMove": {
                "type": "object",
                "properties": {
                    "created": {
                        "description": "Created is true when this request recorded the move, false when it\nalready existed for this owner (an idempotent repeat).",
                        "type": "boolean"
                    },
                    "movedAt": {
                        "type": "string"
                    },
                    "network": {
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "the owner (hex)",
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    },
                    "walletIdentity": {
                        "description": "the wallet the name moved to, at the move",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyNameMoveRequest": {
                "type": "object",
                "required": [
                    "username"
                ],
                "properties": {
                    "network": {
                        "description": "Network is the wallet's network (`mainnet` | `regtest`), naming the\nwallet binding the move is checked against. Optional: absent is mainnet.",
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyNameMoveState": {
                "type": "object",
                "properties": {
                    "movedAt": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "state": {
                        "description": "State is `moved` (route to Spark; a Spark failure is an ERROR) or\n`released` (the owner renamed away: route to NEITHER leg).",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LegacyNameMovesResponse": {
                "type": "object",
                "properties": {
                    "moves": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.LegacyNameMoveState"
                        }
                    }
                }
            },
            "internal_handlers.LinkPubkeyData": {
                "type": "object",
                "properties": {
                    "firebase_uid": {
                        "type": "string"
                    },
                    "linked_at": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LinkPubkeyRequest": {
                "type": "object",
                "properties": {
                    "firebaseUid": {
                        "description": "FirebaseUID is the account the signer is linking the key to. Required: it\nmust equal the token's uid (#4426).",
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "PubKey is the key being linked. Optional; when present it must equal the\nkey that signed the request.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ListLiveStreamsResponse": {
                "type": "object",
                "properties": {
                    "streams": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                        }
                    }
                }
            },
            "internal_handlers.ListRecoverableResponse": {
                "type": "object",
                "properties": {
                    "keys": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.RecoverableKey"
                        }
                    }
                }
            },
            "internal_handlers.ListenerBalanceResponse": {
                "type": "object",
                "properties": {
                    "balance_credits": {
                        "description": "BalanceCredits is the total spendable balance.",
                        "type": "integer"
                    },
                    "currency": {
                        "description": "Currency is the lower-cased currency code of the amounts above.",
                        "type": "string"
                    },
                    "payg_credits": {
                        "description": "PaygCredits is the portion from direct top-ups. It never expires.",
                        "type": "integer"
                    },
                    "subscription_credits": {
                        "description": "SubscriptionCredits is the portion from subscription grants. It is\ncycle-tagged and swept to artists at cycle end if unspent.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.ListenerTopupRequest": {
                "type": "object",
                "required": [
                    "amount_credits"
                ],
                "properties": {
                    "amount_credits": {
                        "description": "AmountCredits is how many credits to buy (1 credit == 1 US cent). Must be\na whole-dollar multiple between 100 and 10000.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.ListenerTopupResponse": {
                "type": "object",
                "properties": {
                    "amount_credits": {
                        "description": "AmountCredits is what will be added on payment. Fixed at quote time — the\nexchange rate moving before payment does not change it.",
                        "type": "integer"
                    },
                    "amount_sats": {
                        "description": "AmountSats is what the payer's wallet will be asked for.",
                        "type": "integer"
                    },
                    "charge_id": {
                        "description": "ChargeID is the provider's reference, useful for support.",
                        "type": "string"
                    },
                    "expires_at": {
                        "description": "ExpiresAt is when the invoice stops being payable.",
                        "type": "string"
                    },
                    "invoice": {
                        "description": "Invoice is the BOLT11 payment request to render as a QR code.",
                        "type": "string"
                    },
                    "topup_id": {
                        "description": "TopupID is the reference for this top-up attempt.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LiveAccessRequestResponse": {
                "type": "object",
                "properties": {
                    "requestedAt": {
                        "description": "RequestedAt is when the key asked (unix seconds); absent unless requested.",
                        "type": "integer"
                    },
                    "status": {
                        "description": "Status is \"none\", \"requested\" or \"allowed\".",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LiveIngestEndpoint": {
                "type": "object",
                "properties": {
                    "protocol": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LiveSignerResponse": {
                "type": "object",
                "properties": {
                    "providerPubkey": {
                        "description": "ProviderPubkey is the hex public key that signs every live event, the same\nvalue a stream create returns as providerPubkey.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LiveStreamCredentialsResponse": {
                "type": "object",
                "properties": {
                    "ingestEndpoints": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.LiveIngestEndpoint"
                        }
                    },
                    "streamKey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.LiveStreamResponse": {
                "type": "object",
                "properties": {
                    "actualStart": {
                        "type": "integer"
                    },
                    "artistPubkey": {
                        "type": "string"
                    },
                    "audioOnly": {
                        "type": "boolean"
                    },
                    "communityId": {
                        "type": "string"
                    },
                    "coordinate": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "integer"
                    },
                    "currentParticipants": {
                        "description": "CurrentParticipants is the freshest known concurrent-viewer count, persisted\nby the Phase-4 heartbeat from the provider's viewer API. Omitted (null) when\nunknown — the provider can't report a count, or the session isn't live.\nLags real time by up to one heartbeat tick (~2-5 min).",
                        "type": "integer"
                    },
                    "dTag": {
                        "type": "string"
                    },
                    "endedAt": {
                        "type": "integer"
                    },
                    "goalEventId": {
                        "description": "GoalEventID is the artist-signed tip-goal (Kind 9041) event id registered\nagainst this session, carried on the live event as a `goal` tag. Omitted when\nthe session has no goal. Viewers read the goal from the relay event and its\nprogress from public receipts — this field exists so the owner studio can\nrender its own goal state. Display-only: goal money settles directly to the\nartist and never enters Wavlake accounting.",
                        "type": "string"
                    },
                    "hasHostProof": {
                        "type": "boolean"
                    },
                    "id": {
                        "type": "string"
                    },
                    "pinnedMessageIds": {
                        "description": "PinnedMessageIDs are the host-pinned Kind 1311 message ids carried on the\nKind 30311 as `pinned` tags. Always present as an array ([] when none).\nViewers read the pinned set from the relay event, not this field — it is\nsurfaced so the owner studio can render its own pin state.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "playbackUrl": {
                        "type": "string"
                    },
                    "provider": {
                        "type": "string"
                    },
                    "providerPubkey": {
                        "type": "string"
                    },
                    "scheduledStart": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "updatedAt": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.MembershipCheckoutSummary": {
                "type": "object",
                "properties": {
                    "appliedCents": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "dueTodayCents": {
                        "type": "integer"
                    },
                    "nextChargeAt": {
                        "type": "integer"
                    },
                    "nextChargeCents": {
                        "type": "integer"
                    },
                    "planCents": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.ModeratorsResponse": {
                "type": "object",
                "properties": {
                    "moderators": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.MoveReleaseRequest": {
                "type": "object",
                "required": [
                    "nostr_d_tag"
                ],
                "properties": {
                    "from_community_id": {
                        "description": "FromCommunityID is the home the caller believes the release has NOW.\nThe move is a compare-and-swap on it: every row must be here, or\nalready at the target (a resumed move); a row anywhere else refuses\nthe whole move.",
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "NostrDTag is the release's d-tag. Colons are legal and ride verbatim.",
                        "type": "string"
                    },
                    "to_community_id": {
                        "description": "ToCommunityID is the home it moves to. The caller must own it, read off\nthe Wavlake relay. Null takes the release back to standalone.",
                        "type": "string"
                    },
                    "track_d_tags": {
                        "description": "TrackDTags names the release's tracks, as a re-home does (#3733): a\ntrack's row is often not linked to the release's record. A PUBLISHED\nnamed row must be the release's own: a track its newest 34139 on the\nWavlake relay lists or, when the relay holds no version of the release\n(taken down, #4364), a track its own record holds. An unpublished one is\nthe caller's draft and moves as named. At most MaxRehomeTrackDTags\nnames; a blank name is ignored.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.MoveReleaseResponse": {
                "type": "object",
                "properties": {
                    "release": {
                        "description": "Release is the moved record, or null for a draft that has none yet.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                            }
                        ]
                    },
                    "tracks_moved": {
                        "description": "TracksMoved counts the track rows whose home changed in this call.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.MusicHeldEvent": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "event_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.MusicPublishItemResult": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "error_code": {
                        "type": "string"
                    },
                    "event_id": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "on_relay": {
                        "description": "OnRelay is true when the relay holds this event, or said OK to it and\ncould not be read back: on a retry, confirm it (confirm_release,\nconfirm_tracks) rather than sign it again. False means it never landed, or\nthe relay read back without it: sign it again.",
                        "type": "boolean"
                    },
                    "published_at": {
                        "description": "PublishedAt is RFC3339, on a track row stamped here.",
                        "type": "string"
                    },
                    "recorded": {
                        "description": "Recorded is false on a release that went out with no release record to\nstamp. A track always has its row.",
                        "type": "boolean"
                    },
                    "relay_reason": {
                        "description": "RelayReason is the relay's own words, for a log: never for a screen.",
                        "type": "string"
                    },
                    "status": {
                        "description": "Status is published, retry or refused.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.MusicPublishRequest": {
                "type": "object",
                "properties": {
                    "confirm_release": {
                        "$ref": "#/components/schemas/internal_handlers.MusicHeldEvent"
                    },
                    "confirm_tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.MusicHeldEvent"
                        }
                    },
                    "release": {
                        "type": "object"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "internal_handlers.MusicPublishResponse": {
                "type": "object",
                "properties": {
                    "complete": {
                        "type": "boolean"
                    },
                    "release": {
                        "$ref": "#/components/schemas/internal_handlers.MusicPublishItemResult"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.MusicPublishItemResult"
                        }
                    }
                }
            },
            "internal_handlers.Nip05AvailabilityResponse": {
                "type": "object",
                "properties": {
                    "status": {
                        "description": "Status is one of \"available\", \"taken\", \"reserved\", \"legacy_reserved\", \"artist_reserved\".",
                        "type": "string"
                    },
                    "username": {
                        "description": "Username is the name asked about, lower-cased and trimmed as the claim does.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.Nip05ResolveResponse": {
                "type": "object",
                "properties": {
                    "canonicalAccountName": {
                        "description": "CanonicalAccountName is the account address selected for this channel in Studio.\nThe channel retains its own slug, which redirects to this address while selected.\nDerived from the name table, independent of the owner's optional profile metadata.",
                        "type": "string"
                    },
                    "communityId": {
                        "description": "CommunityID is set when type is \"community\": the 32-hex id that\n/c/id/<id> and every relay read key on. This is the slug → id half of\nresolution; id → owner is a relay read, by the API and every client alike\n(D71 — there is no GET /v1/communities/{id}).",
                        "type": "string"
                    },
                    "pointsToCommunityId": {
                        "description": "PointsToCommunityID is set on a PERSONAL row the owner has pointed at\none of their communities (D84): `wavlake.com/<name>` should land on\nthat community's page instead of the account page. Routing only — the\nname still answers the account key. Consumed by the PRD (c) Phase 4\npublic routing; absent = the account page.",
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "redirectedFrom": {
                        "description": "RedirectedFrom is set when the requested name was a RETIRED slug and this\nanswer belongs to the community that used to hold it. The client's bare\n`/<old-slug>` redirects on it; it is empty on a direct hit.",
                        "type": "string"
                    },
                    "relays": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "type": "string"
                    },
                    "username": {
                        "description": "Username is the name this answer actually belongs to — the requested one\non a direct hit, the community's current slug after a redirect.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.PaymentReceiptData": {
                "type": "object",
                "properties": {
                    "balance_credits": {
                        "type": "integer"
                    },
                    "receipt": {
                        "$ref": "#/components/schemas/github_com_nbd-wtf_go-nostr.Event"
                    },
                    "settlement": {
                        "$ref": "#/components/schemas/internal_handlers.PaymentSettlementSummary"
                    },
                    "stream_type": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.PaymentReceiptResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/internal_handlers.PaymentReceiptData"
                    },
                    "success": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.PaymentRequest": {
                "type": "object",
                "required": [
                    "stream_session_id"
                ],
                "properties": {
                    "client": {
                        "description": "Client is the reserved client-tag slot (D42): free-form, ≤64 chars,\npersisted for attribution, applies no behavior.",
                        "type": "string"
                    },
                    "contract_version": {
                        "description": "ContractVersion is the contract version the client speaks (§2). 0 (absent)\nis read as v1 while v1 is the only published version.",
                        "type": "integer"
                    },
                    "stream_session_id": {
                        "description": "StreamSessionID is the client-generated UUIDv4 for this play. It is the\nidempotency key: replaying the same (pubkey, dtag, session) never\ndouble-debits.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.PaymentSettlementSummary": {
                "type": "object",
                "properties": {
                    "a": {
                        "description": "A is the track's coordinate, \"36787:<artist-pubkey>:<d-tag>\", the d-tag\nverbatim (it may contain ':').",
                        "type": "string"
                    },
                    "amount": {
                        "description": "Amount is what the play cost, in Unit.",
                        "type": "integer"
                    },
                    "fee_millicents": {
                        "description": "FeeMillicents / NetMillicents are the exact platform fee and the net to\nthe creator in millicents (1/1000 cent). Both are absent when the split is\nnot recorded yet (royalty processing failed and has not been re-driven).",
                        "type": "integer"
                    },
                    "net_millicents": {
                        "type": "integer"
                    },
                    "settled_at": {
                        "description": "SettledAt is when the play was paid for, in Unix seconds: the second a\nreceipt would have been signed at.",
                        "type": "integer"
                    },
                    "unit": {
                        "description": "Unit is \"cent\" (1 credit = 1 US cent).",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ProcessingWebhookData": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.PubkeyStatusResponse": {
                "type": "object",
                "properties": {
                    "linked": {
                        "description": "Linked is true iff the authenticated pubkey has an active row in\nnostr_auth bound to a Firebase user account. False otherwise (no row,\nor row exists but inactive).",
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.PublishTrackResponse": {
                "type": "object",
                "properties": {
                    "published_at": {
                        "description": "RFC3339",
                        "type": "string"
                    },
                    "resurrected": {
                        "description": "always false: a confirm refuses a deleted row (#3620)",
                        "type": "boolean"
                    },
                    "track_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.PutSplitsRequest": {
                "type": "object",
                "properties": {
                    "artist_name": {
                        "type": "string"
                    },
                    "release_title": {
                        "type": "string"
                    },
                    "splits": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.TrackSplitInput"
                        }
                    }
                }
            },
            "internal_handlers.RecapArtistBreakdownResponse": {
                "type": "object",
                "properties": {
                    "artistPubkey": {
                        "type": "string"
                    },
                    "creditsSpent": {
                        "type": "integer"
                    },
                    "streamCount": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.ReconcileDiscrepancy": {
                "type": "object",
                "properties": {
                    "balance_mc": {
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "delta": {
                        "type": "integer"
                    },
                    "event_id": {
                        "type": "integer"
                    },
                    "invite_id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "sum_active_allocs": {
                        "type": "integer"
                    },
                    "sum_events": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.ReconcileResponse": {
                "type": "object",
                "properties": {
                    "checked_at": {
                        "type": "string"
                    },
                    "discrepancies": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.ReconcileDiscrepancy"
                        }
                    },
                    "discrepancy_count": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.RecordPasskeyCredentialData": {
                "type": "object",
                "properties": {
                    "credential_id": {
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "Pubkey is the signing key the credential was recorded for (hex).",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RecordPasskeyCredentialRequest": {
                "type": "object",
                "properties": {
                    "credential_id": {
                        "description": "CredentialID is the WebAuthn credential id the signing key was derived\nfrom, base64url without padding.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RecoverBalanceRequest": {
                "type": "object",
                "required": [
                    "from_pubkey",
                    "idempotency_key",
                    "to_pubkey"
                ],
                "properties": {
                    "from_pubkey": {
                        "type": "string"
                    },
                    "idempotency_key": {
                        "description": "IdempotencyKey makes a retry safe, and is REQUIRED for that reason.\n\nA recovery deactivates the source key, so a naive retry after a dropped\nresponse would fail the both-keys-active anchor check and answer 403 —\nindistinguishable from a genuine ownership failure, on a request that had\nin fact already succeeded. The key is what lets the ledger's replay branch\nrecognize the retry and return the ORIGINAL movement instead.\n\nIt is never used as the ledger reference verbatim; see deriveRecoveryRef.\nClients should generate a UUID per recovery attempt and reuse it across\nretries of that same attempt only.",
                        "type": "string"
                    },
                    "to_pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RecoverBalanceResponse": {
                "type": "object",
                "properties": {
                    "already_owned_purchases": {
                        "description": "AlreadyOwnedPurchases is how many of the old key's purchased tracks the\nnew key already owned; those are retired on the old key rather than\nmoved. The new key owns them either way.",
                        "type": "integer"
                    },
                    "balance_credits": {
                        "description": "BalanceCredits is the destination key's balance after the transfer.",
                        "type": "integer"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "left_behind_credits": {
                        "description": "LeftBehindCredits is subscription money in an already-closed cycle, which\nstays with the old key for the cycle-end sweep. Surfaced so the client can\nsay so plainly instead of silently under-delivering.",
                        "type": "integer"
                    },
                    "moved_credits": {
                        "type": "integer"
                    },
                    "moved_payg_credits": {
                        "type": "integer"
                    },
                    "moved_purchases": {
                        "description": "MovedPurchases is how many purchased tracks moved to the new key\n(design §8.2).",
                        "type": "integer"
                    },
                    "moved_subscription_credits": {
                        "type": "integer"
                    },
                    "replayed": {
                        "description": "Replayed is true when this recovery had already been applied; the amounts\nabove are then the ORIGINAL movement, not a second one.",
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.RecoverableKey": {
                "type": "object",
                "properties": {
                    "balance_credits": {
                        "description": "BalanceCredits is what this key currently holds, in integer credits\n(1 credit == 1 US cent).",
                        "type": "integer"
                    },
                    "is_primary": {
                        "description": "IsPrimary marks the account's primary key, so a client can present the\nothers as recovery candidates without guessing.",
                        "type": "boolean"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "purchases": {
                        "description": "Purchases is how many tracks this key owns through buy-to-own purchases\n(active entitlements, design §8.2): they move with the balance, so a key\nwith no credits and five albums is still worth recovering.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.RefreshTokenRequest": {
                "type": "object",
                "required": [
                    "token"
                ],
                "properties": {
                    "expiration": {
                        "description": "New expiration in minutes",
                        "type": "integer"
                    },
                    "token": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RegisterCommunityRequest": {
                "type": "object",
                "required": [
                    "communityId",
                    "slug"
                ],
                "properties": {
                    "communityId": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RegisterData": {
                "type": "object",
                "properties": {
                    "custom_claims": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "Hex-encoded Nostr public key (64 chars)",
                        "type": "string"
                    },
                    "registered_at": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RegisterRequest": {
                "type": "object",
                "properties": {
                    "firebaseUid": {
                        "description": "FirebaseUID is the account the signer is registering the key to. Required:\nit must equal the token's uid (#4426).",
                        "type": "string"
                    },
                    "pubkey": {
                        "description": "PubKey is the key being registered. Optional; when present it must equal\nthe key that signed the request.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RehomeReleaseRequest": {
                "type": "object",
                "required": [
                    "community_id",
                    "nostr_d_tag"
                ],
                "properties": {
                    "community_id": {
                        "description": "CommunityID is the community the release is being homed in. The caller\nmust be its current owner, read off the Wavlake relay.",
                        "type": "string"
                    },
                    "nostr_d_tag": {
                        "description": "NostrDTag is the live release's d-tag. Colons are legal and ride verbatim.",
                        "type": "string"
                    },
                    "track_d_tags": {
                        "description": "TrackDTags names the release's tracks — its own list, read off the relay\n(#3733). Each of the caller's rows at one of these d-tags is homed with\nthe release even when it was never linked to the release's record: the\nstudio makes a track's row before the release has a record, and a track\nadded to a live release cannot name a record the studio cannot read.\nEvery name must be a track the release lists: the newest version of the\ncaller's 34139 on the Wavlake relay, the caller's own pointers only\n(§4a). One that is not refuses the whole request (400\ntrack_not_in_release).\nOptional; at most MaxRehomeTrackDTags names (more is a 400), and a blank\nname is ignored. Colons are legal and ride verbatim.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.ReleaseHostingCheckoutRequest": {
                "type": "object",
                "required": [
                    "method",
                    "release_d_tag",
                    "track_ids"
                ],
                "properties": {
                    "method": {
                        "description": "Method is \"stripe\" (card), \"earnings\", \"credits\" or \"lightning\".",
                        "type": "string"
                    },
                    "presentation": {
                        "description": "Presentation asks for the card's presentation: \"inline\" for Stripe's form\nin the editor (inline Stripe payments PRD, Phase 4), anything else the\nhosted page. The server decides; the answer's `presentation` says which.",
                        "type": "string"
                    },
                    "release_d_tag": {
                        "type": "string"
                    },
                    "release_title": {
                        "description": "ReleaseTitle names the card line item (\"Hosting for <title>\") and the\nhistory row. Optional.",
                        "type": "string"
                    },
                    "return_origin": {
                        "description": "ReturnOrigin is the card rail's optional allowlisted client origin (the\nsame rule as the hosting top-up's return_origin).",
                        "type": "string"
                    },
                    "track_ids": {
                        "description": "TrackIDs name the release's tracks as the quote's do: each by its ROW\nid or by its own published id (its d-tag).",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.ReleaseHostingQuoteRequest": {
                "type": "object",
                "required": [
                    "release_d_tag",
                    "track_ids"
                ],
                "properties": {
                    "release_d_tag": {
                        "description": "ReleaseDTag is the release's d-tag (colons are legal and ride verbatim).",
                        "type": "string"
                    },
                    "track_ids": {
                        "description": "TrackIDs name the release's tracks, 1–30: each by its ROW id (the id\nPOST /v1/tracks/nostr returned) or by its own published id (its d-tag;\ncolons are legal and ride verbatim). The two differ for a track brought\nover from the legacy catalog. Only the signer's own tracks resolve.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.ReportPublishFailedRequest": {
                "type": "object",
                "required": [
                    "reason"
                ],
                "properties": {
                    "reason": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RetryStuckTracksData": {
                "type": "object",
                "properties": {
                    "migration_claims_reset_count": {
                        "type": "integer"
                    },
                    "permanently_failed_count": {
                        "type": "integer"
                    },
                    "retried_count": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.RevokeTokenRequest": {
                "type": "object",
                "required": [
                    "token"
                ],
                "properties": {
                    "token": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.RotateLiveKeyResponse": {
                "type": "object",
                "properties": {
                    "credentials": {
                        "$ref": "#/components/schemas/internal_handlers.LiveStreamCredentialsResponse"
                    },
                    "stream": {
                        "$ref": "#/components/schemas/internal_handlers.LiveStreamResponse"
                    }
                }
            },
            "internal_handlers.SetAccountNamePointerRequest": {
                "type": "object",
                "properties": {
                    "communityId": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SetGoalRequest": {
                "type": "object",
                "required": [
                    "goalEventId"
                ],
                "properties": {
                    "goalEventId": {
                        "description": "GoalEventID is the published Kind 9041 tip-goal event id (64-char lowercase\nhex). Required — there is no \"clear the goal\" verb; one goal per session.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SetModeratorsRequest": {
                "type": "object",
                "properties": {
                    "moderators": {
                        "description": "Moderators is the complete moderator roster — 64-char lowercase-hex pubkeys.\nNot marked required so an empty array can clear the roster (full-replace).",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.SetPinsRequest": {
                "type": "object",
                "properties": {
                    "pinnedMessageIds": {
                        "description": "PinnedMessageIDs are the Kind 1311 live-chat message ids to pin (64-char\nlowercase hex). Deduped, capped, and hex-validated server-side; empty clears.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.SitemapEntry": {
                "type": "object",
                "properties": {
                    "d_tag": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "integer"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SitemapResponse": {
                "type": "object",
                "properties": {
                    "entries": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.SitemapEntry"
                        }
                    },
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.SparkAddressAuthorization": {
                "type": "object",
                "properties": {
                    "pubkey": {
                        "description": "Nostr owner (hex)",
                        "type": "string"
                    },
                    "sparkPubkey": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SparkAddressAuthorizeRequest": {
                "type": "object",
                "required": [
                    "sparkPubkey",
                    "username"
                ],
                "properties": {
                    "network": {
                        "description": "Network is the wallet's network (`mainnet` | `regtest`), naming the\nwallet binding the request is checked against. Optional: absent is mainnet.",
                        "type": "string"
                    },
                    "scheme": {
                        "description": "Scheme is the wallet's kind (`root-v1` passkey | `words-v1` no passkey),\nrecorded only when this request CREATES the wallet binding. Optional:\nabsent is root-v1. An existing binding's scheme is never changed here.",
                        "type": "string"
                    },
                    "sparkPubkey": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SparkAddressCheckResponse": {
                "type": "object",
                "properties": {
                    "authorized": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.SparkAddressRecoverRequest": {
                "type": "object",
                "required": [
                    "sparkPubkey",
                    "username"
                ],
                "properties": {
                    "network": {
                        "description": "Network is the NEW wallet's network (`mainnet` | `regtest`): the wallet\nbinding re-pointed with the address. Optional: absent is mainnet.",
                        "type": "string"
                    },
                    "scheme": {
                        "description": "Scheme is the NEW wallet's kind (`root-v1` | `words-v1`), recorded when\nthe binding moves to it, so a switch between kinds is recorded. Optional:\nabsent is root-v1. Re-pointing onto the SAME wallet keeps its scheme.",
                        "type": "string"
                    },
                    "sparkPubkey": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SparkAddressRecoverResponse": {
                "type": "object",
                "properties": {
                    "freed": {
                        "type": "boolean"
                    },
                    "sparkPubkey": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SparkAddressResolutionResponse": {
                "type": "object",
                "properties": {
                    "resolves": {
                        "type": "boolean"
                    }
                }
            },
            "internal_handlers.SparkWalletBinding": {
                "type": "object",
                "properties": {
                    "backupCheckedAt": {
                        "description": "BackupCheckedAt is when a backup check last passed in the client;\nabsent until one has. A record, not proof: the server never sees the\nfile or the password.",
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "credentialIds": {
                        "description": "CredentialIDs are passkey credential ids known to hold the wallet:\nhints for pinning a prompt, never proof.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "label": {
                        "description": "wavlake",
                        "type": "string"
                    },
                    "network": {
                        "description": "mainnet | regtest",
                        "type": "string"
                    },
                    "ownerPubkey": {
                        "description": "the account key (hex)",
                        "type": "string"
                    },
                    "rpId": {
                        "description": "RPID is the passkey RP ID the wallet was made under. Absent when the\nbinding was created by authorize/recover, which do not know it (the next\nroot-v1 PUT fills it), and always absent for a words-v1 wallet.",
                        "type": "string"
                    },
                    "scheme": {
                        "description": "root-v1 (passkey) | words-v1 (no passkey)",
                        "type": "string"
                    },
                    "updatedAt": {
                        "type": "string"
                    },
                    "walletIdentity": {
                        "description": "the SDK identity key (33-byte compressed, hex)",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SparkWalletBindingRequest": {
                "type": "object",
                "required": [
                    "label",
                    "network",
                    "scheme",
                    "walletIdentity"
                ],
                "properties": {
                    "backupChecked": {
                        "description": "BackupChecked is true only when the client's backup check just passed;\nonly that stamps backupCheckedAt.",
                        "type": "boolean"
                    },
                    "credentialIds": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "label": {
                        "type": "string"
                    },
                    "network": {
                        "type": "string"
                    },
                    "rpId": {
                        "type": "string"
                    },
                    "scheme": {
                        "type": "string"
                    },
                    "signature": {
                        "type": "string"
                    },
                    "walletIdentity": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SplitRecipientInput": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    },
                    "role": {
                        "description": "Role is artist, producer, label, collaborator or other. Empty: the\nowner is the artist, everyone else a collaborator.",
                        "type": "string"
                    },
                    "weight": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.SplitsResponse": {
                "type": "object",
                "properties": {
                    "splits": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.TrackSplit"
                        }
                    }
                }
            },
            "internal_handlers.SubscriptionCheckoutConfirmRequest": {
                "type": "object",
                "required": [
                    "session_id"
                ],
                "properties": {
                    "session_id": {
                        "type": "string",
                        "example": "cs_test_a1b2c3"
                    }
                }
            },
            "internal_handlers.SubscriptionCheckoutConfirmResponse": {
                "type": "object",
                "properties": {
                    "state": {
                        "type": "string",
                        "example": "active"
                    }
                }
            },
            "internal_handlers.SubscriptionCheckoutRequest": {
                "type": "object",
                "properties": {
                    "apply_credits_cents": {
                        "type": "integer",
                        "example": 400
                    },
                    "presentation": {
                        "type": "string",
                        "example": "inline"
                    },
                    "return_origin": {
                        "type": "string",
                        "example": "https://beta.wavlake.com"
                    }
                }
            },
            "internal_handlers.SubscriptionCheckoutResponse": {
                "type": "object",
                "properties": {
                    "appliedCents": {
                        "type": "integer"
                    },
                    "checkoutUrl": {
                        "type": "string"
                    },
                    "clientSecret": {
                        "type": "string"
                    },
                    "dueTodayCents": {
                        "type": "integer"
                    },
                    "expiresAt": {
                        "type": "integer"
                    },
                    "presentation": {
                        "type": "string"
                    },
                    "sessionId": {
                        "type": "string"
                    },
                    "summary": {
                        "$ref": "#/components/schemas/internal_handlers.MembershipCheckoutSummary"
                    }
                }
            },
            "internal_handlers.SubscriptionRecapResponse": {
                "type": "object",
                "properties": {
                    "artistBreakdown": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.RecapArtistBreakdownResponse"
                        }
                    },
                    "creditsMinted": {
                        "type": "integer"
                    },
                    "creditsUsed": {
                        "type": "integer"
                    },
                    "cycleEnd": {
                        "type": "integer"
                    },
                    "cycleId": {
                        "type": "integer"
                    },
                    "cycleStart": {
                        "type": "integer"
                    },
                    "totalStreams": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.SubscriptionStatusResponse": {
                "type": "object",
                "properties": {
                    "cancelAtPeriodEnd": {
                        "type": "boolean"
                    },
                    "creditsMinted": {
                        "type": "integer"
                    },
                    "creditsRemaining": {
                        "type": "integer"
                    },
                    "creditsSpent": {
                        "type": "integer"
                    },
                    "currentPeriodEnd": {
                        "type": "integer"
                    },
                    "currentPeriodStart": {
                        "type": "integer"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "stripeSubscriptionId": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SwapPrimaryRequest": {
                "type": "object",
                "required": [
                    "pubkey"
                ],
                "properties": {
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.SwapPrimaryResponse": {
                "type": "object",
                "properties": {
                    "new_primary_pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.TermsAcceptanceRequest": {
                "type": "object",
                "properties": {
                    "terms_version": {
                        "description": "TermsVersion is the date the agreed Terms carry, exactly as they show it\n(\"October 16, 2026\").",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.TermsAcceptanceResponse": {
                "type": "object",
                "properties": {
                    "accepted": {
                        "description": "Accepted reports whether the key agreed to that version.",
                        "type": "boolean"
                    },
                    "accepted_at": {
                        "description": "AcceptedAt is when the key first agreed (RFC 3339, UTC); absent unless accepted.",
                        "type": "string"
                    },
                    "terms_version": {
                        "description": "TermsVersion is the version asked about.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.TrackProcessingStatusResponse": {
                "type": "object",
                "properties": {
                    "audio_expired": {
                        "type": "boolean"
                    },
                    "audio_expired_at": {
                        "type": "string"
                    },
                    "audio_expires_at": {
                        "description": "Draft-audio expiry (D63 as amended 2026-09-30). AudioExpiresAt\n(RFC3339) is when an unpublished, unpaid draft's audio files will be\ndeleted — 30 days after upload, whatever its content type; absent once\nthe release is paid for or published, and for migrated catalog.\nAudioExpired is true once they were deleted (AudioExpiredAt says when):\nthe row and its metadata stay, and the track needs its audio again\n(replace-audio) before it can publish.",
                        "type": "string"
                    },
                    "community_id": {
                        "description": "CommunityID is the channel the track's record is in now (its `h` once\nsigned); absent for a record in none. The old-account migration reads it\nto put a release that has never been out into the channel its records\nwere moved to (#5787), on whichever device finishes the run.",
                        "type": "string"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "preview_duration_ms": {
                        "type": "integer"
                    },
                    "preview_end_byte": {
                        "type": "integer"
                    },
                    "processing_error": {
                        "type": "string"
                    },
                    "status": {
                        "description": "\"uploading\" | \"processing\" | \"ready\" | \"failed\"",
                        "type": "string"
                    },
                    "streaming_url": {
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    },
                    "waveform_peaks_base64": {
                        "description": "WaveformPeaksBase64 is the track's waveform peaks (issue #3805),\nstandard base64 of exactly 200 unsigned bytes: the track cut into 200\nequal slices in time order, each byte that slice's loudness scaled so\nthe loudest slice is 255 (a silent track is all zeroes). Present only\nfor a ready track that has peaks, and absent while a replacement file\nis processing. The API generates peaks only while its\nWAVEFORM_PEAKS_ENABLED setting is on, for audio processed from then on:\na track without them is normal, never an error.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.TrackSplitInput": {
                "type": "object",
                "properties": {
                    "recipients": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/internal_handlers.SplitRecipientInput"
                        }
                    },
                    "subject": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.TrackUploadURLRequest": {
                "type": "object",
                "required": [
                    "duration_seconds",
                    "extension",
                    "size_bytes"
                ],
                "properties": {
                    "duration_seconds": {
                        "type": "integer"
                    },
                    "extension": {
                        "type": "string"
                    },
                    "size_bytes": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.TrackUploadURLResponse": {
                "type": "object",
                "properties": {
                    "extension": {
                        "type": "string"
                    },
                    "presigned_url": {
                        "type": "string"
                    },
                    "track_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UnlinkPubkeyData": {
                "type": "object",
                "properties": {
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UnlinkPubkeyRequest": {
                "type": "object",
                "required": [
                    "pubkey"
                ],
                "properties": {
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UnpublishReleaseRequest": {
                "type": "object",
                "required": [
                    "nostr_d_tag"
                ],
                "properties": {
                    "nostr_d_tag": {
                        "description": "NostrDTag is the release's d-tag. Colons are legal and ride verbatim.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UnpublishReleaseResponse": {
                "type": "object",
                "properties": {
                    "release": {
                        "description": "Release is the caller's record as it now stands (unpublished, not for\nsale as a whole), or null when they have none at that d-tag.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.Release"
                            }
                        ]
                    },
                    "tracks_unpublished": {
                        "description": "TracksUnpublished counts the track rows that stopped reading as\npublished in this call: zero on a repeat.",
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.UnpublishedTracksResult": {
                "type": "object",
                "properties": {
                    "trackIds": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "internal_handlers.UpdateImageAssociationRequest": {
                "type": "object",
                "properties": {
                    "associated_entity_id": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UpdateReleasePricingRequest": {
                "type": "object",
                "properties": {
                    "purchase_price_cents": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.UpdateTrackPricingRequest": {
                "type": "object",
                "required": [
                    "access_mode"
                ],
                "properties": {
                    "access_mode": {
                        "type": "string"
                    },
                    "price_credits": {
                        "type": "integer"
                    },
                    "purchase_price_cents": {
                        "type": "integer"
                    }
                }
            },
            "internal_handlers.UpsertBackupRequest": {
                "type": "object",
                "required": [
                    "metadata"
                ],
                "properties": {
                    "event_created_at": {
                        "type": "integer"
                    },
                    "event_id": {
                        "description": "EventID is the backed-up event's id, 64 hex characters. Optional: with\nit, a same-second tie resolves to the lower id (strfry's rule); without\nit, a same-second backup keeps the stored one.",
                        "type": "string"
                    },
                    "metadata": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "nostr_d_tag": {
                        "type": "string"
                    },
                    "nostr_kind": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UpsertNip05Request": {
                "type": "object",
                "required": [
                    "username"
                ],
                "properties": {
                    "pubkey": {
                        "type": "string"
                    },
                    "relays": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.UserMetadataResponse": {
                "type": "object",
                "properties": {
                    "albums": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyAlbum"
                        }
                    },
                    "artists": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyArtist"
                        }
                    },
                    "pictures_not_copied": {
                        "description": "PicturesNotCopied is true when the account's or an artist's picture could\nnot be copied to Wavlake on this read. That picture's artwork_url is empty,\nnever the old CDN's address; a later read tries again.",
                        "type": "boolean"
                    },
                    "tracks": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyTrack"
                        }
                    },
                    "user": {
                        "$ref": "#/components/schemas/github_com_wavlake_monorepo_internal_models.LegacyUser"
                    }
                }
            },
            "internal_handlers.ValidateTokenRequest": {
                "type": "object",
                "required": [
                    "path",
                    "token"
                ],
                "properties": {
                    "path": {
                        "type": "string"
                    },
                    "token": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.emailTestRequest": {
                "type": "object",
                "properties": {
                    "template": {
                        "type": "string"
                    },
                    "to": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.emailTestResponse": {
                "type": "object",
                "properties": {
                    "sent": {
                        "type": "boolean"
                    },
                    "template": {
                        "type": "string"
                    },
                    "to": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.generousPoolRequest": {
                "type": "object",
                "properties": {
                    "dry_run": {
                        "description": "DryRun computes the complete plan and writes NOTHING.\n\nThe first real disposition of this pool is roughly three months after\nlaunch, and the endpoint ships with no active scheduled job (see the\nhandler doc), so the normal first invocation is an operator running the\ndry run and reading the plan. Same period arithmetic, same weighting\nquery, same freeze gate, same seam — the only difference is that the pool\ntotal is read without the row lock and is therefore advisory.",
                        "type": "boolean"
                    },
                    "quarter": {
                        "description": "Quarter is a calendar-quarter key (\"2026Q3\"). Omitted means the most\nrecent CLOSED quarter.\n\nA quarter that has not ended is REFUSED rather than served: the run marker\nis terminal, so distributing an open quarter would both weight against a\npartial window and make the rest of that quarter's listening permanently\nunpayable.",
                        "type": "string"
                    },
                    "tenant_id": {
                        "description": "TenantID defaults to models.DefaultTenantID.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.generousSweepRequest": {
                "type": "object",
                "properties": {
                    "dry_run": {
                        "description": "DryRun computes the complete plan and writes NOTHING.\n\nThis is not a convenience on a money-TAKING job that runs unattended: it\nis the only way to see what a sweep is about to do to real listeners\nbefore it does it. Same enumeration, same fraud gate, same allocator — the\nonly difference is that no transaction opens.",
                        "type": "boolean"
                    },
                    "limit": {
                        "description": "Limit bounds how many due cycles this invocation may process.\nOmitted or <= 0 means services.DefaultGenerousSweepLimit (200); the\nservice clamps anything above MaxGenerousSweepLimit. A run that hits the\nlimit reports `truncated: true`, so a bounded run can never be mistaken\nfor \"there was nothing left to do\".",
                        "type": "integer"
                    },
                    "tenant_id": {
                        "description": "TenantID defaults to models.DefaultTenantID.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.migrationResetRequest": {
                "type": "object",
                "properties": {
                    "dry_run": {
                        "description": "DryRun computes the COMPLETE plan and writes nothing. The same\nstatements run inside a transaction that is rolled back, so the counts\nare the counts a real reset would produce.\n\nA reset is destructive and irreversible on the relay half, so the\nexpected operator sequence is dry run → read the plan → run it for\nreal, exactly like the generous-mode jobs and the takedown levers.",
                        "type": "boolean"
                    },
                    "firebase_uid": {
                        "type": "string"
                    },
                    "pubkey": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.monthlyPayoutCronRequest": {
                "type": "object",
                "properties": {
                    "dry_run": {
                        "description": "DryRun, when true, computes eligible artists without creating payouts.",
                        "type": "boolean"
                    },
                    "method": {
                        "description": "Method limits the run to artists whose saved payout method is this one:\n\"lightning\" (the daily job, $1 floor) or \"ach\" (the monthly bank job,\n$5 floor). Empty runs every method at the $5 floor.",
                        "type": "string"
                    },
                    "tenant_id": {
                        "description": "TenantID defaults to models.DefaultTenantID when empty.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.royaltyRedriveRequest": {
                "type": "object",
                "properties": {
                    "dry_run": {
                        "description": "DryRun lists the plan and calls the engine for nothing.",
                        "type": "boolean"
                    },
                    "limit": {
                        "description": "Limit caps the batch (default 200, max 1000).",
                        "type": "integer"
                    },
                    "min_age_minutes": {
                        "description": "MinAgeMinutes leaves rows younger than this alone (default 5). 0 is\nallowed and means \"now\" — only for a quiesced service.",
                        "type": "integer"
                    },
                    "since": {
                        "description": "Since is an RFC3339 lower bound on created_at.",
                        "type": "string"
                    },
                    "stream_event_ids": {
                        "description": "StreamEventIDs restricts the batch to these rows.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "tenant_id": {
                        "description": "TenantID restricts to one tenant; empty means every tenant.",
                        "type": "string"
                    }
                }
            },
            "internal_handlers.sentryTestResponse": {
                "type": "object",
                "properties": {
                    "emitted": {
                        "type": "boolean"
                    },
                    "mode": {
                        "type": "string"
                    }
                }
            },
            "internal_handlers.stripeConnectNotReadyResponse": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    },
                    "resume_url": {
                        "type": "string"
                    }
                }
            }
        }
    }
}