Deck parsing, analysis and versions
Wiki home · Practical examples · All endpoints · Exact schemas
Current access: first-party * key. A scoped ask_ai key can ask ASK AI to use its internal deterministic deck tools, but cannot call these REST routes directly.
Analyze a request without saving
| Operation | Use |
|---|---|
| POST /v1/decks/parse | Parse and resolve deck lines |
| POST /v1/decks/analyze | Summary, curve, colors, mana, legality, probabilities and optional stored pricing |
| POST /v1/decks/analyze/curve | Focused mana curve |
| POST /v1/decks/analyze/mana-base | Focused sources and mana-base analysis |
| POST /v1/decks/diff | Compare two supplied deck states |
Supply either deck: {text:"..."} or the structured deck.sections representation. Text may use sections such as Deck, Sideboard and Commander, with quantity/name lines. Analyze requires deck; diff requires from and to. Optional format and as_of make time-dependent legality explicit. Parse accepts deck or a top-level text value. No request-scoped analysis stores a deck.
curl -sS https://api.chaosdraft.com/v1/decks/analyze \
-H "Authorization: Bearer $CHAOSDRAFT_FIRST_PARTY_KEY" \
-H 'Content-Type: application/json' \
--data '{"deck":{"text":"Deck\n4 Llanowar Elves\n4 Opt\n12 Forest\n12 Island"},"format":"standard"}'
The sample is intentionally short, so it will not pass a 60-card Standard deck-size check. Use an actual list for a meaningful legality result. Inspect parser diagnostics, resolution completeness, mana-source classification, price coverage and legality coverage before presenting a conclusion.
Analysis options can request probabilities and stored pricing. The pricing policy is selected_printing by default; cheapest_printing selects an eligible cheapest in-stock stored quote for each card, with condition/finish options. A total can be partial or absent. See the exact option schema.
Store and version a deck in this API
| Operation | Use |
|---|---|
| POST /v1/decks | Create an API-stored deck and first immutable version |
| GET /v1/decks/{id} | Read the stored deck |
| PATCH /v1/decks/{id} | Change metadata, format or visibility |
| DELETE /v1/decks/{id} | Delete the stored deck |
| GET /v1/decks/{id}/versions | List versions |
| POST /v1/decks/{id}/versions | Add a version |
| GET /v1/decks/{id}/versions/{version_id} | Read a version |
| GET /v1/decks/{id}/versions/{version_id}/analysis | Analyze one stored version |
| GET /v1/decks/{id}/versions/{version_id}/diff | Compare stored versions |
Create accepts deck, optional name, format, as_of, source and note. Adding a version may use parent_version_id. The exact accepted metadata and idempotency behavior are in OpenAPI. There is currently no GET /v1/decks list route. API-stored decks are separate from saved decks in the DeckForge website; sending a list to ASK AI also does not save it here.