{"openapi":"3.0.0","paths":{"/api/v1/public/contacts":{"get":{"operationId":"PublicContactsController_list","summary":"List contacts (cursor pagination)","parameters":[{"name":"owner_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["contacts"],"security":[{"api-key":[]}]},"post":{"operationId":"PublicContactsController_create","summary":"Create a contact","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"job_title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"national_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"owner_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lifecycle_stage":{"default":"lead","type":"string","maxLength":50},"birthday":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"unsubscribed_email":{"default":false,"type":"boolean"},"unsubscribed_sms":{"default":false,"type":"boolean"},"custom":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"emails":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"default":false,"type":"boolean"}},"required":["email","is_primary"],"additionalProperties":false}},"phones":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":32},"label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"default":false,"type":"boolean"}},"required":["phone","is_primary"],"additionalProperties":false}}},"required":["lifecycle_stage","unsubscribed_email","unsubscribed_sms","custom","emails","phones"],"additionalProperties":false}}}},"responses":{"201":{"description":""}},"tags":["contacts"],"security":[{"api-key":[]}]}},"/api/v1/public/contacts/{id}":{"get":{"operationId":"PublicContactsController_get","summary":"Get one contact","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["contacts"],"security":[{"api-key":[]}]},"patch":{"operationId":"PublicContactsController_update","summary":"Update a contact","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"job_title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"national_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"owner_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lifecycle_stage":{"type":"string","maxLength":50},"birthday":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"unsubscribed_email":{"type":"boolean"},"unsubscribed_sms":{"type":"boolean"},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"address":{"anyOf":[{"type":"object","properties":{"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"line":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["contacts"],"security":[{"api-key":[]}]}},"/api/v1/public/contacts/upsert":{"post":{"operationId":"PublicContactsController_upsert","summary":"Create a contact, or update the one its identity keys match","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"job_title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"national_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"owner_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lifecycle_stage":{"default":"lead","type":"string","maxLength":50},"birthday":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"unsubscribed_email":{"default":false,"type":"boolean"},"unsubscribed_sms":{"default":false,"type":"boolean"},"custom":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"emails":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"default":false,"type":"boolean"}},"required":["email","is_primary"],"additionalProperties":false}},"phones":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":32},"label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"is_primary":{"default":false,"type":"boolean"}},"required":["phone","is_primary"],"additionalProperties":false}}},"required":["lifecycle_stage","unsubscribed_email","unsubscribed_sms","custom","emails","phones"],"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["contacts"],"security":[{"api-key":[]}]}},"/api/v1/public/companies":{"get":{"operationId":"PublicCompaniesController_list","summary":"List companies (cursor pagination)","parameters":[{"name":"owner_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["companies"],"security":[{"api-key":[]}]},"post":{"operationId":"PublicCompaniesController_create","summary":"Create a company","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"national_company_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"economic_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"registration_no":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"custom":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","custom"],"additionalProperties":false}}}},"responses":{"201":{"description":""}},"tags":["companies"],"security":[{"api-key":[]}]}},"/api/v1/public/companies/{id}":{"get":{"operationId":"PublicCompaniesController_get","summary":"Get one company","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["companies"],"security":[{"api-key":[]}]},"patch":{"operationId":"PublicCompaniesController_update","summary":"Update a company","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"national_company_id":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"economic_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"registration_no":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["companies"],"security":[{"api-key":[]}]}},"/api/v1/public/deals":{"get":{"operationId":"PublicDealsController_list","summary":"List deals (cursor pagination)","parameters":[{"name":"owner_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"pipeline_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"stage_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["deals"],"security":[{"api-key":[]}]},"post":{"operationId":"PublicDealsController_create","summary":"Create a deal","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"pipeline_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stage_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","won","lost"]},"won_at":{"type":"string"},"lost_at":{"type":"string"},"value_amount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"default":"IRR","type":"string","minLength":3,"maxLength":3},"expected_close_date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"contact_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"lost_reason_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"custom":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["title","pipeline_id","stage_id","value_amount","currency","custom"],"additionalProperties":false}}}},"responses":{"201":{"description":""}},"tags":["deals"],"security":[{"api-key":[]}]}},"/api/v1/public/deals/{id}":{"get":{"operationId":"PublicDealsController_get","summary":"Get one deal","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["deals"],"security":[{"api-key":[]}]},"patch":{"operationId":"PublicDealsController_update","summary":"Update a deal","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"from_title":{"type":"string","minLength":1,"maxLength":500},"from_owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"from_expected_close_date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"from_value_amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"pipeline_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stage_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","won","lost"]},"won_at":{"type":"string"},"lost_at":{"type":"string"},"value_amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"expected_close_date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"company_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"contact_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"lost_reason_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["deals"],"security":[{"api-key":[]}]}},"/api/v1/public/orders":{"get":{"operationId":"PublicOrdersController_list","summary":"List orders (cursor pagination)","parameters":[{"name":"contact_id","required":true,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["orders"],"security":[{"api-key":[]}]},"post":{"operationId":"PublicOrdersController_create","summary":"Create a order","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","minLength":1,"maxLength":200},"contact_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"deal_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"default":"paid","type":"string","enum":["pending","paid","preparing","shipped","delivered","cancelled","refunded","partially_refunded"]},"total_amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"default":"IRR","type":"string","const":"IRR"},"source":{"default":"manual","type":"string","enum":["manual","api","woocommerce","snappshop","basalam","digikala","duza"]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"provider_connection_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"placed_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"custom":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name_snapshot":{"type":"string","minLength":1,"maxLength":500},"qty":{"default":1,"type":"number","exclusiveMinimum":0,"maximum":9999999999.99},"unit_price":{"type":"integer","minimum":0,"maximum":9007199254740991},"discount_pct":{"default":0,"type":"number","minimum":0,"maximum":100},"discount_amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["name_snapshot","qty","unit_price","discount_pct"],"additionalProperties":false}},"payment_terms":{"type":"string","enum":["prepay","cod"]},"sales_source_code":{"type":"string","minLength":1,"maxLength":64},"shipping_address":{"type":"object","properties":{"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"line":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"required":["status","currency","source","custom"],"additionalProperties":false}}}},"responses":{"201":{"description":""}},"tags":["orders"],"security":[{"api-key":[]}]}},"/api/v1/public/orders/{id}":{"get":{"operationId":"PublicOrdersController_get","summary":"Get one order","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["orders"],"security":[{"api-key":[]}]},"patch":{"operationId":"PublicOrdersController_update","summary":"Update a order","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","paid","preparing","shipped","delivered","cancelled","refunded","partially_refunded"]},"refunded_amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"from_owner_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["orders"],"security":[{"api-key":[]}]}},"/api/v1/public/{parent}/{recordId}/notes":{"get":{"operationId":"PublicNotesController_list","summary":"List notes on a contact, company or deal","parameters":[{"name":"parent","required":true,"in":"path","schema":{"type":"string"}},{"name":"recordId","required":true,"in":"path","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["notes"],"security":[{"api-key":[]}]},"post":{"operationId":"PublicNotesController_create","summary":"Add a note to a contact, company or deal","parameters":[{"name":"parent","required":true,"in":"path","schema":{"type":"string"}},{"name":"recordId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":50000}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":""}},"tags":["notes"],"security":[{"api-key":[]}]}},"/api/v1/public/notes/{id}":{"get":{"operationId":"PublicNotesController_get","summary":"Get one note","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["notes"],"security":[{"api-key":[]}]},"patch":{"operationId":"PublicNotesController_update","summary":"Update a note","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":50000}},"required":["body"],"additionalProperties":false}}}},"responses":{"200":{"description":""}},"tags":["notes"],"security":[{"api-key":[]}]}}},"info":{"title":"Reshta public API","description":"Authenticate with `Authorization: Bearer <api key>` (Settings → API keys). Every POST and PATCH requires an `Idempotency-Key` header. Errors use `{ error: { code, message, details } }`; lists return `{ data, next_cursor }`. Rate limit: 120 requests per minute per key (429 with Retry-After).","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"api-key":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{}}}