{"openapi":"3.1.0","info":{"title":"GatheRs API","version":"v0.9.2-rc1"},"paths":{"/api/mtg/cards/search":{"post":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":10,"minimum":0},"style":"form"},{"in":"query","name":"skip","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/APICard"}}}}}}}},"/api/mtg/cards/random":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICard"}}}}}}},"/api/mtg/cards":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/APICard"}}}}}}}},"/api/mtg/sets":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Set"}}}}}}}},"/api/mtg/meta":{"get":{"responses":{"200":{"description":"Everything a game's search can be narrowed by, in one call: the values its\nset, card type and grouping filters accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APISystemMeta"}}}}}}},"/api/mtg/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/mtg/prices":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CardPrices"}}}}}}}},"/api/mtg/prices/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/riftbound/cards/search":{"post":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":10,"minimum":0},"style":"form"},{"in":"query","name":"skip","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/APIRiftboundCard"}}}}}}}},"/api/riftbound/cards/random":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIRiftboundCard"}}}}}}},"/api/riftbound/cards":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/APIRiftboundCard"}}}}}}}},"/api/riftbound/sets":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/api/riftbound/meta":{"get":{"responses":{"200":{"description":"Everything a game's search can be narrowed by, in one call: the values its\nset, card type and grouping filters accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APISystemMeta"}}}}}}},"/api/riftbound/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/riftbound/prices":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CardPrices"}}}}}}}},"/api/riftbound/prices/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/pokemon/cards/search":{"post":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"skip","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/APIPokemonCard"}}}}}}}},"/api/pokemon/cards/random":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIPokemonCard"}}}}}}},"/api/pokemon/cards":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/APIPokemonCard"}}}}}}}},"/api/pokemon/sets":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Set"}}}}}}}},"/api/pokemon/meta":{"get":{"responses":{"200":{"description":"Everything a game's search can be narrowed by, in one call: the values its\nset, card type and grouping filters accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APISystemMeta"}}}}}}},"/api/pokemon/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/pokemon/prices":{"get":{"parameters":[{"in":"query","name":"ids","schema":{"type":"array","default":[],"items":{"type":"string"}},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CardPrices"}}}}}}}},"/api/pokemon/prices/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/collection/list":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionListEntry"}}}}}}}},"/api/collection/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionAddResponse"}}}}}}},"/api/collection/remove/{id}":{"post":{"parameters":[{"in":"query","name":"keepCardsInCollection","description":"Move the collection's cards (and their purchase history) here instead\nof deleting them. Empty or omitted deletes them.","schema":{"description":"Move the collection's cards (and their purchase history) here instead\nof deleting them. Empty or omitted deletes them.","type":["string","null"],"default":null},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionRemoveResponse"}}}}}}},"/api/collection/rename/{id}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionRenameRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}}}},"/api/collection/kind/{id}":{"post":{"requestBody":{"description":"Converts a collection to a deck or back.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionKindChange"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}}}},"/api/collection/move/{id}":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionCard"}}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"null"}}}}}}},"/api/collection/share/{id}":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ShareLinkResponse"}}}}}}},"post":{"responses":{"200":{"description":"A shareable, read-only link granting public access to a collection via\nits opaque `token`. Owner-managed: created and revoked explicitly through\nthe `/collection/share/{id}` endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareLinkResponse"}}}}}}},"/api/collection/share/{id}/{token}":{"delete":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareLinkRevokeResponse"}}}}}}},"/api/collection/cards/{id}/list":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"provider","description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","schema":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"style":"form"},{"in":"query","name":"providers","description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","schema":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"style":"form"},{"in":"query","name":"sort_by","schema":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"style":"form"},{"in":"query","name":"sort_order","schema":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionCard"}}}}}}}},"/api/collection/cards/{id}/count":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"provider","description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","schema":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"style":"form"},{"in":"query","name":"providers","description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","schema":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"style":"form"},{"in":"query","name":"sort_by","schema":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"style":"form"},{"in":"query","name":"sort_order","schema":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"style":"form"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"integer","format":"uint","minimum":0}}}}}}},"/api/collection/cards/{id}/search":{"post":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"provider","description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","schema":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"style":"form"},{"in":"query","name":"providers","description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","schema":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"style":"form"},{"in":"query","name":"sort_by","schema":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"style":"form"},{"in":"query","name":"sort_order","schema":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionCard"}}}}}}}},"/api/collection/cards/{id}/search/count":{"post":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"provider","description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","schema":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"style":"form"},{"in":"query","name":"providers","description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","schema":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"style":"form"},{"in":"query","name":"sort_by","schema":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"style":"form"},{"in":"query","name":"sort_order","schema":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"integer","format":"uint","minimum":0}}}}}}},"/api/collection/search":{"post":{"parameters":[{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"page_size","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"}],"requestBody":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APICardSearchFilters"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResultCard"}}}}}}}},"/api/collection/cards/{id}/add":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardToAdd"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionCard"}}}}}}}},"/api/collection/cards/{id}/delete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardToAdd"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollectionCard"}}}}}}}},"/api/collection/cards/{id}/want":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustWantQuantityRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionCard"}}}}}}},"/api/collection/cards/{id}/purchase_history/{card_uuid}":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseHistoryResponse"}}}}}}},"/api/collection/cards/{id}/purchase_history":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionAllPurchaseHistoryResponse"}}}}}}},"/api/collection/cards/{id}/purchase_history_entry/{entry_id}":{"delete":{},"patch":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePurchaseEntryBody"}}},"required":true}}},"/api/collection/cards/{id}/value_breakdown":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionValueBreakdown"}}}}}}},"/api/collection/cards/{id}/value_history":{"get":{"parameters":[{"in":"query","name":"since","description":"Only days on or after this one (UTC, `YYYY-MM-DD`). Omitted means\nall recorded history.","schema":{"description":"Only days on or after this one (UTC, `YYYY-MM-DD`). Omitted means\nall recorded history.","type":["string","null"],"format":"date","default":null},"style":"form"}],"responses":{"200":{"description":"What the cards currently owned in a collection were worth on each day\nprice history has, at the prices they're valued at today (see\n`CollectionValueBreakdown`): each card's history is read from the\nretailer it's valued at now, so the last point lines up with the\ncollection's current total. Copies since sold or moved away are not\nincluded — this is the value over time of what's held now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionValueHistory"}}}}}}},"/api/collection/cards/{id}/value_cards":{"get":{"parameters":[{"in":"query","name":"days","description":"How many days back `past_price` looks. Default 30.","schema":{"description":"How many days back `past_price` looks. Default 30.","type":["integer","null"],"format":"uint32","default":null,"minimum":0},"style":"form"}],"responses":{"200":{"description":"Every owned, priced entry of a collection with what it's worth, what it\ncost and how its price moved — most valuable first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionValueCards"}}}}}}},"/api/collection/price_history/{provider}/{card_uuid}":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceHistoryResponse"}}}}}}},"/api/collection/csv_layouts":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CsvLayoutsInfo"}}}}}}},"/api/deck/cards/{id}/list":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckCard"}}}}}}}},"/api/deck/cards/{id}/count":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"integer","format":"int64"}}}}}}},"/api/deck/cards/{id}/value_breakdown":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionValueBreakdown"}}}}}}},"/api/deck/cards/{id}/adjust":{"post":{"requestBody":{"description":"A change applied to one card on one board.\n\nPositive adds copies, negative removes them; each count is floored at zero. The two counts move\nindependently, so a copy can be acquired by sending `quantity: 1, wantQuantity: -1`.\n\nAdding to a board the deck hasn't got declares it, board names being free-form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckCardAdjustment"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DeckCard"},{"type":"null"}]}}}}}}},"/api/deck/cards/{id}/move":{"post":{"requestBody":{"description":"Moves copies of a card from one of a deck's boards to another.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckCardMove"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckCard"}}}}}}}},"/api/deck/cards/{id}/transfer":{"post":{"requestBody":{"description":"Moves copies of a card between a collection and one of a deck's boards.\n\nA transfer rather than an allocation: the copies leave wherever they came from. Allocating a\ncard to a deck while keeping it in the collection is what the adjust endpoint is for.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckCardTransfer"}}},"required":true},"responses":{"200":{"description":"How many copies a transfer actually moved, which is capped at what the source holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckCardTransferResult"}}}}}}},"/api/deck/boards/{id}":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckBoard"}}}}}}},"put":{"requestBody":{"description":"Renames one of a deck's boards, taking its cards with it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardRename"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckBoard"}}}}}}},"post":{"requestBody":{"description":"Adds a board to a deck. Already having one by that name is a no-op.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardCreate"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckBoard"}}}}}}}},"/api/deck/boards/{id}/order":{"post":{"requestBody":{"description":"Sets the order of a deck's boards.\n\nBoards left out keep their place after the ones listed, so a partial order can't drop one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardReorder"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckBoard"}}}}}}}},"/api/deck/boards/{id}/{board}":{"delete":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeckBoard"}}}}}}}},"/api/deck/meta/{id}":{"get":{"responses":{"200":{"description":"Whether a deck is physically assembled, and where it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckMeta"}}}}}},"put":{"requestBody":{"description":"Whether a deck is physically assembled, and where it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckMeta"}}},"required":true},"responses":{"200":{"description":"Whether a deck is physically assembled, and where it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeckMeta"}}}}}}},"/api/cards/availability":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CardAvailability"}}}}}}}},"/api/share/{token}":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","format":"uint","default":24,"minimum":0},"style":"form"},{"in":"query","name":"offset","schema":{"type":"integer","format":"uint","default":0,"minimum":0},"style":"form"},{"in":"query","name":"provider","description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","schema":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"style":"form"},{"in":"query","name":"providers","description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","schema":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"style":"form"},{"in":"query","name":"sort_by","schema":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"style":"form"},{"in":"query","name":"sort_order","schema":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"style":"form"}],"responses":{"200":{"description":"A page of full card data for a shareable, read-only collection view.\nEach entry in `cards` merges the collection entry (quantity, provider, ...)\nwith the full card details, so the client needs a single request per page\ninstead of a separate card-detail lookup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCollectionPage"}}}}}}},"/api/settings":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerConfig"}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerConfig"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerConfig"}}}}}}},"/api/settings/restart":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestartResponse"}}}}}}},"/api/settings/env_overrides":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EnvOverride"}}}}}}}},"/api/plugins":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PluginSummary"}}}}}}}},"/api/plugins/{name}/search":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PluginCard"}}}}}}}},"/api/plugins/{name}/cards/by-ids":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PluginCard"}}}}}}}},"/api/plugins/{name}/update":{"post":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/api/system":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfo"}}}}}}}},"components":{"schemas":{"APICard":{"type":"object","properties":{"artist":{"type":"string"},"borderColor":{"type":"string"},"cardIdentifiers":{"$ref":"#/components/schemas/APICardIdentifiers"},"collectorNumber":{"type":"string"},"colorIdentity":{"type":"array","items":{"$ref":"#/components/schemas/APICardColour"}},"colors":{"type":"array","items":{"$ref":"#/components/schemas/APICardColour"}},"defense":{"type":["string","null"]},"finishes":{"type":"array","items":{"type":"string"}},"flavorText":{"type":["string","null"]},"frameEffects":{"type":"array","items":{"type":"string"}},"id":{"type":"string"},"isFullArt":{"type":"boolean"},"isPromo":{"type":"boolean"},"isReprint":{"type":"boolean"},"isReserved":{"type":"boolean"},"keywords":{"type":"array","items":{"type":"string"}},"legalities":{"type":"object","additionalProperties":{"type":"string"}},"loyalty":{"type":["string","null"]},"manaCost":{"type":"string"},"manaValue":{"type":"number","format":"double"},"name":{"type":"string"},"power":{"type":["string","null"]},"rarity":{"$ref":"#/components/schemas/APIRarity"},"setCode":{"type":"string"},"setName":{"type":"string"},"text":{"type":"string"},"toughness":{"type":["string","null"]},"typeLine":{"type":"string"},"watermark":{"type":["string","null"]}},"required":["id","name","setCode","collectorNumber","rarity","artist","colorIdentity","text","cardIdentifiers","manaCost","manaValue","typeLine","keywords","colors","legalities","finishes","isReserved","isPromo","isReprint","borderColor","frameEffects","isFullArt","setName"]},"APICardColour":{"type":"string","enum":["White","Blue","Black","Red","Green","Colourless","Multicoloured"]},"APICardDomain":{"type":"string","enum":["Calm","Chaos","Fury","Mind","Body","Order","Colorless"]},"APICardIdentifiers":{"type":"object","properties":{"id":{"type":"string"},"scryfallId":{"type":"string"}},"required":["id","scryfallId"]},"APICardSearchFilters":{"description":"Server-local version of `models::filters::CardSearchFilters` with `JsonSchema`.","type":"object","properties":{"any_types":{"description":"Card types a card must have at least one of: `[\"Artifact\", \"Enchantment\"]`\nmatches artifacts and enchantments alike. `types` requires all of them.","type":["array","null"],"items":{"type":"string"}},"artist":{"type":["string","null"]},"border_color":{"type":["string","null"]},"collector_number":{"type":["string","null"]},"color_identities":{"type":["array","null"],"items":{"$ref":"#/components/schemas/APICardColour"}},"colors":{"type":["array","null"],"items":{"$ref":"#/components/schemas/APICardColour"}},"defense":{"type":["string","null"]},"domains":{"type":["array","null"],"items":{"$ref":"#/components/schemas/APICardDomain"}},"energy_types":{"type":["array","null"],"items":{"$ref":"#/components/schemas/APIEnergyType"}},"is_full_art":{"type":["boolean","null"]},"is_promo":{"type":["boolean","null"]},"is_reprint":{"type":["boolean","null"]},"is_reserved":{"type":["boolean","null"]},"keywords":{"type":["array","null"],"items":{"type":"string"}},"legal_in":{"type":["string","null"]},"loyalty":{"type":["string","null"]},"mana_value_max":{"type":["number","null"],"format":"double"},"mana_value_min":{"type":["number","null"],"format":"double"},"name":{"type":["string","null"]},"pokedex":{"type":["integer","null"],"format":"int64"},"power":{"type":["string","null"]},"rarity":{"anyOf":[{"$ref":"#/components/schemas/APIRarity"},{"type":"null"}],"default":null},"set_code":{"type":["string","null"]},"sort_by":{"anyOf":[{"$ref":"#/components/schemas/APISortField"},{"type":"null"}]},"sort_order":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]},"subtypes":{"type":["array","null"],"items":{"type":"string"}},"supertypes":{"type":["string","null"]},"text":{"type":["string","null"]},"toughness":{"type":["string","null"]},"types":{"type":["array","null"],"items":{"type":"string"}},"unique":{"description":"How to collapse results that share a card: one of the ids the system\nlists under `unique_modes` in `/api/system` (MTG: `prints`, `cards`,\n`art`). Omitted or empty means the system's default (`prints` for\nMTG). Systems that list no modes ignore it.","type":["string","null"]}}},"APICollectionKind":{"description":"Server-local version of `models::CollectionKind` with `JsonSchema`.","type":"string","enum":["collection","deck"]},"APICollectionSortField":{"oneOf":[{"type":"string","enum":["TimeAdded","WantQuantity","Provider"]},{"description":"Sorts by each row's own quantity — since a row is now one specific\nfinish of a card, this applies per finish, not to a single fixed\n\"normal\" bucket. There's no separate \"foil quantity\" sort field any\nmore; filter to `finish == \"foil\"` client-side for that view.","type":"string","const":"Quantity"}]},"APIEnergyType":{"type":"string","enum":["Fire","Water","Grass","Lightning","Psychic","Fighting","Darkness","Metal","Dragon","Fairy","Colorless","Energy"]},"APIPokemonCard":{"type":"object","properties":{"cardType":{"type":"string"},"collectorNumber":{"type":"string"},"description":{"type":["string","null"]},"energyTypes":{"type":"array","items":{"$ref":"#/components/schemas/APIEnergyType"}},"finishes":{"description":"The finishes/variants this card is printed in (e.g. `[\"Normal\", \"Reverse\nHolofoil\"]`), sourced from the scraper's `variants` data. Drives which\nfinishes the \"add another version\" picker offers.","type":"array","items":{"type":"string"}},"id":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"pokedex":{"type":["integer","null"],"format":"int64"},"rarity":{"$ref":"#/components/schemas/APIPokemonRarity"},"releaseDate":{"type":["string","null"]},"setCode":{"type":"string"},"setShortCode":{"type":["string","null"]}},"required":["id","name","setCode","rarity","image","energyTypes","cardType","collectorNumber","finishes"]},"APIPokemonRarity":{"type":"string","enum":["Common","DoubleRare","Uncommon","Rare","RadiantRare","UltraRare","SecretRare","HoloRare","Promo","ClassicCollection","AmazingRare","ShinyHoloRare","PrismRare","RareBreak","RareAce","SpecialIllustrationRare","IllustrationRare","HyperRare","CodeCard","ShinyRare","ShinyUltraRare","AceSpecRare","BlackWhiteRare","MegaHyperRare","MegaAttackRare"]},"APIRarity":{"type":"string","enum":["Common","Uncommon","Rare","Mythic","Special","Bonus"]},"APIRiftboundCard":{"type":"object","properties":{"artists":{"type":"array","items":{"type":"string"}},"cardType":{"type":"string"},"collectorNumber":{"type":"string"},"domains":{"type":"array","items":{"$ref":"#/components/schemas/APICardDomain"}},"id":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"rarity":{"$ref":"#/components/schemas/RBRarity"},"setCode":{"type":"string"},"text":{"type":"string"}},"required":["id","name","setCode","collectorNumber","rarity","artists","domains","text","image","cardType"]},"APISortField":{"oneOf":[{"type":"string","enum":["Name","Rarity","SetCode","CollectorNumber","Artist"]},{"description":"Pokemon-only: card release date.","type":"string","const":"ReleaseDate"},{"description":"Collections only: each entry's current unit price for its finish, at\nthe retailer it's valued at (see `CollectionValueBreakdown`). Prices\nin different currencies are compared as plain numbers; entries with no\nprice come last in either order. Card searches sort by name instead.","type":"string","const":"Price"},{"description":"Collections only: each entry's owned quantity. Card searches sort by\nname instead.","type":"string","const":"Quantity"},{"description":"Collections only: each entry's wanted quantity. Card searches sort by\nname instead.","type":"string","const":"WantQuantity"}]},"APISortOrder":{"type":"string","enum":["Asc","Desc"]},"APISystemMeta":{"description":"Everything a game's search can be narrowed by, in one call: the values its\nset, card type and grouping filters accept.","type":"object","properties":{"card_types":{"description":"Values for `APICardSearchFilters::any_types`, sorted.","type":"array","items":{"type":"string"}},"sets":{"type":"array","items":{"$ref":"#/components/schemas/Set"}},"unique_modes":{"description":"Values for `APICardSearchFilters::unique`, default first. Empty when\nthe system has nothing to choose between.","type":"array","items":{"$ref":"#/components/schemas/APIUniqueMode"}}},"required":["sets","card_types","unique_modes"]},"APIUniqueMode":{"description":"One way a system can collapse search results that share a card; see\n`APICardSearchFilters::unique`.","type":"object","properties":{"description":{"description":"One-line explanation, for a tooltip.","type":"string"},"id":{"description":"Value to send as `unique`.","type":"string"},"label":{"description":"Short name for a toggle.","type":"string"}},"required":["id","label","description"]},"AdjustWantQuantityRequest":{"type":"object","properties":{"delta":{"type":"integer","format":"int32"},"id":{"type":"string"},"provider":{"description":"See `CardToAdd::provider`.","type":["string","null"],"default":null}},"required":["id","delta"]},"AvailabilityRequest":{"type":"object","properties":{"ids":{"description":"Card ids to report on. Empty yields an empty response.","type":"array","items":{"type":"string"}}},"required":["ids"]},"BoardCreate":{"description":"Adds a board to a deck. Already having one by that name is a no-op.","type":"object","properties":{"board":{"type":"string"}},"required":["board"]},"BoardRename":{"description":"Renames one of a deck's boards, taking its cards with it.","type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"BoardReorder":{"description":"Sets the order of a deck's boards.\n\nBoards left out keep their place after the ones listed, so a partial order can't drop one.","type":"object","properties":{"boards":{"type":"array","items":{"type":"string"}}},"required":["boards"]},"BulkPricesQuery":{"type":"object","properties":{"ids":{"type":"array","default":[],"items":{"type":"string"}}}},"CardAvailability":{"description":"Where the copies of one card currently are.","type":"object","properties":{"committed":{"description":"Copies allocated to decks that are currently built.","type":"integer","format":"int32"},"copies":{"description":"Which collections the owned copies are in, so a deck can show where the ones it is short\nof are to be found.","type":"array","items":{"$ref":"#/components/schemas/CardCopies"}},"free":{"description":"`owned - committed`. Goes negative when more copies are committed than owned, which is\nreported rather than prevented.","type":"integer","format":"int32"},"holdings":{"type":"array","items":{"$ref":"#/components/schemas/CardHolding"}},"id":{"type":"string"},"overCommitted":{"type":"boolean"},"owned":{"description":"Copies owned across every collection.","type":"integer","format":"int32"}},"required":["id","owned","committed","free","overCommitted","holdings","copies"]},"CardCopies":{"description":"How many copies of a card one collection holds.","type":"object","properties":{"collection":{"type":"string"},"quantity":{"type":"integer","format":"int32"}},"required":["collection","quantity"]},"CardHolding":{"description":"One built deck's claim on a card, and where that deck physically is.","type":"object","properties":{"board":{"type":"string","default":""},"deck":{"type":"string"},"finish":{"type":"string","default":""},"location":{"type":["string","null"]},"quantity":{"type":"integer","format":"int32"}},"required":["deck","quantity"]},"CardIdentInner":{"type":"object","properties":{"scryfallId":{"type":"string"}},"required":["scryfallId"]},"CardPrices":{"type":"object","properties":{"paper":{"description":"Keyed by retailer name.","type":"object","additionalProperties":{"$ref":"#/components/schemas/RetailerPrices"}},"uuid":{"type":"string"}},"required":["uuid","paper"]},"CardToAdd":{"type":"object","properties":{"finish":{"description":"Which printing/finish this add/remove applies to — MTG's `\"\"`\n(nonfoil) / `\"foil\"` / `\"etched\"`, a Pokemon variant like `\"reverse\nholo\"`, or just `\"\"` for a game with a single version per collector\nnumber (Riftbound). Defaults to `\"\"` (the primary/default finish).","type":"string","default":""},"id":{"type":"string"},"provider":{"description":"Which system/plugin this card came from, e.g. `RiftboundSQLite` or\n`plugin-dummy-books`. Optional so older callers keep working: when\nomitted, the server falls back to probing every configured system\nand plugin for the id — which is only safe when ids are unique\nacross all of them. A client that knows the provider (the search UI\nalways does, via whichever tab is active) should always send it.","type":["string","null"],"default":null},"purchaseCurrency":{"description":"ISO 4217 code `purchasePrice` is in. Defaults to the server's\n`preferred_currency`.","type":["string","null"],"default":null},"purchasePrice":{"type":["number","null"],"format":"double","default":null},"quantity":{"type":"integer","format":"int32"}},"required":["id","quantity"]},"Collection":{"type":"object","properties":{"id":{"type":"string"},"kind":{"description":"Whether this holds owned cards or is a deck list.\n\nDefaults to `collection`, so a client that predates decks, or one creating an ordinary\ncollection, can keep omitting it.","allOf":[{"$ref":"#/components/schemas/APICollectionKind"}],"default":"collection"}},"required":["id"]},"CollectionAddResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"CollectionAllPurchaseHistoryResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/CollectionPurchaseHistoryEntry"}}},"required":["entries"]},"CollectionCard":{"type":"object","properties":{"collectionId":{"type":"string"},"finish":{"description":"Which printing/finish this row tracks — see `CardToAdd::finish`.\nDistinct finishes of the same card `id` are separate rows; a client\ngroups them back together by `id` to show \"one card, several\nfinishes\" (e.g. nonfoil + foil).","type":"string","default":""},"id":{"type":"string"},"provider":{"type":"string","default":""},"quantity":{"type":"integer","format":"int32"},"timeAdded":{"type":"string","format":"date-time","default":"1970-01-01T00:00:00Z"},"wantQuantity":{"type":"integer","format":"int32","default":0}},"required":["id","quantity","collectionId"]},"CollectionCardsQuery":{"type":"object","properties":{"limit":{"type":"integer","format":"uint","default":24,"minimum":0},"offset":{"type":"integer","format":"uint","default":0,"minimum":0},"provider":{"description":"Single provider inclusion filter (legacy, takes precedence over `providers`).","type":["string","null"]},"providers":{"description":"Multiple provider inclusion filter — comma-separated: `?providers=X,Y`.","type":["string","null"],"default":null},"sort_by":{"anyOf":[{"$ref":"#/components/schemas/APICollectionSortField"},{"type":"null"}]},"sort_order":{"anyOf":[{"$ref":"#/components/schemas/APISortOrder"},{"type":"null"}]}}},"CollectionKindChange":{"description":"Converts a collection to a deck or back.","type":"object","properties":{"kind":{"$ref":"#/components/schemas/APICollectionKind"}},"required":["kind"]},"CollectionListEntry":{"description":"An entry of `/api/collection/list`.","type":"object","properties":{"id":{"type":"string"},"kind":{"description":"Whether this holds owned cards or is a deck list.\n\nA client uses it to decide whether a card edit belongs on `/api/collection` or\n`/api/deck`.","allOf":[{"$ref":"#/components/schemas/APICollectionKind"}]},"removable":{"description":"False for the default collection, which can't be deleted (only\nemptied into another collection via `keepCardsInCollection`).","type":"boolean"}},"required":["id","removable","kind"]},"CollectionPurchaseHistoryEntry":{"type":"object","properties":{"card_name":{"type":["string","null"]},"card_uuid":{"type":"string"},"currency":{"description":"ISO 4217 code `price_per_unit` is in.","type":"string"},"finish":{"type":"string"},"id":{"type":"integer","format":"int64"},"price_per_unit":{"type":["number","null"],"format":"double"},"provider":{"type":"string"},"quantity":{"type":"integer","format":"int32"},"recorded_at":{"type":"string"},"set_code":{"type":["string","null"]}},"required":["id","card_uuid","finish","quantity","currency","provider","recorded_at"]},"CollectionRemoveQuery":{"type":"object","properties":{"keepCardsInCollection":{"description":"Move the collection's cards (and their purchase history) here instead\nof deleting them. Empty or omitted deletes them.","type":["string","null"],"default":null}}},"CollectionRemoveResponse":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"CollectionRenameRequest":{"type":"object","properties":{"new_id":{"type":"string"}},"required":["new_id"]},"CollectionValueBreakdown":{"type":"object","properties":{"currencies":{"description":"Totals split by currency, largest total first. Every priced entry counts\ntoward exactly one currency (that of its preferred retailer).","type":"array","items":{"$ref":"#/components/schemas/CurrencyValue"}},"priced_count":{"type":"integer","format":"uint","minimum":0},"total_count":{"type":"integer","format":"uint","minimum":0}},"required":["currencies","priced_count","total_count"]},"CollectionValueCards":{"description":"Every owned, priced entry of a collection with what it's worth, what it\ncost and how its price moved — most valuable first.","type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/ValueCardEntry"}},"history_enabled":{"description":"Whether price history is kept; without it `first_price` and\n`past_price` are always missing.","type":"boolean"},"past_day":{"description":"The day `past_price` is as of (UTC).","type":"string","format":"date"},"unpriced_count":{"description":"Owned entries with no current price, so left out of `entries`.","type":"integer","format":"uint","minimum":0}},"required":["history_enabled","past_day","unpriced_count","entries"]},"CollectionValueHistory":{"description":"What the cards currently owned in a collection were worth on each day\nprice history has, at the prices they're valued at today (see\n`CollectionValueBreakdown`): each card's history is read from the\nretailer it's valued at now, so the last point lines up with the\ncollection's current total. Copies since sold or moved away are not\nincluded — this is the value over time of what's held now.","type":"object","properties":{"currencies":{"description":"One series per currency, largest latest value first. Every entry\ncounts toward exactly one currency, that of its retailer.","type":"array","items":{"$ref":"#/components/schemas/CurrencyValueHistory"}},"enabled":{"description":"Whether the server keeps price history at all. When it doesn't,\n`currencies` is always empty.","type":"boolean"},"total_count":{"description":"Owned entries (one per card and finish) in the collection, priced or not.","type":"integer","format":"uint","minimum":0}},"required":["enabled","total_count","currencies"]},"CollectionsSearchQuery":{"type":"object","properties":{"offset":{"type":"integer","format":"uint","default":0,"minimum":0},"page_size":{"type":"integer","format":"uint","default":24,"minimum":0}}},"CsvColumn":{"description":"One CSV column: which field it holds and its header text.","type":"object","properties":{"field":{"$ref":"#/components/schemas/CsvField"},"header":{"type":"string"}},"required":["field","header"]},"CsvField":{"description":"Canonical fields making up gathers' collection CSV import/export\ncontract — stable identifiers for what a piece of data *is*, independent\nof what column header text a particular CSV file actually uses for it\n(see `CsvLayout`).","oneOf":[{"type":"string","enum":["set_code","collector_number","quantity","foil_quantity","provider","want_quantity"]},{"description":"Which finish `Quantity` and `WantQuantity` are of, using\n`models::CollectionCard::finish`'s names. Empty is the default finish,\nwhose row also carries `FoilQuantity` when that column is exported —\nthe same shape as exports from before this column existed.","type":"string","const":"finish"},{"description":"The card's name. Written on export for people reading the file;\nignored on import, where cards are found by `Id` or set and number.","type":"string","const":"name"},{"description":"The card's id in its provider (`models::CollectionCard::uuid`).\nIdentifies a card exactly, where set and number can match several\nprintings.","type":"string","const":"id"}]},"CsvFieldInfo":{"type":"object","properties":{"default_header":{"description":"Header gathers' own format uses for it.","type":"string"},"description":{"type":"string"},"field":{"$ref":"#/components/schemas/CsvField"},"import_use":{"$ref":"#/components/schemas/CsvImportUse"},"label":{"type":"string"}},"required":["field","label","description","default_header","import_use"]},"CsvImportUse":{"description":"What import does with a field.","oneOf":[{"description":"Finds the card: `Id`, or `SetCode` and `CollectorNumber` together.","type":"string","const":"identifies"},{"description":"A count; at least one must be mapped.","type":"string","const":"count"},{"description":"Used when mapped, defaulted when not.","type":"string","const":"optional"},{"description":"Not read on import.","type":"string","const":"ignored"}]},"CsvLayout":{"description":"Which columns a CSV file has, in order. Export writes exactly these\ncolumns; import reads each field from the column with that header (any\nother columns in the file are ignored).","type":"object","properties":{"columns":{"type":"array","items":{"$ref":"#/components/schemas/CsvColumn"}}},"required":["columns"]},"CsvLayoutsInfo":{"type":"object","properties":{"fields":{"description":"Every field a CSV column can hold.","type":"array","items":{"$ref":"#/components/schemas/CsvFieldInfo"}},"presets":{"description":"Built-in layouts, gathers' own first.","type":"array","items":{"$ref":"#/components/schemas/CsvPreset"}}},"required":["fields","presets"]},"CsvPreset":{"description":"A built-in layout matching a popular collection manager's CSV format.","type":"object","properties":{"description":{"description":"What carries over and what doesn't.","type":"string"},"id":{"description":"Short name it's selected by, e.g. `tcgplayer`.","type":"string"},"label":{"type":"string"},"layout":{"$ref":"#/components/schemas/CsvLayout"}},"required":["id","label","description","layout"]},"CurrencyValue":{"type":"object","properties":{"currency":{"description":"ISO 4217 code, e.g. \"USD\", \"EUR\".","type":"string"},"priced_count":{"description":"Owned entries priced in this currency.","type":"integer","format":"uint","minimum":0},"profit":{"type":"number","format":"double"},"total_value":{"type":"number","format":"double"},"untracked_value":{"type":"number","format":"double"},"wanted_value":{"description":"For a collection, the total price of cards on the wishlist\n(`want_quantity`), independent of what's owned. For a deck, the price\nof the wanted copies not yet had, i.e. what completing it would cost.\nNot included in `total_value` either way.","type":"number","format":"double"}},"required":["currency","total_value","profit","untracked_value","wanted_value","priced_count"]},"CurrencyValueHistory":{"type":"object","properties":{"currency":{"description":"ISO 4217 code.","type":"string"},"entry_count":{"description":"Owned entries valued in this currency today.","type":"integer","format":"uint","minimum":0},"points":{"description":"Oldest first, one per day any of those entries has a recorded price.","type":"array","items":{"$ref":"#/components/schemas/ValueHistoryPoint"}}},"required":["currency","entry_count","points"]},"DatedPrice":{"type":"object","properties":{"day":{"description":"UTC day it was recorded.","type":"string","format":"date"},"price":{"type":"number","format":"double"}},"required":["day","price"]},"DeckBoard":{"description":"One zone of a deck, and where it sits in the deck's order.","type":"object","properties":{"board":{"type":"string"},"position":{"type":"integer","format":"int32"}},"required":["board","position"]},"DeckCard":{"description":"A card allocated to one zone of one deck.\n\nDistinct from `collections_models::CollectionCard` in carrying a `board`. It keeps the same\nowned/wanted pair: a deck records both the copies it has to hand and the ones it still calls\nfor, and a card can be both at once.","type":"object","properties":{"board":{"description":"Which zone of the deck this belongs to.\n\nFree-form text the user can rename, rather than a fixed main/side pair: MTG has a mainboard\nand sideboard (and a command zone for Commander), Riftbound has a main deck, a legend,\nrunes, and battlefields, and Pokemon has a single deck. A new deck starts with `\"Mainboard\"`\nand `\"Sideboard\"`.","type":"string","default":""},"finish":{"description":"Which printing/finish this allocation is for; see `collections_models::CardToAdd::finish`.","type":"string","default":""},"id":{"type":"string"},"provider":{"type":"string","default":""},"quantity":{"description":"Copies the deck has to hand.","type":"integer","format":"int32"},"timeAdded":{"type":"string","format":"date-time","default":"1970-01-01T00:00:00Z"},"timeUpdated":{"type":"string","format":"date-time","default":"1970-01-01T00:00:00Z"},"wantQuantity":{"description":"Copies the deck calls for. Not added to `quantity`: the two overlap, so a deck's size\ncounts the greater of them per card.","type":"integer","format":"int32"}},"required":["id","quantity","wantQuantity"]},"DeckCardAdjustment":{"description":"A change applied to one card on one board.\n\nPositive adds copies, negative removes them; each count is floored at zero. The two counts move\nindependently, so a copy can be acquired by sending `quantity: 1, wantQuantity: -1`.\n\nAdding to a board the deck hasn't got declares it, board names being free-form.","type":"object","properties":{"board":{"description":"Defaults to the deck's first board when omitted.","type":"string","default":""},"finish":{"type":"string","default":""},"id":{"type":"string"},"provider":{"description":"Which system/plugin this card came from. Optional for the same reason as\n`collections_models::CardToAdd::provider`: when omitted the server probes the configured\nsystems for the id.","type":["string","null"],"default":null},"quantity":{"type":"integer","format":"int32","default":0},"wantQuantity":{"type":"integer","format":"int32","default":0}},"required":["id"]},"DeckCardMove":{"description":"Moves copies of a card from one of a deck's boards to another.","type":"object","properties":{"finish":{"type":"string","default":""},"fromBoard":{"type":"string","default":""},"id":{"type":"string"},"quantity":{"description":"Copies to move, unsigned as a transfer's count is. The two boards already say which way\nthey go, so there is nothing for a sign to mean.","type":"integer","format":"uint32","default":0,"minimum":0},"toBoard":{"type":"string","default":""},"wantQuantity":{"type":"integer","format":"uint32","default":0,"minimum":0}},"required":["id"]},"DeckCardTransfer":{"description":"Moves copies of a card between a collection and one of a deck's boards.\n\nA transfer rather than an allocation: the copies leave wherever they came from. Allocating a\ncard to a deck while keeping it in the collection is what the adjust endpoint is for.","type":"object","properties":{"board":{"description":"Defaults to the deck's first board when omitted.","type":"string","default":""},"collection":{"description":"The collection the copies come from, or go back to.","type":"string"},"finish":{"type":"string","default":""},"id":{"type":"string"}},"oneOf":[{"description":"Out of the collection and onto the deck's board.","type":"object","properties":{"direction":{"type":"string","const":"intoDeck"},"quantity":{"type":"integer","format":"uint32","minimum":1}},"required":["direction","quantity"]},{"description":"Off the deck's board and back into the collection.","type":"object","properties":{"direction":{"type":"string","const":"outOfDeck"},"quantity":{"type":"integer","format":"uint32","minimum":1}},"required":["direction","quantity"]}],"required":["id","collection"]},"DeckCardTransferResult":{"description":"How many copies a transfer actually moved, which is capped at what the source holds.","type":"object","properties":{"moved":{"type":"integer","format":"int32"}},"required":["moved"]},"DeckMeta":{"description":"Whether a deck is physically assembled, and where it is.","type":"object","properties":{"built":{"description":"A built deck is assembled in real life, so its cards are committed and unavailable to\nanother deck. An unbuilt deck is only a list.","type":"boolean"},"location":{"type":["string","null"]},"notes":{"type":["string","null"]}},"required":["built"]},"DownloadProgressInfo":{"type":"object","properties":{"downloaded":{"type":"integer","format":"uint64","minimum":0},"phase":{"type":"string"},"total":{"type":"integer","format":"uint64","minimum":0}},"required":["downloaded","total","phase"]},"EnvOverride":{"type":"object","properties":{"field":{"description":"The `server.toml` key being overridden, e.g. `mtg_db_path`.","type":"string"},"value":{"description":"The variable's value, which the server uses instead of the config file's.","type":"string"},"var":{"description":"The environment variable overriding it, e.g. `MTG_DB_PATH`.","type":"string"}},"required":["field","var","value"]},"MagicRetrieveQuery":{"type":"object","properties":{"ids":{"type":"array","default":[],"items":{"type":"string"}}}},"MagicSearchQuery":{"type":"object","properties":{"limit":{"type":"integer","format":"uint","default":10,"minimum":0},"skip":{"type":"integer","format":"uint","default":0,"minimum":0}}},"MoneyAmount":{"type":"object","properties":{"currency":{"description":"ISO 4217 code.","type":"string"},"value":{"type":"number","format":"double"}},"required":["currency","value"]},"PluginCard":{"description":"A card-shaped item returned by a plugin. Fields beyond `id`/`name` are\ndeliberately loose (empty string / `None` / empty map are all valid) so\na plugin author only has to fill in what makes sense for their domain.","type":"object","properties":{"collector_number":{"type":"string","default":""},"description":{"type":["string","null"],"default":null},"extra":{"description":"Freeform, domain-specific fields (e.g. \"author\" for a books plugin),\nopaque to gathers itself.","type":"object","additionalProperties":{"type":"string"},"default":{}},"id":{"type":"string"},"image_url":{"type":["string","null"],"default":null},"name":{"type":"string"},"set_code":{"type":"string","default":""},"set_name":{"type":"string","default":""}},"required":["id","name"]},"PluginConfig":{"description":"A third-party retrieval plugin — a separate HTTP service implementing\nthe gathers plugin contract (see `retrieval::systems::plugin`). Any\nnumber may be configured.","type":"object","properties":{"base_url":{"description":"Base URL the plugin's HTTP service is reachable at.","type":"string"},"enabled":{"type":"boolean","default":true},"name":{"description":"Unique name this plugin is addressed by, e.g. `/api/plugins/{name}/...`.","type":"string"}},"required":["name","base_url"]},"PluginSearchFilters":{"type":"object","properties":{"set_code":{"type":["string","null"],"default":null},"text":{"type":["string","null"],"default":null}}},"PluginSummary":{"type":"object","properties":{"base_url":{"type":"string"},"name":{"type":"string"}},"required":["name","base_url"]},"PokemonRetrieveQuery":{"type":"object","properties":{"ids":{"type":"array","default":[],"items":{"type":"string"}}}},"PokemonSearchQuery":{"type":"object","properties":{"limit":{"type":"integer","format":"uint","default":24,"minimum":0},"skip":{"type":"integer","format":"uint","default":0,"minimum":0}}},"PriceHistoryEntry":{"description":"One retailer's price for one finish of a card on a given day.","type":"object","properties":{"currency":{"description":"ISO 4217 code `price` is in.","type":"string"},"finish":{"description":"Same convention as `models::CollectionCard::finish`: `\"\"` is the\ndefault finish, anything else is game-specific.","type":"string"},"price":{"type":"number","format":"double"},"recorded_on":{"description":"UTC day the price is as of.","type":"string","format":"date"},"retailer":{"type":"string"}},"required":["retailer","finish","price","currency","recorded_on"]},"PriceHistoryResponse":{"type":"object","properties":{"enabled":{"description":"Whether the server keeps price history at all. When it doesn't,\n`entries` is always empty.","type":"boolean"},"entries":{"description":"Recorded prices, oldest first: one per retailer and finish per day.","type":"array","items":{"$ref":"#/components/schemas/PriceHistoryEntry"}}},"required":["enabled","entries"]},"PublicCollectionPage":{"description":"A page of full card data for a shareable, read-only collection view.\nEach entry in `cards` merges the collection entry (quantity, provider, ...)\nwith the full card details, so the client needs a single request per page\ninstead of a separate card-detail lookup.","type":"object","properties":{"cards":{"type":"array","items":true},"total":{"type":"integer","format":"uint","minimum":0}},"required":["cards","total"]},"PurchaseHistoryEntry":{"type":"object","properties":{"card_uuid":{"type":"string"},"currency":{"description":"ISO 4217 code `price_per_unit` is in.","type":"string"},"finish":{"type":"string"},"id":{"type":"integer","format":"int64"},"price_per_unit":{"type":["number","null"],"format":"double"},"provider":{"type":"string"},"quantity":{"type":"integer","format":"int32"},"recorded_at":{"type":"string"}},"required":["id","card_uuid","finish","quantity","currency","provider","recorded_at"]},"PurchaseHistoryResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseHistoryEntry"}}},"required":["entries"]},"RBRarity":{"type":"string","enum":["Common","Uncommon","Rare","Epic","Showcase"]},"RestartResponse":{"type":"object","properties":{"restarting":{"description":"Always true: the server is shutting down to re-exec itself.","type":"boolean"}},"required":["restarting"]},"ResultCard":{"type":"object","properties":{"mtGCard":{"$ref":"#/components/schemas/ResultCardInner"}},"required":["mtGCard"]},"ResultCardInner":{"type":"object","properties":{"cardIdentifiers":{"$ref":"#/components/schemas/CardIdentInner"},"id":{"type":"string"},"name":{"type":"string"},"setCode":{"type":"string"}},"required":["id","name","setCode","cardIdentifiers"]},"RetailerPrices":{"type":"object","properties":{"currency":{"description":"ISO 4217 currency code of `normal`/`foil` (e.g. \"USD\", \"EUR\").","type":"string","default":"USD"},"date":{"description":"UTC day these prices are as of, when the source says — the newest of\n`normal`'s and `foil`'s.","type":["string","null"],"format":"date"},"foil":{"type":["number","null"],"format":"double"},"normal":{"type":["number","null"],"format":"double"}}},"RiftboundRetrieveQuery":{"type":"object","properties":{"ids":{"type":"array","default":[],"items":{"type":"string"}}}},"RiftboundSearchQuery":{"type":"object","properties":{"limit":{"type":"integer","format":"uint","default":10,"minimum":0},"skip":{"type":"integer","format":"uint","default":0,"minimum":0}}},"SearchRequest":{"type":"object","properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/PluginSearchFilters"}],"default":{"set_code":null,"text":null}},"limit":{"type":["integer","null"],"format":"uint","default":null,"minimum":0},"skip":{"type":["integer","null"],"format":"uint","default":null,"minimum":0}}},"ServerConfig":{"type":"object","properties":{"auto_download_enabled":{"description":"Periodically re-download card and price databases for all active systems.","type":"boolean","default":false},"auto_download_interval_hours":{"description":"How often to run the auto-download, in hours. Takes effect on server restart.","type":"integer","format":"uint64","default":24,"minimum":0},"collections_enabled":{"type":"boolean","default":true},"cors_allowed_origins":{"description":"Browser origins (e.g. `https://cards.example.com`) allowed to call\nthis API from another origin. Empty by default: the bundled web UI\nis served from the same origin (behind its proxy), and allowing any\norigin would let every website a user visits read — and, as there's\nno authentication, change — their collections. Also settable as a\ncomma-separated list in `GATHERS_CORS_ORIGINS`.","type":"array","items":{"type":"string"}},"mtg_db_path":{"type":["string","null"]},"mtg_prices_path":{"type":["string","null"]},"plugins":{"type":"array","default":[],"items":{"$ref":"#/components/schemas/PluginConfig"}},"pokemon_db_path":{"type":["string","null"]},"pokemon_prices_path":{"type":["string","null"]},"port":{"type":"integer","format":"uint","minimum":0},"preferred_currency":{"description":"ISO 4217 code (e.g. \"EUR\", \"USD\"). When a card is listed by retailers\nin several currencies, prices in this one are used first — for shown\nprices and collection totals alike.","type":"string","default":"EUR"},"price_history_db_path":{"description":"Defaults to `storage.prices.db` next to the storage database.","type":["string","null"]},"price_history_enabled":{"description":"Record the daily prices of cards in collections, in a separate\ndatabase (`price_history_db_path`). Recorded whenever a price\ndatabase is updated, when cards are added, and on startup while\nnothing has been recorded yet. Takes effect on server restart.","type":"boolean","default":false},"pricing_enabled":{"type":"boolean","default":true},"riftbound_db_path":{"type":["string","null"]},"riftbound_prices_path":{"type":["string","null"]},"storage_db_path":{"type":["string","null"]},"system":{"type":"array","items":{"$ref":"#/components/schemas/Systems"}}},"required":["system","port"]},"Set":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["name","code"]},"ShareLinkResponse":{"description":"A shareable, read-only link granting public access to a collection via\nits opaque `token`. Owner-managed: created and revoked explicitly through\nthe `/collection/share/{id}` endpoints.","type":"object","properties":{"collectionId":{"type":"string"},"createdAt":{"type":"string"},"token":{"type":"string"}},"required":["token","collectionId","createdAt"]},"ShareLinkRevokeResponse":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]},"SystemInfo":{"type":"object","properties":{"collections_enabled":{"description":"Whether collection management is enabled.","type":"boolean"},"demo_mode":{"description":"Whether the server is running in demo mode (settings endpoints disabled).","type":"boolean"},"downloading":{"description":"Systems whose databases are currently being downloaded, with progress info.","type":"object","additionalProperties":{"$ref":"#/components/schemas/DownloadProgressInfo"}},"plugins":{"description":"Names of configured third-party plugins (see `PluginConfig`). Kept\nseparate from `systems` — a plugin isn't a `provider` collections can\nstore cards under, and doesn't support the same search filters.","type":"array","items":{"type":"string"}},"preferred_currency":{"description":"ISO 4217 code of the currency card prices are taken in when a card is\nlisted in several (see `ServerConfig::preferred_currency`).","type":"string"},"price_history_enabled":{"description":"Whether daily prices of collection cards are being recorded (see\n`ServerConfig::price_history_enabled`). False when enabled but its\ndatabase couldn't be opened.","type":"boolean"},"pricing_enabled":{"description":"Whether pricing support is enabled (market prices, purchase history, etc.).","type":"boolean"},"restart_required":{"description":"Whether settings were saved that only take effect after a server\nrestart. Stays set until the server restarts.","type":"boolean"},"system":{"description":"Primary active system, identified by NamedRetrievalSystem::name().","type":"string"},"systems":{"description":"All active systems, identified by NamedRetrievalSystem::name().\nThese strings also match the `provider` field stored on collection cards.","type":"array","items":{"type":"string"}},"unique_modes":{"description":"The ways each system can collapse search results that share a card\n(see `APICardSearchFilters::unique`), keyed by system name; the first\nis the default. Systems with no modes are left out — they have\nnothing to toggle.","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/APIUniqueMode"}}},"version":{"description":"Server version: the git tag it was built from (e.g. `v0.6.4`, or\n`v0.6.4-18-ga2de264` for a build past a tag).","type":"string"}},"required":["system","systems","plugins","unique_modes","downloading","demo_mode","pricing_enabled","collections_enabled","price_history_enabled","preferred_currency","restart_required","version"]},"Systems":{"type":"string","enum":["Scryfall","Sql","RiftboundSql","PokemonSql"]},"UpdatePurchaseEntryBody":{"type":"object","properties":{"currency":{"description":"ISO 4217 code; left unchanged when omitted.","type":["string","null"],"default":null},"price_per_unit":{"type":["number","null"],"format":"double"},"quantity":{"type":"integer","format":"int32"}},"required":["quantity"]},"ValueCardEntry":{"type":"object","properties":{"card_uuid":{"type":"string"},"cost":{"description":"What those `cost_quantity` copies cost, per currency they were bought in.","type":"array","items":{"$ref":"#/components/schemas/MoneyAmount"}},"cost_quantity":{"description":"Owned copies that have a recorded purchase price.","type":"integer","format":"int32"},"currency":{"description":"ISO 4217 code of every price on this entry.","type":"string"},"finish":{"type":"string"},"first_price":{"description":"Earliest recorded unit price.","anyOf":[{"$ref":"#/components/schemas/DatedPrice"},{"type":"null"}]},"image":{"description":"Direct image URL (Riftbound, Pokémon, plugins).","type":["string","null"]},"name":{"description":"`None` when the card's details couldn't be looked up.","type":["string","null"]},"past_price":{"description":"Unit price as of `CollectionValueCards::past_day` (the latest\nrecording on or before it). Missing when history starts later.","anyOf":[{"$ref":"#/components/schemas/DatedPrice"},{"type":"null"}]},"profit":{"description":"Current value of the `cost_quantity` copies minus `cost` — only when\neverything was bought in `currency`; otherwise convert `cost` and\nsubtract it from `unit_price` × `cost_quantity`.","type":["number","null"],"format":"double"},"provider":{"type":"string"},"quantity":{"type":"integer","format":"int32"},"scryfall_id":{"description":"MTG cards' image comes from Scryfall.","type":["string","null"]},"set_code":{"type":["string","null"]},"total_value":{"description":"`unit_price` × `quantity`.","type":"number","format":"double"},"unit_price":{"type":"number","format":"double"}},"required":["card_uuid","provider","finish","quantity","currency","unit_price","total_value","cost_quantity","cost"]},"ValueCardsQuery":{"type":"object","properties":{"days":{"description":"How many days back `past_price` looks. Default 30.","type":["integer","null"],"format":"uint32","default":null,"minimum":0}}},"ValueHistoryPoint":{"type":"object","properties":{"day":{"description":"UTC day.","type":"string","format":"date"},"priced_count":{"description":"Entries that contributed to `value`, out of `entry_count`.","type":"integer","format":"uint","minimum":0},"value":{"description":"Sum of quantity × unit price over the entries priced that day. A\nprice carries forward to days with no new recording; an entry whose\ncard has no price recorded yet contributes nothing.","type":"number","format":"double"}},"required":["day","value","priced_count"]},"ValueHistoryQuery":{"type":"object","properties":{"since":{"description":"Only days on or after this one (UTC, `YYYY-MM-DD`). Omitted means\nall recorded history.","type":["string","null"],"format":"date","default":null}}}}}}