{"openapi":"3.1.0","info":{"title":"Relive API","version":"1.0.0"},"paths":{"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/stats":{"get":{"summary":"Stats","operationId":"stats_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sign/upload":{"post":{"summary":"Api Sign Upload","description":"Nhận sign do sign_server_ui.py (máy ixbrowser) PUSH về. KHÔNG cần 6-vị-thần;\nnếu đặt SIGN_UPLOAD_TOKEN thì đòi header X-Sign-Token khớp.","operationId":"api_sign_upload_sign_upload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sign/status":{"get":{"summary":"Api Sign Status","operationId":"api_sign_status_sign_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcn/list":{"post":{"summary":"Api Mcn List","description":"Đọc lời mời MCN đang chờ + hợp tác đang chạy (của account trong profile ix).\nAUTH: apikey (trừ 1 point).","operationId":"api_mcn_list_mcn_list_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McnListRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcn/reply":{"post":{"summary":"Api Mcn Reply","description":"ACCEPT/REJECT lời mời MCN (mcnKOLReplyToMCNRequest) — KHÔNG hoàn tác được.\nChạy với session của profile ix (account trong profile nhận/trả lời).","operationId":"api_mcn_reply_mcn_reply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McnReplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcn/cancel":{"post":{"summary":"Api Mcn Cancel","description":"KOL xin hủy hợp tác MCN đang chạy (mcnKOLApplyToCancelPartnership) — KHÔNG hoàn tác.\nChạy với session của profile ix.","operationId":"api_mcn_cancel_mcn_cancel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McnCancelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliate/sz-token":{"post":{"summary":"Api Sz Token","description":"Lấy bộ sign + SZ TOKEN tươi của profile ix cho 1 URL gql (want_sign).\nTrả: af-ac-enc-sz-token, af-ac-enc-dat, x-sap-sec, x-sap-ri, full headers + cookie + proxy.\n⚠️ Lưu ý (test 2026-11-19): sign BIND SESSION — ghép sz-token/sign với cookie acc KHÁC\nvẫn bị RISK 90309999. Bộ này dùng cho REPLAY cùng session (cookie trả kèm).","operationId":"api_sz_token_affiliate_sz_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SzTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliate/custom-link-sign":{"post":{"summary":"Api Affiliate Custom Link Sign","description":"Tạo affiliate shortlink bằng SIGN đã harvest từ ixbrowser (replay). Đây là đường DUY NHẤT\nhoạt động cho batchCustomLink. Lấy sign từ store (push) hoặc pull socket; bắn N link/1 sign.\nAUTH: chỉ apikey trong body (check + trừ point theo bảng user_point) — KHÔNG cần 6 vị thần\n(theo yêu cầu 2026-11-13; các endpoint khác vẫn giữ 6 vị thần).","operationId":"api_affiliate_custom_link_sign_affiliate_custom_link_sign_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomLinkSignRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliate/custom-link":{"post":{"summary":"Api Affiliate Custom Link","operationId":"api_affiliate_custom_link_affiliate_custom_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateCustomLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliate/product-offer":{"post":{"summary":"Api Affiliate Product Offer","description":"OFFER — 2 đường chính (25/11):\n• mode=box (MẶC ĐỊNH khi có item_id): KÝ CHUNG ĐƯỜNG KOC — hub box-pool api.relive.vn\n  đẩy GET product_v2 qua OkHttp APP THẬT trên box → interceptor SAP tự ký. Data theo\n  acc đang login trên box (cookie/proxy caller KHÔNG dùng). Đã verify 200 code 0.\n• mode=borrow (mặc định khi KHÔNG có item_id — đường customlink): mượn sign web từ\n  profile ix cho ĐÚNG URL, fire với COOKIE + PROXY caller → attribution theo acc caller\n  (bind URL; RISK → force re-harvest 1 lần; dò tối đa 5 trang khi có item_id).\nmode=fetch = body tool account; mode=legacy = đường cũ unsigned (đối chứng, RISK).","operationId":"api_affiliate_product_offer_affiliate_product_offer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateProductOfferRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/search/image":{"post":{"summary":"Api Search By Image","operationId":"api_search_by_image_search_image_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchByImageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/create":{"post":{"summary":"Admin Create Key","operationId":"admin_create_key_admin_keys_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/list":{"post":{"summary":"Admin List Keys","operationId":"admin_list_keys_admin_keys_list_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminListKeysRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/get":{"post":{"summary":"Admin Get Key","operationId":"admin_get_key_admin_keys_get_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminGetKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/update":{"post":{"summary":"Admin Update Key","operationId":"admin_update_key_admin_keys_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/delete":{"post":{"summary":"Admin Delete Key","operationId":"admin_delete_key_admin_keys_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/stats/db":{"post":{"summary":"Admin Stats Db","operationId":"admin_stats_db_admin_stats_db_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAuthBase"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AdminAuthBase":{"properties":{"apikey":{"type":"string","title":"Apikey"}},"type":"object","required":["apikey"],"title":"AdminAuthBase"},"AdminCreateKeyRequest":{"properties":{"apikey":{"type":"string","title":"Apikey"},"role":{"type":"string","title":"Role","default":"user"},"point":{"type":"number","title":"Point","default":0},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"}},"type":"object","required":["apikey"],"title":"AdminCreateKeyRequest"},"AdminDeleteKeyRequest":{"properties":{"apikey":{"type":"string","title":"Apikey"},"key":{"type":"string","title":"Key"}},"type":"object","required":["apikey","key"],"title":"AdminDeleteKeyRequest"},"AdminGetKeyRequest":{"properties":{"apikey":{"type":"string","title":"Apikey"},"key":{"type":"string","title":"Key"}},"type":"object","required":["apikey","key"],"title":"AdminGetKeyRequest"},"AdminListKeysRequest":{"properties":{"apikey":{"type":"string","title":"Apikey"},"limit":{"type":"integer","title":"Limit","default":50},"offset":{"type":"integer","title":"Offset","default":0},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"q":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},"type":"object","required":["apikey"],"title":"AdminListKeysRequest"},"AdminUpdateKeyRequest":{"properties":{"apikey":{"type":"string","title":"Apikey"},"key":{"type":"string","title":"Key"},"point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Point"},"point_mode":{"type":"string","title":"Point Mode","default":"set"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"}},"type":"object","required":["apikey","key"],"title":"AdminUpdateKeyRequest"},"AffiliateCustomLinkRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"cookie":{"type":"string","title":"Cookie"},"country":{"type":"string","title":"Country","default":"vn"},"links":{"items":{"$ref":"#/components/schemas/CustomLinkParam"},"type":"array","title":"Links"},"csrf_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Csrf Token"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"},"sap_headers":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Sap Headers"},"client_request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Request Id"},"app_version":{"type":"string","title":"App Version","default":"38528"},"use_exec":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Exec"},"exec_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exec Url"},"exec_api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exec Api Key"},"sticky":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sticky"},"sign_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sign Country"}},"type":"object","required":["apikey","cookie","links"],"title":"AffiliateCustomLinkRequest"},"AffiliateProductOfferRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"cookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cookie"},"country":{"type":"string","title":"Country","default":"vn"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"shop_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Id"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"list_type":{"type":"integer","title":"List Type","default":0},"sort_type":{"type":"integer","title":"Sort Type","default":1},"page_offset":{"type":"integer","title":"Page Offset","default":0},"page_limit":{"type":"integer","title":"Page Limit","default":20},"client_type":{"type":"integer","title":"Client Type","default":1},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},"type":"object","required":["apikey"],"title":"AffiliateProductOfferRequest"},"CustomLinkParam":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"originalLink":{"type":"string","title":"Originallink"},"advancedLinkParams":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Advancedlinkparams"}},"type":"object","required":["originalLink"],"title":"CustomLinkParam"},"CustomLinkSignRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"country":{"type":"string","title":"Country","default":"ph"},"links":{"items":{"$ref":"#/components/schemas/CustomLinkParam"},"type":"array","title":"Links"},"cookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cookie"},"gqlq":{"type":"string","title":"Gqlq","default":"batchCustomLink"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"force":{"type":"boolean","title":"Force","default":false},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"}},"type":"object","required":["apikey","links"],"title":"CustomLinkSignRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"McnCancelRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"country":{"type":"string","title":"Country","default":"vn"},"cookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cookie"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"},"mcn_id":{"type":"string","title":"Mcn Id"},"partnership_id":{"type":"string","title":"Partnership Id"},"reason":{"type":"string","title":"Reason","default":"OTHERS"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["apikey","mcn_id","partnership_id"],"title":"McnCancelRequest"},"McnListRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"country":{"type":"string","title":"Country","default":"vn"},"cookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cookie"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"page_num":{"type":"integer","title":"Page Num","default":1},"page_size":{"type":"integer","title":"Page Size","default":20}},"type":"object","required":["apikey"],"title":"McnListRequest"},"McnReplyRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"country":{"type":"string","title":"Country","default":"vn"},"cookie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cookie"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"},"mcn_id":{"type":"string","title":"Mcn Id"},"request_id":{"type":"string","title":"Request Id"},"request_type":{"type":"string","title":"Request Type","default":"InvitationRequest"},"is_accept":{"type":"boolean","title":"Is Accept"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["apikey","mcn_id","request_id","is_accept"],"title":"McnReplyRequest"},"SearchByImageRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"cookie":{"type":"string","title":"Cookie"},"image_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Key"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"bounding_box":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bounding Box"},"page":{"type":"integer","title":"Page","default":1},"by":{"type":"string","title":"By","default":"relevancy"},"order":{"type":"string","title":"Order","default":"desc"},"language":{"type":"string","title":"Language","default":"vi"},"sign_headers":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Sign Headers"},"include_raw":{"type":"boolean","title":"Include Raw","default":false},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"}},"type":"object","required":["apikey","cookie"],"title":"SearchByImageRequest"},"SignUploadRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"cc":{"type":"string","title":"Cc","default":"ph"},"gqlq":{"type":"string","title":"Gqlq","default":"batchCustomLink"},"headers":{"type":"object","title":"Headers"},"cookie":{"type":"string","title":"Cookie","default":""},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"ts":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ts"},"expires_in_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In S"},"proxy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proxy"}},"type":"object","required":["headers"],"title":"SignUploadRequest"},"SzTokenRequest":{"properties":{"machine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Machine Id"},"apikey":{"type":"string","title":"Apikey"},"country":{"type":"string","title":"Country","default":"vn"},"operation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation"},"profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["apikey"],"title":"SzTokenRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}