{
  "openapi": "3.1.0",
  "info": {
    "title": "Manifest API",
    "version": "0.1.0",
    "description": "Manifest is an unofficial project and is not affiliated with, endorsed by, or sponsored by Bandai. Card names, card text and card images are © their respective owners; images are reproduced for card identification only. No price data is collected or served."
  },
  "tags": [
    {
      "name": "Cards",
      "description": "Game objects: stats and text, the same in every language."
    },
    {
      "name": "Printings",
      "description": "Each physical version of a card, in one language."
    },
    {
      "name": "Sets",
      "description": "Products: boosters, decks and promos."
    },
    {
      "name": "Meta",
      "description": "Service status."
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Set": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Manifest id; never changes or gets reused"
          },
          "code": {
            "type": "string",
            "description": "official product code, e.g. OP-01, or a slug for promos"
          },
          "type": {
            "type": "string",
            "enum": [
              "booster",
              "extra_booster",
              "starter_deck",
              "premium_booster",
              "promo",
              "other_product"
            ]
          },
          "names": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "name in each language the product was released in"
          },
          "release_dates": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "release date (YYYY-MM-DD) per language"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        },
        "required": [
          "id",
          "code",
          "type",
          "names",
          "release_dates",
          "verification",
          "provenance"
        ]
      },
      "Verification": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "verified",
              "auto_resolved",
              "flagged"
            ],
            "description": "verified: every check agrees; auto_resolved: decided by a rule; flagged: ambiguous"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "why it was auto_resolved or flagged"
          }
        },
        "required": [
          "status",
          "reason"
        ],
        "description": "flagged records ship, marked with a reason"
      },
      "Provenance": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "source_url": {
              "type": "string",
              "description": "official page the record was built from"
            },
            "retrieved_at": {
              "type": "string",
              "description": "when that page was fetched"
            },
            "content_hash": {
              "type": "string",
              "description": "sha256 of the page as fetched"
            }
          },
          "required": [
            "source_url",
            "retrieved_at",
            "content_hash"
          ]
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "bad_request, unauthorized, not_found, rate_limited or internal"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Card": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Manifest id; never changes or gets reused"
          },
          "number": {
            "type": "string",
            "description": "official card number, e.g. OP01-120"
          },
          "category": {
            "type": "string",
            "enum": [
              "leader",
              "character",
              "event",
              "stage",
              "don"
            ]
          },
          "colors": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "red",
                "green",
                "blue",
                "purple",
                "black",
                "yellow"
              ]
            }
          },
          "cost": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null for leaders"
          },
          "life": {
            "type": [
              "integer",
              "null"
            ],
            "description": "leaders only"
          },
          "power": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null for events and stages"
          },
          "counter": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null when the card shows -"
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "slash",
                "strike",
                "ranged",
                "special",
                "wisdom",
                "unknown"
              ]
            }
          },
          "block_icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "rotation block of the base printing"
          },
          "localizations": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CardLocalization"
            },
            "description": "name, traits and text per language, keyed by language code"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        },
        "required": [
          "id",
          "number",
          "category",
          "colors",
          "cost",
          "life",
          "power",
          "counter",
          "attributes",
          "block_icon",
          "localizations",
          "verification",
          "provenance"
        ]
      },
      "CardLocalization": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "traits, e.g. The Four Emperors"
          },
          "effect": {
            "type": [
              "string",
              "null"
            ],
            "description": "effect text; null when the card has none"
          },
          "trigger": {
            "type": [
              "string",
              "null"
            ],
            "description": "trigger text; null when the card has none"
          }
        },
        "required": [
          "name",
          "types",
          "effect",
          "trigger"
        ]
      },
      "CardDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Card"
          },
          {
            "type": "object",
            "properties": {
              "printings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Printing"
                },
                "description": "every printing, in every language"
              }
            },
            "required": [
              "printings"
            ]
          }
        ]
      },
      "Printing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Manifest id; never changes or gets reused"
          },
          "card_id": {
            "type": "string",
            "description": "the card this is a printing of"
          },
          "card_number": {
            "type": "string",
            "description": "e.g. OP01-120"
          },
          "lang": {
            "type": "string",
            "description": "en or ja"
          },
          "set_id": {
            "type": "string",
            "description": "the product it was released in"
          },
          "set_code": {
            "type": "string",
            "description": "e.g. OP-01"
          },
          "rarity": {
            "type": "string",
            "enum": [
              "L",
              "C",
              "UC",
              "R",
              "SR",
              "SEC",
              "SP",
              "TR",
              "P"
            ]
          },
          "block_icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "rotation block printed on this printing"
          },
          "variant_type": {
            "type": "string",
            "enum": [
              "base",
              "parallel",
              "manga",
              "special",
              "treasure_rare",
              "promo",
              "stamped",
              "reprint"
            ]
          },
          "official_id": {
            "type": "string",
            "description": "Bandai's id for this printing, e.g. OP01-120_p1"
          },
          "image_url": {
            "type": "string",
            "description": "card image, served from Manifest's image storage"
          },
          "official_image_url": {
            "type": "string",
            "description": "the same image on Bandai's site"
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD in this language"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "official remarks, such as errata"
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "shared by the English and Japanese versions of the same printing"
          },
          "single_language": {
            "type": "boolean",
            "description": "true when it exists in only one language"
          },
          "external_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalId"
            },
            "description": "ids on CardTrader, TCGplayer and Cardmarket, when known"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          }
        },
        "required": [
          "id",
          "card_id",
          "card_number",
          "lang",
          "set_id",
          "set_code",
          "rarity",
          "block_icon",
          "variant_type",
          "official_id",
          "image_url",
          "official_image_url",
          "release_date",
          "notes",
          "group_id",
          "single_language",
          "external_ids",
          "verification",
          "provenance"
        ]
      },
      "ExternalId": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "cardtrader",
              "tcgplayer",
              "cardmarket"
            ]
          },
          "external_id": {
            "type": "string",
            "description": "the id on that marketplace"
          },
          "source": {
            "type": "string",
            "description": "where the mapping came from"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium"
            ]
          }
        },
        "required": [
          "provider",
          "external_id",
          "source",
          "confidence"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/v1/sets": {
      "get": {
        "tags": [
          "Sets"
        ],
        "summary": "List sets",
        "description": "Every product, ordered by code. With lang=en, only products released in English.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja",
                "all"
              ],
              "default": "all",
              "description": "one language, or all of them"
            },
            "required": false,
            "description": "one language, or all of them",
            "name": "lang",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "the next_cursor of the previous page"
            },
            "required": false,
            "description": "the next_cursor of the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Sets ordered by code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Set"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "pass it as ?cursor= for the next page; null on the last page"
                        },
                        "limit": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "limit"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sets/{id}": {
      "get": {
        "tags": [
          "Sets"
        ],
        "summary": "Get a set",
        "description": "One product, by Manifest id or by code, e.g. OP-01.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Manifest id (or code/number)"
            },
            "required": true,
            "description": "Manifest id (or code/number)",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja",
                "all"
              ],
              "default": "all",
              "description": "one language, or all of them"
            },
            "required": false,
            "description": "one language, or all of them",
            "name": "lang",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Set"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cards": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "List cards",
        "description": "Cards are game objects: stats are the same in every language, and names and text come per language. Ordered by number.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "set id or code"
            },
            "required": false,
            "description": "set id or code",
            "name": "set",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "red",
                "green",
                "blue",
                "purple",
                "black",
                "yellow"
              ]
            },
            "required": false,
            "name": "color",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "leader",
                "character",
                "event",
                "stage",
                "don"
              ]
            },
            "required": false,
            "name": "category",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "exact card number"
            },
            "required": false,
            "description": "exact card number",
            "name": "number",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 2,
              "description": "name contains"
            },
            "required": false,
            "description": "name contains",
            "name": "name",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja",
                "all"
              ],
              "default": "all",
              "description": "one language, or all of them"
            },
            "required": false,
            "description": "one language, or all of them",
            "name": "lang",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "the next_cursor of the previous page"
            },
            "required": false,
            "description": "the next_cursor of the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Cards ordered by number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Card"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "pass it as ?cursor= for the next page; null on the last page"
                        },
                        "limit": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "limit"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cards/{id}": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Get a card",
        "description": "One card, by Manifest id or by number, e.g. OP01-120, with every printing of it.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Manifest id (or code/number)"
            },
            "required": true,
            "description": "Manifest id (or code/number)",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja",
                "all"
              ],
              "default": "all",
              "description": "one language, or all of them"
            },
            "required": false,
            "description": "one language, or all of them",
            "name": "lang",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/printings": {
      "get": {
        "tags": [
          "Printings"
        ],
        "summary": "List printings",
        "description": "A printing is one physical version of a card, in one language, released in one product. Ordered by official id, then language.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "card id or number"
            },
            "required": false,
            "description": "card id or number",
            "name": "card",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "set id or code"
            },
            "required": false,
            "description": "set id or code",
            "name": "set",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja",
                "all"
              ],
              "default": "all",
              "description": "one language, or all of them"
            },
            "required": false,
            "description": "one language, or all of them",
            "name": "lang",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "L",
                "C",
                "UC",
                "R",
                "SR",
                "SEC",
                "SP",
                "TR",
                "P"
              ]
            },
            "required": false,
            "name": "rarity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "base",
                "parallel",
                "manga",
                "special",
                "treasure_rare",
                "promo",
                "stamped",
                "reprint"
              ]
            },
            "required": false,
            "name": "variant",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "the next_cursor of the previous page"
            },
            "required": false,
            "description": "the next_cursor of the previous page",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Printings ordered by official id, then language",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Printing"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "pass it as ?cursor= for the next page; null on the last page"
                        },
                        "limit": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "limit"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/printings/{id}": {
      "get": {
        "tags": [
          "Printings"
        ],
        "summary": "Get a printing",
        "description": "One printing, by Manifest id.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Manifest id (or code/number)"
            },
            "required": true,
            "description": "Manifest id (or code/number)",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The printing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Printing"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/lookup": {
      "get": {
        "tags": [
          "Printings"
        ],
        "summary": "Look up a marketplace id",
        "description": "Finds the printings behind a CardTrader, TCGplayer or Cardmarket id.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "cardtrader",
                "tcgplayer",
                "cardmarket"
              ]
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching printings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Printing"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Check health",
        "description": "Needs no API key. Answers 503 when the database is unreachable.",
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "database": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "error"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "database"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Database unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "database": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "error"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "database"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}
