{"openapi":"3.1.0","info":{"title":"Sozee Partner API","description":"Sign your users into your Sozee site, manage their access and credits.","version":"1"},"servers":[{"url":"https://app.sozee.ai/api","description":"live (szp_live_ keys)"},{"url":"https://app-dev.sozee.ai/api","description":"test (szp_test_ keys)"}],"paths":{"/partner/v1/me":{"get":{"tags":["partner-api"],"summary":"Me","operationId":"me_partner_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/sessions":{"post":{"tags":["partner-api"],"summary":"Sessions","operationId":"sessions_partner_v1_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/credits":{"post":{"tags":["partner-api"],"summary":"Add Credits","operationId":"add_credits_partner_v1_credits_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCreditsBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCreditsOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/credits/set":{"post":{"tags":["partner-api"],"summary":"Set Balance","operationId":"set_balance_partner_v1_credits_set_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBalanceBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBalanceOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/usage":{"get":{"tags":["partner-api"],"summary":"Usage","operationId":"usage_partner_v1_usage_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"UTC date YYYY-MM-DD, inclusive.","title":"From"},"description":"UTC date YYYY-MM-DD, inclusive."},{"name":"to","in":"query","required":true,"schema":{"type":"string","description":"UTC date YYYY-MM-DD, exclusive (at most 92 days after from).","title":"To"},"description":"UTC date YYYY-MM-DD, exclusive (at most 92 days after from)."},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only this user.","title":"User Id"},"description":"Only this user."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"next_cursor from the previous answer.","title":"Cursor"},"description":"next_cursor from the previous answer."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Unprocessable Entity"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Default Response"}}}},"/partner/v1/user":{"get":{"tags":["partner-api"],"summary":"Get User","operationId":"get_user_partner_v1_user_get","parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","description":"Your own id for the user.","title":"User Id"},"description":"Your own id for the user."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Unprocessable Entity"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Default Response"}}}},"/partner/v1/users/disable":{"post":{"tags":["partner-api"],"summary":"Disable User","operationId":"disable_user_partner_v1_users_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/users/enable":{"post":{"tags":["partner-api"],"summary":"Enable User","operationId":"enable_user_partner_v1_users_enable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/users/signout":{"post":{"tags":["partner-api"],"summary":"Signout User","operationId":"signout_user_partner_v1_users_signout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/partner/v1/users/delete":{"post":{"tags":["partner-api"],"summary":"Delete User","operationId":"delete_user_partner_v1_users_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}},"components":{"schemas":{"AddCreditsBody":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Your own id for the user, used exactly as sent."},"amount":{"title":"Amount","description":"Credits to add: more than 0, at most 1,000,000, at most 2 decimals."},"reference":{"type":"string","title":"Reference","description":"Your unique id for this change (1-128 characters)."}},"additionalProperties":false,"type":"object","required":["user_id","amount","reference"],"title":"AddCreditsBody"},"AddCreditsOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Balance"},"amount":{"type":"number","title":"Amount"},"reference":{"type":"string","title":"Reference"},"replayed":{"type":"boolean","title":"Replayed"}},"type":"object","required":["user_id","amount","reference","replayed"],"title":"AddCreditsOut"},"Credits":{"properties":{"balance":{"type":"number","title":"Balance"}},"type":"object","required":["balance"],"title":"Credits"},"ErrorBody":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"ErrorBody"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"fields":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Fields"}},"type":"object","required":["code","message"],"title":"ErrorDetail"},"MeOut":{"properties":{"partner_id":{"type":"string","title":"Partner Id"},"name":{"type":"string","title":"Name"},"environment":{"type":"string","enum":["live","test"],"title":"Environment"},"site_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Url"}},"type":"object","required":["partner_id","name","environment"],"title":"MeOut"},"SessionBody":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Your own id for the user, used exactly as sent."},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email","description":"Stored for your reference only."},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","required":["user_id"],"title":"SessionBody"},"SessionOut":{"properties":{"launch_url":{"type":"string","title":"Launch Url"},"expires_in":{"type":"integer","title":"Expires In"},"user":{"$ref":"#/components/schemas/UserOut"}},"type":"object","required":["launch_url","expires_in","user"],"title":"SessionOut"},"SetBalanceBody":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Your own id for the user, used exactly as sent."},"balance":{"title":"Balance","description":"The new balance: 0 to 1,000,000, at most 2 decimals."},"reference":{"type":"string","title":"Reference","description":"Your unique id for this change (1-128 characters)."}},"additionalProperties":false,"type":"object","required":["user_id","balance","reference"],"title":"SetBalanceBody"},"SetBalanceOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Balance"},"previous_balance":{"type":"number","title":"Previous Balance"},"reference":{"type":"string","title":"Reference"},"replayed":{"type":"boolean","title":"Replayed"}},"type":"object","required":["user_id","previous_balance","reference","replayed"],"title":"SetBalanceOut"},"StatusOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"status":{"type":"string","enum":["active","disabled","deleted"],"title":"Status"}},"type":"object","required":["user_id","status"],"title":"StatusOut"},"UsageNumbers":{"properties":{"credits_added":{"type":"number","title":"Credits Added"},"credits_spent":{"type":"number","title":"Credits Spent"},"credits_refunded":{"type":"number","title":"Credits Refunded"},"credits_used":{"type":"number","title":"Credits Used"}},"type":"object","required":["credits_added","credits_spent","credits_refunded","credits_used"],"title":"UsageNumbers"},"UsageOut":{"properties":{"from":{"type":"string","title":"From"},"to":{"type":"string","title":"To"},"complete":{"type":"boolean","title":"Complete"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"users":{"items":{"$ref":"#/components/schemas/UsageUser"},"type":"array","title":"Users"},"totals":{"$ref":"#/components/schemas/UsageNumbers"}},"type":"object","required":["from","to","complete","users","totals"],"title":"UsageOut"},"UsageUser":{"properties":{"credits_added":{"type":"number","title":"Credits Added"},"credits_spent":{"type":"number","title":"Credits Spent"},"credits_refunded":{"type":"number","title":"Credits Refunded"},"credits_used":{"type":"number","title":"Credits Used"},"user_id":{"type":"string","title":"User Id"}},"type":"object","required":["credits_added","credits_spent","credits_refunded","credits_used","user_id"],"title":"UsageUser"},"UserBody":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Your own id for the user, used exactly as sent."}},"additionalProperties":false,"type":"object","required":["user_id"],"title":"UserBody"},"UserOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"status":{"type":"string","enum":["active","disabled","deleted"],"title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"credits":{"anyOf":[{"$ref":"#/components/schemas/Credits"},{"type":"null"}]}},"type":"object","required":["user_id","status"],"title":"UserOut"}},"securitySchemes":{"partnerKey":{"type":"http","scheme":"bearer","description":"szp_live_… or szp_test_…"}}},"security":[{"partnerKey":[]}]}