{"name":"Niklas Raichu Collection API","description":"REST API for Niklas's Raichu Pokémon card collection. Read endpoints are public. Write endpoints require a Bearer token.","authentication":{"type":"bearer","header":"Authorization: Bearer <API_KEY>","description":"Write endpoints require a valid API key. Read endpoints are public and require no authentication."},"endpoints":[{"method":"GET","path":"/api/collection","authentication":false,"description":"Returns the full collection with summary counts and all cards.","query_parameters":[{"name":"owned","type":"boolean","description":"Filter to only owned cards (owned=true)"},{"name":"missing","type":"boolean","description":"Filter to only missing cards (missing=true)"},{"name":"priority","type":"boolean","description":"Filter to only priority cards (priority=true)"},{"name":"set","type":"string","description":"Filter by set name (e.g. set=Base+Set)"}],"response":{"owner":"string","subject":"string","total_cards":"number","owned_count":"number","missing_count":"number","cards":["array of card objects"],"_links":{"docs":"string (URL to this documentation)"}}},{"method":"POST","path":"/api/collection/cards","authentication":true,"description":"Add a new card to the collection.","request_body":{"required":{"cardName":"string","setName":"string","number":"string (e.g. '14/102')","printing":"string (e.g. 'Unlimited', '1st Edition')","category":"string (e.g. 'Holo', 'Non-Holo', 'Reverse Holo')","language":"string (e.g. 'English', 'Japanese')"},"optional":{"cardmarketUrl":"string","priceChartingUrl":"string"}},"response":{"success":true,"card":"card object with generated id"}},{"method":"PATCH","path":"/api/collection/cards/:id","authentication":true,"description":"Update collection status for a card. All fields are optional — include only what you want to change. Uses explicit values (not toggles), so it is idempotent.","request_body":{"optional":{"owned":"boolean — set whether the card is owned","priority":"boolean — set whether the card is a priority/wanted card","note":"string — set a note (empty string to clear)"}},"response":{"success":true,"cardId":"string","owned":"boolean (if set)","priority":"boolean (if set)","note":"string (if set)"}},{"method":"PUT","path":"/api/collection/cards/:id","authentication":true,"description":"Update card metadata fields.","request_body":{"allowed_fields":["cardName","setName","number","printing","category","language","priceChartingUrl"]},"response":{"success":true,"card":"updated card object"}},{"method":"DELETE","path":"/api/collection/cards/:id","authentication":true,"description":"Permanently delete a card and its collection data (owned status, notes, copies).","response":{"success":true,"message":"string"}},{"method":"PUT","path":"/api/collection/cards/:id/copies","authentication":true,"description":"Replace the copies array for a card. Used to track individual physical copies with condition and PSA grading. Each copy is either condition-graded OR PSA-graded. The id field is auto-generated if omitted.","request_body":{"required":{"copies":"array of copy objects (see below)"},"copy_object":{"id":"string (optional — auto-generated UUID if omitted)","condition":"one of: mint, near-mint, excellent, good, light-played, played, poor (required when isPSAGraded is false)","isPSAGraded":"boolean (default false)","psaGrade":"number 1-10 (required when isPSAGraded is true)"}},"response":{"success":true,"cardId":"string","copies":"array (with generated ids)"}}],"examples":{"read_collection":"curl https://YOUR_DOMAIN/api/collection","read_missing_cards":"curl 'https://YOUR_DOMAIN/api/collection?missing=true'","mark_as_owned":"curl -X PATCH https://YOUR_DOMAIN/api/collection/cards/42 -H \"Authorization: Bearer YOUR_API_KEY\" -H \"Content-Type: application/json\" -d '{\"owned\": true}'","add_card":"curl -X POST https://YOUR_DOMAIN/api/collection/cards -H \"Authorization: Bearer YOUR_API_KEY\" -H \"Content-Type: application/json\" -d '{\"cardName\":\"Raichu\",\"setName\":\"Base Set\",\"number\":\"14/102\",\"printing\":\"Unlimited\",\"category\":\"Holo\",\"language\":\"English\"}'","add_copy":"curl -X PUT https://YOUR_DOMAIN/api/collection/cards/42/copies -H \"Authorization: Bearer YOUR_API_KEY\" -H \"Content-Type: application/json\" -d '{\"copies\": [{\"condition\": \"near-mint\"}, {\"isPSAGraded\": true, \"psaGrade\": 9}]}'","delete_card":"curl -X DELETE https://YOUR_DOMAIN/api/collection/cards/42 -H \"Authorization: Bearer YOUR_API_KEY\""}}