{"openapi":"3.1.0","info":{"title":"Orinax Public CRM API","version":"1.0.0","description":"Per-organization REST API for Grok, Codex, Claude, n8n and custom backends. Authenticate with `Authorization: Bearer oxk_…`. Keys are issued at my.orinax.ru/profile/api-keys. Actions are limited by both key scopes and the actor's CRM ACL."},"servers":[{"url":"https://api.orinax.ru/v1","description":"Production"},{"url":"https://api.dev.orinax.ru/v1","description":"Development"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"oxk"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"Page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"nextCursor":{"type":["string","null"]}}}}},"paths":{"/health":{"get":{"security":[],"summary":"Liveness","responses":{"200":{"description":"OK"}}}},"/me":{"get":{"summary":"Current key + actor","responses":{"200":{"description":"Key and actor"}}}},"/pipelines":{"get":{"summary":"Deal and lead pipelines with stages","responses":{"200":{"description":"Pipelines"}}}},"/members":{"get":{"summary":"Organization members","responses":{"200":{"description":"Members"}}}},"/deals":{"get":{"summary":"List deals","parameters":[{"name":"pipelineId","in":"query","schema":{"type":"string"}},{"name":"stageId","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of deals"}}},"post":{"summary":"Create a deal","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":"number"},"description":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"contactId":{"type":"string"},"companyId":{"type":"string"},"assignedId":{"type":"string"}}}}}},"responses":{"201":{"description":"Created deal"}}}},"/deals/{id}":{"get":{"summary":"Get deal","responses":{"200":{"description":"Deal"}}},"patch":{"summary":"Update deal","responses":{"200":{"description":"Deal"}}},"delete":{"summary":"Soft-delete deal","responses":{"200":{"description":"OK"}}}},"/deals/{id}/stage":{"post":{"summary":"Move deal to a stage","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stageId"],"properties":{"stageId":{"type":"string"}}}}}},"responses":{"200":{"description":"Deal"}}}},"/deals/{id}/comments":{"get":{"summary":"Deal comments","responses":{"200":{"description":"Comments"}}},"post":{"summary":"Add comment","responses":{"201":{"description":"Comment"}}}},"/deals/{id}/timeline":{"get":{"summary":"Deal activity timeline","responses":{"200":{"description":"Activities"}}}},"/contacts":{"get":{"summary":"List contacts","responses":{"200":{"description":"Page"}}},"post":{"summary":"Create contact","responses":{"201":{"description":"Contact"}}}},"/contacts/{id}":{"get":{"summary":"Get contact","responses":{"200":{"description":"Contact"}}},"patch":{"summary":"Update contact","responses":{"200":{"description":"Contact"}}},"delete":{"summary":"Soft-delete contact","responses":{"200":{"description":"OK"}}}},"/companies":{"get":{"summary":"List companies","responses":{"200":{"description":"Page"}}},"post":{"summary":"Create company","responses":{"201":{"description":"Company"}}}},"/companies/{id}":{"get":{"summary":"Get company","responses":{"200":{"description":"Company"}}},"patch":{"summary":"Update company","responses":{"200":{"description":"Company"}}},"delete":{"summary":"Soft-delete company","responses":{"200":{"description":"OK"}}}},"/leads":{"get":{"summary":"List leads","responses":{"200":{"description":"Page"}}},"post":{"summary":"Create lead","responses":{"201":{"description":"Lead"}}}},"/leads/{id}":{"get":{"summary":"Get lead","responses":{"200":{"description":"Lead"}}},"patch":{"summary":"Update lead","responses":{"200":{"description":"Lead"}}},"delete":{"summary":"Soft-delete lead","responses":{"200":{"description":"OK"}}}},"/leads/{id}/convert":{"post":{"summary":"Convert lead to deal","responses":{"201":{"description":"Deal"}}}},"/tasks":{"get":{"summary":"List tasks","responses":{"200":{"description":"Page"}}},"post":{"summary":"Create task","responses":{"201":{"description":"Task"}}}},"/tasks/{id}":{"get":{"summary":"Get task","responses":{"200":{"description":"Task"}}},"patch":{"summary":"Update task (status, title, dueDate)","responses":{"200":{"description":"Task"}}},"delete":{"summary":"Soft-delete task","responses":{"200":{"description":"OK"}}}}}}