{
    "openapi": "3.0.0",
    "info": {
        "title": "Manasuite API v1",
        "description": "Public and internal endpoints for the Manasuite iOS/macOS app and admin tools.",
        "contact": {
            "name": "Jan-Hendrik Damerau",
            "email": "jan.damerau@gmail.com"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.manasuite.com",
            "description": "Production"
        }
    ],
    "paths": {
        "/banned_cards": {
            "get": {
                "tags": [
                    "BannedCards"
                ],
                "summary": "List all currently banned or restricted cards",
                "description": "Reads the pre-built banned cards JSON file. No database access on this path.",
                "operationId": "6a703191122a934a3654b4b8ff9103ba",
                "responses": {
                    "200": {
                        "description": "Active banned/restricted cards, one entry per card",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Banned cards list is not available"
                    }
                }
            }
        },
        "/card_sets": {
            "get": {
                "tags": [
                    "Card Sets"
                ],
                "summary": "List all Magic: The Gathering card sets including Secret Lair",
                "description": "Returns all Magic: The Gathering sets and Secret Lair drops from cache or database.",
                "operationId": "1dada8d532a3ff63b0ec000a6fef1584",
                "responses": {
                    "200": {
                        "description": "List of all card sets retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "code": {
                                                "type": "string",
                                                "example": "dmr"
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Dominaria Remastered"
                                            },
                                            "set_type": {
                                                "type": "string",
                                                "example": "remaster"
                                            },
                                            "released_at": {
                                                "type": "string",
                                                "format": "date",
                                                "example": "2023-01-13"
                                            },
                                            "parent_set_code": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "image_portrait_url": {
                                                "type": "string",
                                                "format": "uri",
                                                "nullable": true
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error while fetching card sets"
                    }
                }
            }
        },
        "/card_sets/{code}": {
            "get": {
                "tags": [
                    "Card Sets"
                ],
                "summary": "Show details of a specific Magic: The Gathering or Secret Lair set",
                "description": "Returns detailed information for a specific card set. Supports regular MTG sets and Secret Lair drops (e.g., 'sld-42').",
                "operationId": "2d71027c408c5f882ebefd1910907663",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Unique set code (e.g., 'dmr', 'sld-42', 'slc-1')",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "dmr"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Card set details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Card set not found"
                    }
                }
            }
        },
        "/releases": {
            "get": {
                "tags": [
                    "Releases"
                ],
                "summary": "List all upcoming or current Magic: The Gathering and Secret Lair releases",
                "description": "Returns grouped upcoming or current releases for both MTG and Secret Lair, grouped by release date.",
                "operationId": "c959e66ffba043b1df9c4b082ffd2ec1",
                "responses": {
                    "200": {
                        "description": "List of MTG and SLD releases retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "mtg": {
                                            "description": "Magic: The Gathering releases",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "sld": {
                                            "description": "Secret Lair releases (SLD and SLC)",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/news": {
            "get": {
                "tags": [
                    "News"
                ],
                "summary": "List the current daily news items",
                "description": "Reads the pre-built news JSON file for the requested language. No parameter or an unknown language always returns the English file.",
                "operationId": "e36e98a419d5bf53cfa9a69a3da0f875",
                "parameters": [
                    {
                        "name": "language",
                        "in": "query",
                        "description": "App language code, e.g. de, en, da, la, ja. Unknown or omitted falls back to English.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "News items for the resolved language, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/news/{id}": {
            "get": {
                "tags": [
                    "News"
                ],
                "summary": "Show a single news item",
                "description": "Filters the same pre-built language file used by the list endpoint - no database access.",
                "operationId": "1a73d6d973ffec9c2de174fce63d870c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "News item found"
                    },
                    "404": {
                        "description": "News item not found"
                    }
                }
            }
        },
        "/play_formats": {
            "get": {
                "tags": [
                    "Play Formats"
                ],
                "summary": "List all play formats including their construction rules",
                "description": "Returns the active play formats in display order. Formats without\n     *                  rules are included and simply produce no deck validation.",
                "operationId": "f1bc22196e2c120aa6b489cb97e0c4b1",
                "responses": {
                    "200": {
                        "description": "List of play formats retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "slug": {
                                                "type": "string",
                                                "example": "commander"
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Commander / EDH"
                                            },
                                            "mainboard": {
                                                "properties": {
                                                    "bound": {
                                                        "type": "string",
                                                        "example": "exact"
                                                    },
                                                    "value": {
                                                        "type": "integer",
                                                        "example": 99
                                                    }
                                                },
                                                "type": "object",
                                                "nullable": true
                                            },
                                            "commanders": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "signature_spells": {
                                                "type": "integer",
                                                "example": 0
                                            },
                                            "max_sideboard": {
                                                "type": "integer",
                                                "example": 15,
                                                "nullable": true
                                            },
                                            "copy_limit": {
                                                "example": "singleton"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not modified, the cached list is still valid"
                    }
                }
            }
        },
        "/secret_lair": {
            "get": {
                "tags": [
                    "SecretLair"
                ],
                "summary": "List all Secret Lair cards (from minimized cache if available)",
                "operationId": "4c6e1f484d4e8a2fd91be0a66bbabd8d",
                "responses": {
                    "200": {
                        "description": "Successful operation – returns cached minimized cards"
                    },
                    "404": {
                        "description": "Cache not found"
                    }
                }
            }
        },
        "/secret_lair/card/{collector_number}": {
            "get": {
                "tags": [
                    "SecretLair"
                ],
                "summary": "Get a specific Secret Lair card by collector number",
                "operationId": "eab1b636eba5fc15bed62ab10e311e70",
                "parameters": [
                    {
                        "name": "collector_number",
                        "in": "path",
                        "description": "Collector number of the card",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Card found"
                    },
                    "404": {
                        "description": "Card not found"
                    }
                }
            }
        },
        "/secret_lair/sets": {
            "get": {
                "tags": [
                    "SecretLair"
                ],
                "summary": "List all Secret Lair sets",
                "operationId": "15fa965937221c30b52115c2e8f5a243",
                "responses": {
                    "200": {
                        "description": "List of Secret Lair sets retrieved successfully"
                    },
                    "500": {
                        "description": "Server error while fetching sets"
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "SecretLair",
            "description": "Endpoints for Secret Lair cards and cache access"
        },
        {
            "name": "BannedCards",
            "description": "BannedCards"
        },
        {
            "name": "Card Sets",
            "description": "Card Sets"
        },
        {
            "name": "Releases",
            "description": "Releases"
        },
        {
            "name": "News",
            "description": "News"
        },
        {
            "name": "Play Formats",
            "description": "Play Formats"
        }
    ]
}