{"openapi":"3.1.0","info":{"title":"Spark PUBG UC Auto Redeem — API","description":"Spark PUBG UC Auto Redeem Bot — REST API for subscribers with the **+API** plan. **Human-friendly reference:** `/docs` (includes embedded Swagger).","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/me":{"get":{"summary":"V1 Me","operationId":"v1_me_v1_me_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/player/lookup":{"get":{"tags":["Player"],"summary":"Resolve player display name","description":"Links the PUBG player ID on Midas and returns the character name. Charges **0.25** requests **on success only** (same pool as redeems; fractional counts supported).","operationId":"v1_player_lookup_v1_player_lookup_get","parameters":[{"name":"player_id","in":"query","required":true,"schema":{"type":"string","title":"Player Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/quota":{"get":{"summary":"V1 Quota","operationId":"v1_quota_v1_quota_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/stock/summary":{"get":{"summary":"V1 Stock Summary","operationId":"v1_stock_summary_v1_stock_summary_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/history":{"get":{"summary":"V1 History","description":"Recent redeems (newest first). Use ``offset`` to page beyond the first window (e.g. offset=200, limit=100).","operationId":"v1_history_v1_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/subscription/purchase":{"post":{"summary":"V1 Subscription Purchase","operationId":"v1_subscription_purchase_v1_subscription_purchase_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/subscription/purchase-api-addon":{"post":{"summary":"V1 Subscription Purchase Api Addon","description":"Buy the standalone HTTP API add-on (30 days). Requires an active normal plan.","operationId":"v1_subscription_purchase_api_addon_v1_subscription_purchase_api_addon_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/check-code":{"post":{"summary":"V1 Job Check Code","operationId":"v1_job_check_code_v1_jobs_check_code_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckCodeJobBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/manual-redeem":{"post":{"summary":"V1 Job Manual Redeem","operationId":"v1_job_manual_redeem_v1_jobs_manual_redeem_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualRedeemJobBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/stock-redeem":{"post":{"summary":"V1 Job Stock Redeem","operationId":"v1_job_stock_redeem_v1_jobs_stock_redeem_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockRedeemJobBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}":{"get":{"summary":"V1 Get Job","operationId":"v1_get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs":{"get":{"summary":"V1 List Jobs","description":"List jobs newest-first. Use ``offset`` to skip earlier pages (e.g. offset=200, limit=100).","operationId":"v1_list_jobs_v1_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/v1/order/screenshot":{"post":{"tags":["Order image"],"summary":"Generate ORDER DETAILS screenshot (WebP)","description":"Loads the job from the database for this API account, reads ``order_details`` from the sanitized\nresult (same shape as ``GET /v1/jobs/{job_id}``), renders the card, and returns **binary WebP**.","operationId":"api_v1_order_screenshot_api_v1_order_screenshot_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderScreenshotByJobBody"}}}},"responses":{"200":{"description":"ORDER DETAILS image encoded as WebP (raw bytes, not JSON).","content":{"application/json":{"schema":{}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Job finished without usable ``order_details`` (e.g. check-code, or failed redeem)."},"401":{"description":"Missing or invalid ``X-API-Key``."},"403":{"description":"Active plan and HTTP API add-on required."},"404":{"description":"Unknown ``job_id`` for this API key."},"409":{"description":"Job still ``pending`` or ``running`` — wait until ``done``."},"429":{"description":"Too many requests per minute (global API limit or screenshot-specific limit)."},"501":{"description":"WebP encoder unavailable or empty output (see JSON ``detail``)."},"500":{"description":"Unexpected render/encode failure (see JSON ``detail``)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"CheckCodeJobBody":{"properties":{"codes":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"Codes","description":"Non-empty array of PUBG UC voucher strings. Each token is exactly **18** characters (letters `A–Z` / `a–z` and digits `0–9`, mixed case allowed). For a **single** code, send a **one-element** array, e.g. `[\"a1B2c3D4e5F6g7H8i9\"]`. At most **10** codes per job; order is preserved. Billing: **1** request from quota per array element when the worker runs (not at POST time).","examples":[["a1B2c3D4e5F6g7H8i9"],["a1B2c3D4e5F6g7H8i9","x9Y8z7W6v5U4t3S2r1","b2C3d4E5f6G7h8I9j0"]]}},"type":"object","required":["codes"],"title":"CheckCodeJobBody","description":"Body for ``POST /v1/jobs/check-code``. Vouchers are **always** sent as ``codes`` (a JSON array)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ManualRedeemJobBody":{"properties":{"player_id":{"type":"string","title":"Player Id","description":"Numeric PUBG player id (string of digits)."},"codes":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"Codes","description":"Non-empty array of PUBG UC voucher strings for this player (one Midas session). Each token is exactly **18** characters (letters and digits, any case). For **one** voucher, send a **one-element** array, e.g. `[\"a1B2c3D4e5F6g7H8i9\"]`. At most **10** codes per job; order is preserved. Billing: **1** request from quota per array element when the worker runs (not at POST time).","examples":[["a1B2c3D4e5F6g7H8i9","x9Y8z7W6v5U4t3S2r1"]]}},"type":"object","required":["player_id","codes"],"title":"ManualRedeemJobBody","description":"Body for ``POST /v1/jobs/manual-redeem``. Vouchers are sent as ``codes`` (JSON array), same contract as check-code."},"OrderScreenshotByJobBody":{"properties":{"job_id":{"type":"string","maxLength":64,"minLength":1,"title":"Job Id","description":"Mongo ObjectId string returned when the redeem job was created.","examples":["674a1b2c3d4e5f60718293a4"]},"result_index":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Result Index","description":"Optional index into ``result.results[]`` for batch manual-redeem or stock-redeem jobs. Omitted = first successful row that includes ``order_details``."},"webp_quality":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Webp Quality","description":"WebP lossy quality (1–100). Higher = larger files, sharper text.","default":88}},"type":"object","required":["job_id"],"title":"OrderScreenshotByJobBody","description":"Load redeem data from the server by ``job_id`` (same jobs as ``GET /v1/jobs/{job_id}``)."},"PurchaseBody":{"properties":{"plan_key":{"type":"string","title":"Plan Key","description":"p1 … p6 (normal subscription tiers)."},"api_enabled":{"type":"boolean","title":"Api Enabled","description":"Deprecated. HTTP API access is now a standalone add-on; use POST /v1/subscription/purchase-api-addon instead. Must be false.","default":false},"same_plan_action":{"anyOf":[{"type":"string","enum":["extend","stack"]},{"type":"null"}],"title":"Same Plan Action","description":"Required when you **already have this plan_key active**: `extend` adds +30 days to the farthest-matching row (combined daily limit unchanged); `stack` opens a new parallel row for the same tier (limits sum). Omit when switching tiers or buying for the first time."}},"type":"object","required":["plan_key"],"title":"PurchaseBody"},"StockRedeemJobBody":{"properties":{"player_id":{"type":"string","title":"Player Id"},"picks":{"additionalProperties":{"type":"integer"},"type":"object","title":"Picks","description":"e.g. {\"60\": 1, \"325\": 2}"}},"type":"object","required":["player_id","picks"],"title":"StockRedeemJobBody"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Create your key in Telegram: @sparkucbot → API menu."}}}}