{"openapi":"3.1.0","info":{"title":"Worbo API","version":"1.0.0","description":"API-ul Worbo: contacte, obiecte și evenimente, mesaje și template-uri WhatsApp, segmente, automatizări, campanii, inboxul, cataloage și webhooks.","contact":{"name":"Worbo","email":"hello@worbo.app"}},"servers":[{"url":"https://api.worbo.app/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"workspace","x-displayName":"Organizația","description":"Cheia folosită, numerele WhatsApp, consumul lunii și jurnalul."},{"name":"contacts","x-displayName":"Contacte","description":"Persoanele, găsite după oricare dintre identitățile lor: telefon, email, BSUID sau ID-ul de la o sursă."},{"name":"consents","x-displayName":"Consimțământ","description":"Istoricul consimțământului, la care doar se adaugă, pe scopuri și topicuri, cu dovada fiecărui acord."},{"name":"schema","x-displayName":"Model de date","description":"Câmpurile contactelor, tipurile de obiect și tipurile de eveniment ale organizației, cu JSON Schema lor."},{"name":"objects","x-displayName":"Obiecte","description":"Abonamente, rezervări, comenzi: înregistrările fiecărui tip de obiect, legate de contacte în roluri."},{"name":"files","x-displayName":"Fișiere","description":"Fișierele câmpurilor de tip fișier: se urcă întâi, apoi se dau prin ID ca valoare a câmpului."},{"name":"events","x-displayName":"Evenimente","description":"Ce s-a întâmplat la sursă; evenimentele pornesc automatizări și actualizează obiecte."},{"name":"messages","x-displayName":"Mesaje","description":"Mesajele WhatsApp trimise și primite, prin aceleași reguli ca în dashboard."},{"name":"vault","x-displayName":"Seiful de documente","description":"Fișiere date unui contact printr-un link care expiră, anunțat pe WhatsApp și deschis doar cu un cod trimis la telefonul contactului."},{"name":"otp","x-displayName":"Coduri de verificare","description":"Coduri de unică folosință trimise pe WhatsApp cu template-ul de autentificare al numărului, verificate de Worbo sau de organizație."},{"name":"recommendations","x-displayName":"Recomandări","description":"Regulile motorului de recomandări și ce ar recomanda acum una dintre ele unui contact, cu motivul fiecărui articol."},{"name":"templates","x-displayName":"Template-uri","description":"Template-urile WhatsApp: ciornele verificate de linter, trimiterea la Meta și statusul."},{"name":"offers","x-displayName":"Oferte","description":"Ofertele găsite după cod și folosite, la recepție sau în software-ul sursei."},{"name":"segments","x-displayName":"Segmente","description":"Segmentele dinamice de contacte, numărate pe loc."},{"name":"automations","x-displayName":"Automatizări","description":"Citirea automatizărilor, pornirea uneia pentru un contact și scoaterea unui contact dintr-o rulare."},{"name":"campaigns","x-displayName":"Campanii","description":"Ciornele campaniilor și estimarea lor; lansarea se aprobă în dashboard."},{"name":"conversations","x-displayName":"Conversații","description":"Inboxul: conversațiile, mesajele lor, răspunsurile, alocarea și închiderea."},{"name":"catalogs","x-displayName":"Cataloage","description":"Produse, servicii, clase, abonamente și locații, scrise unul câte unul sau în lot."},{"name":"webhooks","x-displayName":"Webhooks","description":"Endpoint-urile care primesc evenimentele Worbo, livrările și reluările lor."},{"name":"analytics","x-displayName":"Rapoarte","description":"Rezultatele unei perioade și conversiile automatizărilor."}],"paths":{"/audit-logs":{"get":{"operationId":"listAuditLogs","tags":["workspace"],"summary":"Listează jurnalul organizației","description":"Cere scope-ul workspace:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["workspace:read"],"x-worbo-live-key":true,"parameters":[{"name":"action","in":"query","description":"Doar rândurile acestei acțiuni.","schema":{"type":"string","examples":["contact.created"]}},{"name":"since","in":"query","description":"Doar ce s-a schimbat în acest moment sau după el.","schema":{"type":"string","format":"date-time","examples":["2026-10-01T00:00:00+03:00"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogEntry"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/automations":{"get":{"operationId":"listAutomations","tags":["automations"],"summary":"Listează automatizările","description":"Cere scope-ul automations:read.","x-worbo-scopes":["automations:read"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/automations/{automation}":{"get":{"operationId":"getAutomation","tags":["automations"],"summary":"Citește o automatizare, cu definiția și cifrele ei","description":"Cere scope-ul automations:read.","x-worbo-scopes":["automations:read"],"x-worbo-live-key":false,"parameters":[{"name":"automation","in":"path","required":true,"description":"ID-ul automatizării.","schema":{"type":"integer","examples":[8]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AutomationDetail"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/automations/{automation}/runs":{"post":{"operationId":"startAutomation","tags":["automations"],"summary":"Pornește o automatizare pentru un contact","description":"Doar o automatizare activă, cu pornire manuală. Rularea ia cel mai nou obiect al contactului de tipul ales în declanșator; același Idempotency-Key o pornește o singură dată. Cere scope-ul automations:run.","x-worbo-scopes":["automations:run"],"x-worbo-live-key":false,"parameters":[{"name":"automation","in":"path","required":true,"description":"ID-ul automatizării.","schema":{"type":"integer","examples":[8]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStart"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AutomationRun"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/automations/{automation}/runs/{run}":{"delete":{"operationId":"exitAutomationRun","tags":["automations"],"summary":"Scoate un contact dintr-o rulare","description":"Cere scope-ul automations:run.","x-worbo-scopes":["automations:run"],"x-worbo-live-key":false,"parameters":[{"name":"automation","in":"path","required":true,"description":"ID-ul automatizării.","schema":{"type":"integer","examples":[8]}},{"name":"run","in":"path","required":true,"description":"ID-ul rulării.","schema":{"type":"integer","examples":[3301]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AutomationRun"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns":{"get":{"operationId":"listCampaigns","tags":["campaigns"],"summary":"Listează campaniile","description":"Cere scope-ul campaigns:read.","x-worbo-scopes":["campaigns:read"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"draftCampaign","tags":["campaigns"],"summary":"Creează ciorna unei campanii","description":"Momentele vin în ISO 8601, cu fusul lor orar. Lansarea se aprobă în dashboard. Cere scope-ul campaigns:write.","x-worbo-scopes":["campaigns:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign}":{"get":{"operationId":"getCampaign","tags":["campaigns"],"summary":"Citește o campanie, cu raportul mesajelor și costul","description":"Cere scope-ul campaigns:read.","x-worbo-scopes":["campaigns:read"],"x-worbo-live-key":false,"parameters":[{"name":"campaign","in":"path","required":true,"description":"ID-ul campaniei.","schema":{"type":"integer","examples":[21]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignDetail"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign}/estimate":{"post":{"operationId":"estimateCampaign","tags":["campaigns"],"summary":"Estimează audiența și costul unei campanii","description":"Cu aceleași excluderi ca la lansare: fără WhatsApp, fără consimțământ, de nelivrat, plafonul de frecvență. Cere scope-ul campaigns:write.","x-worbo-scopes":["campaigns:write"],"x-worbo-live-key":false,"parameters":[{"name":"campaign","in":"path","required":true,"description":"ID-ul campaniei.","schema":{"type":"integer","examples":[21]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignEstimate"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/catalogs":{"get":{"operationId":"listCatalogs","tags":["catalogs"],"summary":"Listează cataloagele","description":"Cere scope-ul catalogs:read.","x-worbo-scopes":["catalogs:read"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Catalog"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/catalogs/{catalog}/items":{"get":{"operationId":"listCatalogItems","tags":["catalogs"],"summary":"Listează articolele unui catalog","description":"Cere scope-ul catalogs:read.","x-worbo-scopes":["catalogs:read"],"x-worbo-live-key":false,"parameters":[{"name":"catalog","in":"path","required":true,"description":"Cheia catalogului, de exemplu fit.classes.","schema":{"type":"string","examples":["fit.classes"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogItem"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"upsertCatalogItem","tags":["catalogs"],"summary":"Creează sau actualizează un articol după ID-ul lui la sursă","description":"Cere scope-ul catalogs:write.","x-worbo-scopes":["catalogs:write"],"x-worbo-live-key":false,"parameters":[{"name":"catalog","in":"path","required":true,"description":"Cheia catalogului, de exemplu fit.classes.","schema":{"type":"string","examples":["fit.classes"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogItemWrite"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CatalogItem"}},"required":["data"]}}}},"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CatalogItem"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/catalogs/{catalog}/items/batch":{"post":{"operationId":"upsertCatalogItems","tags":["catalogs"],"summary":"Creează sau actualizează cel mult 100 de articole","description":"Cere scope-ul catalogs:write.","x-worbo-scopes":["catalogs:write"],"x-worbo-live-key":false,"parameters":[{"name":"catalog","in":"path","required":true,"description":"Cheia catalogului, de exemplu fit.classes.","schema":{"type":"string","examples":["fit.classes"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BatchRequest"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CatalogItemWrite"}}}}]}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BatchResult"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CatalogItem"}}}]}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts":{"get":{"operationId":"listContacts","tags":["contacts"],"summary":"Listează și caută contacte","description":"Cere scope-ul contacts:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["contacts:read"],"x-worbo-live-key":true,"parameters":[{"name":"search","in":"query","description":"Text din nume, telefon sau email.","schema":{"type":"string","examples":["Ana"]}},{"name":"phone","in":"query","description":"Contactul cu acest telefon.","schema":{"type":"string","examples":["+40722123456"]}},{"name":"email","in":"query","description":"Contactul cu acest email.","schema":{"type":"string","format":"email","examples":["ana@example.com"]}},{"name":"external_id","in":"query","description":"Contactul cu acest ID la sursa dată în source.","schema":{"type":"string","examples":["crm-1001"]}},{"name":"source","in":"query","description":"Sursa ID-ului extern sau a contactelor.","schema":{"type":"string","examples":["crm"]}},{"name":"tag","in":"query","description":"Doar contactele cu acest tag.","schema":{"type":"string","examples":["vip"]}},{"name":"updated_since","in":"query","description":"Doar ce s-a schimbat în acest moment sau după el.","schema":{"type":"string","format":"date-time","examples":["2026-10-01T00:00:00+03:00"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"upsertContact","tags":["contacts"],"summary":"Creează sau actualizează un contact după oricare dintre identitățile lui","description":"Contactul se găsește după oricare dintre identitățile trimise, iar celelalte i se adaugă. Cu update_existing_only, un contact necunoscut nu se creează. Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactWrite"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}},"required":["data"]}}}},"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/batch":{"post":{"operationId":"upsertContacts","tags":["contacts"],"summary":"Creează sau actualizează cel mult 100 de contacte","description":"Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BatchRequest"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactWrite"}}}}]}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BatchResult"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}]}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/schema":{"get":{"operationId":"getContactSchema","tags":["schema"],"summary":"Citește JSON Schema corpului care scrie un contact","description":"Cu câmpurile proprii ale organizației; o citește orice cheie. O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JsonSchema"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}":{"get":{"operationId":"getContact","tags":["contacts"],"summary":"Citește un contact","description":"Cere scope-ul contacts:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["contacts:read"],"x-worbo-live-key":true,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateContact","tags":["contacts"],"summary":"Schimbă câmpurile și tag-urile unui contact","description":"Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"eraseContact","tags":["contacts"],"summary":"Șterge un contact, la cererea persoanei (GDPR)","description":"Datele contactului se șterg definitiv; jurnalul păstrează doar faptul că s-a făcut ștergerea. Cere scope-ul contacts:delete.","x-worbo-scopes":["contacts:delete"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"204":{"description":"Fără conținut","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}/bot":{"post":{"operationId":"switchContactBot","tags":["contacts"],"summary":"Oprește sau pornește botul pe cuvinte cheie pentru un contact","description":"De exemplu când un CRM preia conversația. Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotSwitch"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BotState"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}/consents":{"get":{"operationId":"getContactConsents","tags":["consents"],"summary":"Citește consimțământul unui contact, cu istoricul lui","description":"Cere scope-ul contacts:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["contacts:read"],"x-worbo-live-key":true,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consents"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"recordContactConsent","tags":["consents"],"summary":"Înregistrează un acord, cu dovada lui, sau o retragere","description":"Un acord retras de persoană îl poate reda doar ea: printr-un formular, la checkout sau printr-un link. Cere scope-ul consents:write.","x-worbo-scopes":["consents:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConsentsRecorded"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}/identities":{"get":{"operationId":"listContactIdentities","tags":["contacts"],"summary":"Listează identitățile unui contact","description":"Cere scope-ul contacts:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["contacts:read"],"x-worbo-live-key":true,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactIdentity"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"attachContactIdentity","tags":["contacts"],"summary":"Adaugă o identitate unui contact","description":"Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentityWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ContactIdentity"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}/identities/{identity}":{"delete":{"operationId":"detachContactIdentity","tags":["contacts"],"summary":"Desprinde o identitate de un contact","description":"Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"name":"identity","in":"path","required":true,"description":"ID-ul identității.","schema":{"type":"integer","examples":[501]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"204":{"description":"Fără conținut","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{contact}/merge":{"post":{"operationId":"mergeContacts","tags":["contacts"],"summary":"Unește alt contact cu acesta","description":"Identitățile, istoricul și obiectele celuilalt contact se mută aici; urmează evenimentul contact.merged. Cere scope-ul contacts:write.","x-worbo-scopes":["contacts:write"],"x-worbo-live-key":false,"parameters":[{"name":"contact","in":"path","required":true,"description":"ID-ul contactului.","schema":{"type":"integer","examples":[123]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMerge"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/conversations":{"get":{"operationId":"listConversations","tags":["conversations"],"summary":"Listează conversațiile","description":"Cere scope-ul conversations:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["conversations:read"],"x-worbo-live-key":true,"parameters":[{"name":"status","in":"query","description":"Doar conversațiile cu acest status.","schema":{"type":"string","enum":["open","pending","resolved"]}},{"name":"contact_id","in":"query","description":"Doar conversațiile acestui contact.","schema":{"type":"integer","examples":[123]}},{"name":"assigned_user_id","in":"query","description":"Doar conversațiile alocate acestui membru.","schema":{"type":"integer","examples":[5]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/conversations/{conversation}/assign":{"post":{"operationId":"assignConversation","tags":["conversations"],"summary":"Alocă o conversație unui membru","description":"Cere scope-ul conversations:reply.","x-worbo-scopes":["conversations:reply"],"x-worbo-live-key":false,"parameters":[{"name":"conversation","in":"path","required":true,"description":"ID-ul conversației.","schema":{"type":"integer","examples":[640]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationAssign"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/conversations/{conversation}/close":{"post":{"operationId":"closeConversation","tags":["conversations"],"summary":"Închide o conversație","description":"Cere scope-ul conversations:reply.","x-worbo-scopes":["conversations:reply"],"x-worbo-live-key":false,"parameters":[{"name":"conversation","in":"path","required":true,"description":"ID-ul conversației.","schema":{"type":"integer","examples":[640]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Conversation"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/conversations/{conversation}/messages":{"get":{"operationId":"listConversationMessages","tags":["conversations"],"summary":"Listează mesajele unei conversații","description":"Cere scope-ul conversations:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["conversations:read"],"x-worbo-live-key":true,"parameters":[{"name":"conversation","in":"path","required":true,"description":"ID-ul conversației.","schema":{"type":"integer","examples":[640]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"replyToConversation","tags":["conversations"],"summary":"Răspunde cu un text liber, în fereastra de 24 de ore","description":"Cere scope-ul conversations:reply.","x-worbo-scopes":["conversations:reply"],"x-worbo-live-key":false,"parameters":[{"name":"conversation","in":"path","required":true,"description":"ID-ul conversației.","schema":{"type":"integer","examples":[640]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationReply"}}}},"responses":{"202":{"description":"Acceptat","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Message"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/conversions":{"get":{"operationId":"listConversions","tags":["analytics"],"summary":"Listează conversiile automatizărilor","description":"Cere scope-ul analytics:read.","x-worbo-scopes":["analytics:read"],"x-worbo-live-key":false,"parameters":[{"name":"automation_id","in":"query","description":"Doar conversiile acestei automatizări.","schema":{"type":"integer","examples":[8]}},{"name":"since","in":"query","description":"Doar ce s-a schimbat în acest moment sau după el.","schema":{"type":"string","format":"date-time","examples":["2026-10-01T00:00:00+03:00"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversion"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/event-types":{"get":{"operationId":"listEventTypes","tags":["schema"],"summary":"Listează tipurile de eveniment","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/event-types/{type}":{"get":{"operationId":"getEventType","tags":["schema"],"summary":"Citește un tip de eveniment, cu proprietățile lui","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventType"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/event-types/{type}/schema":{"get":{"operationId":"getEventTypeSchema","tags":["schema"],"summary":"Citește JSON Schema proprietăților unui tip de eveniment","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JsonSchema"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/events":{"post":{"operationId":"recordEvent","tags":["events"],"summary":"Înregistrează un eveniment","description":"Contactul și obiectul evenimentului se găsesc sau se creează; un eveniment cu același ID de la aceeași sursă se înregistrează o singură dată. Cere scope-ul events:write.","x-worbo-scopes":["events:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWrite"}}}},"responses":{"202":{"description":"Acceptat","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventResult"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/events/batch":{"post":{"operationId":"recordEvents","tags":["events"],"summary":"Înregistrează cel mult 100 de evenimente","description":"Cere scope-ul events:write.","x-worbo-scopes":["events:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BatchRequest"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EventWrite"}}}}]}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BatchResult"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventResult"}}}]}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/field-definitions":{"get":{"operationId":"listContactFields","tags":["schema"],"summary":"Listează câmpurile contactelor","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinition"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createField","tags":["schema"],"summary":"Creează un câmp al contactelor sau al unui tip de obiect","description":"Prin aceleași verificări și limite ca în dashboard; cheia nu se mai schimbă după aceea. Cere scope-ul schema:write.","x-worbo-scopes":["schema:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinitionWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FieldDefinition"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/files":{"post":{"operationId":"uploadFile","tags":["files"],"summary":"Urcă un fișier pentru un câmp de tip fișier","description":"PDF, imagini, documente Office, text sau CSV, până la 16 MB. Un fișier nefolosit de niciun câmp într-o zi se șterge. Cere scope-ul files:write.","x-worbo-scopes":["files:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/FileUpload"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/File"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/files/{file}":{"get":{"operationId":"getFile","tags":["files"],"summary":"Citește un fișier, cu contactul sau obiectul care îl folosește","description":"Cere scope-ul files:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["files:read"],"x-worbo-live-key":true,"parameters":[{"name":"file","in":"path","required":true,"description":"ID-ul fișierului.","schema":{"type":"integer","examples":[77]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/File"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/files/{file}/content":{"get":{"operationId":"downloadFile","tags":["files"],"summary":"Descarcă conținutul unui fișier","description":"Cere scope-ul files:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["files:read"],"x-worbo-live-key":true,"parameters":[{"name":"file","in":"path","required":true,"description":"ID-ul fișierului.","schema":{"type":"integer","examples":[77]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/me":{"get":{"operationId":"getMe","tags":["workspace"],"summary":"Citește cheia folosită și organizația ei","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/messages":{"get":{"operationId":"listMessages","tags":["messages"],"summary":"Listează mesajele","description":"Cere scope-ul messages:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["messages:read"],"x-worbo-live-key":true,"parameters":[{"name":"contact_id","in":"query","description":"Doar mesajele acestui contact.","schema":{"type":"integer","examples":[123]}},{"name":"direction","in":"query","description":"Primite sau trimise.","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"status","in":"query","description":"Doar mesajele cu acest status.","schema":{"type":"string","examples":["delivered"]}},{"name":"since","in":"query","description":"Doar ce s-a schimbat în acest moment sau după el.","schema":{"type":"string","format":"date-time","examples":["2026-10-01T00:00:00+03:00"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"sendMessage","tags":["messages"],"summary":"Trimite unui contact un template, un text liber sau un formular","description":"Mesajul trece prin aceleași reguli ca în dashboard: consimțământ, ore de liniște, frecvență și limite. Un text liber sau un formular cere fereastra de 24 de ore deschisă; un refuz vine cu codul motivului, de exemplu window_closed. Răspunsurile la un formular vin prin webhook-ul flow.submitted. Cere scope-ul messages:send.","x-worbo-scopes":["messages:send"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSend"}}}},"responses":{"202":{"description":"Acceptat","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Message"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/messages/{message}":{"get":{"operationId":"getMessage","tags":["messages"],"summary":"Citește un mesaj și statusul lui","description":"Cere scope-ul messages:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["messages:read"],"x-worbo-live-key":true,"parameters":[{"name":"message","in":"path","required":true,"description":"ID-ul mesajului.","schema":{"type":"integer","examples":[7001]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Message"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/messages/{message}/evidence":{"get":{"operationId":"getMessageEvidence","tags":["messages"],"summary":"Citește dovada unui mesaj trimis cu un template candidat suport durabil","description":"Textul exact primit de contact și documentul din antet păstrat de Worbo, cu amprentele lor SHA-256, și momentele raportate de Meta. Nu înlocuiește e-mailul cerut de lege. Cere scope-ul messages:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["messages:read"],"x-worbo-live-key":true,"parameters":[{"name":"message","in":"path","required":true,"description":"ID-ul mesajului.","schema":{"type":"integer","examples":[7001]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageEvidence"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/messages/{message}/evidence/document":{"get":{"operationId":"downloadMessageEvidenceDocument","tags":["messages"],"summary":"Descarcă documentul păstrat ca dovadă a unui mesaj","description":"Cere scope-ul messages:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["messages:read"],"x-worbo-live-key":true,"parameters":[{"name":"message","in":"path","required":true,"description":"ID-ul mesajului.","schema":{"type":"integer","examples":[7001]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/numbers":{"get":{"operationId":"listNumbers","tags":["workspace"],"summary":"Listează numerele WhatsApp, cu calitatea, tranșa și încălzirea","description":"Cere scope-ul workspace:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["workspace:read"],"x-worbo-live-key":true,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Number"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/object-types":{"get":{"operationId":"listObjectTypes","tags":["schema"],"summary":"Listează tipurile de obiect","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ObjectType"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createObjectType","tags":["schema"],"summary":"Creează un tip de obiect","description":"Tipul este al organizației și intră în limita ei de tipuri. Cere scope-ul schema:write.","x-worbo-scopes":["schema:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectTypeWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ObjectType"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/object-types/{type}":{"get":{"operationId":"getObjectType","tags":["schema"],"summary":"Citește un tip de obiect, cu statusurile, rolurile și câmpurile lui","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ObjectType"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/object-types/{type}/schema":{"get":{"operationId":"getObjectTypeSchema","tags":["schema"],"summary":"Citește JSON Schema corpului care scrie un obiect al tipului","description":"O poate apela orice cheie a organizației.","x-worbo-scopes":[],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/JsonSchema"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/objects/{type}":{"get":{"operationId":"listObjects","tags":["objects"],"summary":"Listează obiectele unui tip","description":"Cere scope-ul objects:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["objects:read"],"x-worbo-live-key":true,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"name":"external_id","in":"query","description":"Obiectul cu acest ID la sursă.","schema":{"type":"string","examples":["abn-7781"]}},{"name":"source","in":"query","description":"Doar obiectele acestei surse.","schema":{"type":"string","examples":["upfit"]}},{"name":"contact_id","in":"query","description":"Doar obiectele legate de acest contact.","schema":{"type":"integer","examples":[123]}},{"name":"status","in":"query","description":"Statusul pe fiecare axă, de exemplu status[lifecycle]=active.","schema":{"type":"object","additionalProperties":true},"style":"deepObject"},{"name":"updated_since","in":"query","description":"Doar ce s-a schimbat în acest moment sau după el.","schema":{"type":"string","format":"date-time","examples":["2026-10-01T00:00:00+03:00"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Object"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"upsertObject","tags":["objects"],"summary":"Creează sau actualizează un obiect după ID-ul lui la sursă","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectWrite"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/objects/{type}/batch":{"post":{"operationId":"upsertObjects","tags":["objects"],"summary":"Creează sau actualizează cel mult 100 de obiecte","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BatchRequest"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ObjectWrite"}}}}]}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BatchResult"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}}}]}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/objects/{type}/{object}":{"get":{"operationId":"getObject","tags":["objects"],"summary":"Citește un obiect","description":"Cere scope-ul objects:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["objects:read"],"x-worbo-live-key":true,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"name":"object","in":"path","required":true,"description":"ID-ul obiectului.","schema":{"type":"integer","examples":[456]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateObject","tags":["objects"],"summary":"Schimbă câmpurile sau statusurile unui obiect","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"name":"object","in":"path","required":true,"description":"ID-ul obiectului.","schema":{"type":"integer","examples":[456]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectUpdate"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/objects/{type}/{object}/relations":{"post":{"operationId":"relateContact","tags":["objects"],"summary":"Leagă un contact de un obiect, într-un rol","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"name":"object","in":"path","required":true,"description":"ID-ul obiectului.","schema":{"type":"integer","examples":[456]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ObjectRelation"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/objects/{type}/{object}/relations/{relation}":{"delete":{"operationId":"unrelateContact","tags":["objects"],"summary":"Șterge legătura unui contact cu un obiect","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"type","in":"path","required":true,"description":"Cheia tipului, de exemplu fit.membership.","schema":{"type":"string","examples":["fit.membership"],"pattern":"^[a-z0-9][a-z0-9._-]*$"}},{"name":"object","in":"path","required":true,"description":"ID-ul obiectului.","schema":{"type":"integer","examples":[456]}},{"name":"relation","in":"path","required":true,"description":"ID-ul legăturii.","schema":{"type":"integer","examples":[77]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"204":{"description":"Fără conținut","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/offers/{code}":{"get":{"operationId":"getOffer","tags":["offers"],"summary":"Găsește o ofertă după cod","description":"Cere scope-ul objects:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["objects:read"],"x-worbo-live-key":true,"parameters":[{"name":"code","in":"path","required":true,"description":"Codul ofertei.","schema":{"type":"string","examples":["AUTUMN-7KQ2"],"pattern":"^[A-Za-z0-9 #-]{4,40}$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/offers/{code}/redeem":{"post":{"operationId":"redeemOffer","tags":["offers"],"summary":"Marchează o ofertă ca folosită","description":"Cere scope-ul objects:write.","x-worbo-scopes":["objects:write"],"x-worbo-live-key":false,"parameters":[{"name":"code","in":"path","required":true,"description":"Codul ofertei.","schema":{"type":"string","examples":["AUTUMN-7KQ2"],"pattern":"^[A-Za-z0-9 #-]{4,40}$"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferRedeem"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Object"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/otp":{"post":{"operationId":"sendOtp","tags":["otp"],"summary":"Trimite un cod de verificare pe WhatsApp","description":"Fără code, Worbo generează un cod din 6 cifre, valabil 10 minute, și îl verifică prin verifyOtp; cu code, organizația îl verifică singură. Mesajul pleacă imediat, cu template-ul de autentificare al numărului, aprobat din pagina lui. Un telefon despre care se știe că nu are WhatsApp primește imediat otp_undeliverable, ca site-ul să ofere SMS sau email; altfel, eșecul vine ca status al mesajului și prin webhook-ul message.failed. Un telefon primește cel mult 5 coduri în 15 minute și unul la 30 de secunde (otp_rate_limited, otp_too_soon). Codul nu apare niciodată în răspunsuri, webhooks sau inbox. Cere scope-ul otp:send.","x-worbo-scopes":["otp:send"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpSend"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Otp"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/otp/{otp}/verify":{"post":{"operationId":"verifyOtp","tags":["otp"],"summary":"Verifică un cod de verificare generat de Worbo","description":"Un cod se folosește o singură dată, în termenul lui, cu cel mult 5 încercări; răspunsul spune de ce o verificare nu a reușit. Un cod dat de organizație primește 409 otp_not_verifiable. Cere scope-ul otp:verify.","x-worbo-scopes":["otp:verify"],"x-worbo-live-key":false,"parameters":[{"name":"otp","in":"path","required":true,"description":"ID-ul codului de verificare, din răspunsul care l-a trimis.","schema":{"type":"integer","examples":[880]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpVerify"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OtpVerification"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/preference-links":{"post":{"operationId":"createPreferenceLink","tags":["consents"],"summary":"Creează un link semnat către centrul de preferințe al unui contact","description":"Linkul e valabil 30 de zile. Cere scope-ul consents:write.","x-worbo-scopes":["consents:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceLinkWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreferenceLink"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/recommendation-rules":{"get":{"operationId":"listRecommendationRules","tags":["recommendations"],"summary":"Listează regulile de recomandare","description":"Regulile active, făcute în dashboard la Recomandări: catalogul, tipurile în ordinea lor, numărul de articole și cooldown-urile. Automatizările le folosesc după cheie. Cere scope-ul recommendations:read.","x-worbo-scopes":["recommendations:read"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RecommendationRule"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/recommendation-rules/{rule}/results":{"get":{"operationId":"getRecommendationResults","tags":["recommendations"],"summary":"Citește rezultatele unei reguli de recomandare","description":"Pe o perioadă, implicit ultimele 30 de zile: recomandările trimise și destinatarii lor, pașii săriți pe motive, clicurile pe articole, conversiile în 7 zile de la mesaj (o comandă pentru produse, o rezervare pentru clase, un abonament pentru planuri), venitul per destinatar, grupul de control al automatizărilor, dezabonările de după mesaj și costul Meta per conversie. Cere scope-ul recommendations:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["recommendations:read"],"x-worbo-live-key":true,"parameters":[{"name":"rule","in":"path","required":true,"description":"Cheia regulii de recomandare.","schema":{"type":"string","examples":["ecom.cross_sell"],"pattern":"^[a-z0-9._-]+$"}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecommendationResults"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/recommendations/preview":{"post":{"operationId":"previewRecommendations","tags":["recommendations"],"summary":"Previzualizează o regulă de recomandare pe un contact","description":"Ce ar recomanda acum regula contactului, cu motivul fiecărui articol, articolele lăsate deoparte și de ce, cooldown-ul regulii și consimțământul cerut. Nu se trimite nimic, iar cooldown-urile rămân cum sunt. Recomandările din istoricul contactului cer scopul recomandări personalizate pe lângă marketing. Cere scope-ul recommendations:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["recommendations:read"],"x-worbo-live-key":true,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendationPreviewRequest"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecommendationPreview"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/reports/results":{"get":{"operationId":"getPeriodResults","tags":["analytics"],"summary":"Citește rezultatele unei perioade","description":"Automatizările cu grupul de control, linia de bază, valoarea și costul, în zilele organizației. Cere scope-ul analytics:read.","x-worbo-scopes":["analytics:read"],"x-worbo-live-key":false,"parameters":[{"name":"from","in":"query","required":true,"description":"Prima zi a perioadei.","schema":{"type":"string","format":"date","examples":["2026-10-01"]}},{"name":"to","in":"query","required":true,"description":"Ultima zi a perioadei.","schema":{"type":"string","format":"date","examples":["2026-10-15"]}},{"name":"location_id","in":"query","description":"Doar contactele acestei locații de bază.","schema":{"type":"integer","examples":[7]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PeriodResults"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/segments":{"get":{"operationId":"listSegments","tags":["segments"],"summary":"Listează segmentele","description":"Cere scope-ul segments:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["segments:read"],"x-worbo-live-key":true,"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createSegment","tags":["segments"],"summary":"Creează un segment","description":"Cere scope-ul segments:write.","x-worbo-scopes":["segments:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Segment"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/segments/count":{"post":{"operationId":"countSegment","tags":["segments"],"summary":"Numără contactele unei definiții, fără să o salveze","description":"Cere scope-ul segments:write.","x-worbo-scopes":["segments:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCountRequest"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SegmentCount"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/segments/{segment}":{"get":{"operationId":"getSegment","tags":["segments"],"summary":"Citește un segment, cu numărul lui curent","description":"Cere scope-ul segments:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["segments:read"],"x-worbo-live-key":true,"parameters":[{"name":"segment","in":"path","required":true,"description":"ID-ul segmentului.","schema":{"type":"integer","examples":[12]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SegmentDetail"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/templates":{"get":{"operationId":"listTemplates","tags":["templates"],"summary":"Listează template-urile","description":"Cere scope-ul templates:read.","x-worbo-scopes":["templates:read"],"x-worbo-live-key":false,"parameters":[{"name":"number_id","in":"query","description":"Doar template-urile acestui număr.","schema":{"type":"integer","examples":[3]}},{"name":"status","in":"query","description":"Doar template-urile cu acest status.","schema":{"type":"string","examples":["approved"]}},{"name":"name","in":"query","description":"Doar template-urile cu acest nume.","schema":{"type":"string","examples":["booking_confirmed"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"draftTemplate","tags":["templates"],"summary":"Creează ciorna unui template, verificată de linter","description":"Cere scope-ul templates:write.","x-worbo-scopes":["templates:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TemplateDraft"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/templates/{template}":{"get":{"operationId":"getTemplate","tags":["templates"],"summary":"Citește un template","description":"Cere scope-ul templates:read.","x-worbo-scopes":["templates:read"],"x-worbo-live-key":false,"parameters":[{"name":"template","in":"path","required":true,"description":"ID-ul template-ului.","schema":{"type":"integer","examples":[31]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/templates/{template}/submit":{"post":{"operationId":"submitTemplate","tags":["templates"],"summary":"Trimite un template la Meta","description":"Oprit de linter, cu motivul, sau acceptat, cu statusul „în revizuire”. Cere scope-ul templates:write.","x-worbo-scopes":["templates:write"],"x-worbo-live-key":false,"parameters":[{"name":"template","in":"path","required":true,"description":"ID-ul template-ului.","schema":{"type":"integer","examples":[31]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/usage":{"get":{"operationId":"getUsage","tags":["workspace"],"summary":"Citește consumul unei luni și limitele planului","description":"Cere scope-ul workspace:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["workspace:read"],"x-worbo-live-key":true,"parameters":[{"name":"month","in":"query","description":"Luna, ca AAAA-LL; implicit luna curentă.","schema":{"type":"string","examples":["2026-10"]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Usage"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/vault":{"post":{"operationId":"shareVaultDocument","tags":["vault"],"summary":"Dă un fișier unui contact prin seif","description":"Urcă întâi fișierul prin uploadFile. Contactul primește pe WhatsApp template-ul worbo_document, cu titlul, termenul și butonul care deschide linkul; linkul se deschide doar cu un cod trimis la telefonul lui. Răspunsul conține linkul, singura dată când apare: trimite-l și pe email, dacă e nevoie. Numărul are nevoie de template-urile seifului aprobate, create din pagina seifului. Cere scope-ul vault:write.","x-worbo-scopes":["vault:write"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultDocument"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/vault/{vault}":{"get":{"operationId":"getVaultDocument","tags":["vault"],"summary":"Citește un document din seif, cu starea linkului și deschiderile","description":"Cere scope-ul vault:read. Citește date, deci cere o cheie live.","x-worbo-scopes":["vault:read"],"x-worbo-live-key":true,"parameters":[{"name":"vault","in":"path","required":true,"description":"ID-ul documentului din seif.","schema":{"type":"integer","examples":[15]}},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultDocument"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"revokeVaultDocument","tags":["vault"],"summary":"Retrage linkul unui document din seif","description":"Cere scope-ul vault:write.","x-worbo-scopes":["vault:write"],"x-worbo-live-key":false,"parameters":[{"name":"vault","in":"path","required":true,"description":"ID-ul documentului din seif.","schema":{"type":"integer","examples":[15]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"204":{"description":"Fără conținut","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhook-deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["webhooks"],"summary":"Listează livrările evenimentelor","description":"Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"name":"endpoint_id","in":"query","description":"Doar livrările către acest endpoint.","schema":{"type":"integer","examples":[4]}},{"name":"status","in":"query","description":"Doar livrările cu acest status.","schema":{"type":"string","enum":["pending","delivered","failed"]}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"type":["string","null"],"description":"Cursorul paginii următoare; null pe ultima."},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhook-deliveries/{delivery}/replay":{"post":{"operationId":"replayWebhookDelivery","tags":["webhooks"],"summary":"Retrimite o livrare","description":"Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"name":"delivery","in":"path","required":true,"description":"ID-ul livrării.","schema":{"type":"integer","examples":[9001]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"202":{"description":"Acceptat","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","tags":["webhooks"],"summary":"Listează endpoint-urile de webhook","description":"Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createWebhookEndpoint","tags":["webhooks"],"summary":"Adaugă un endpoint de webhook","description":"Secretul de semnare vine în răspuns, doar acum. Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWrite"}}}},"responses":{"201":{"description":"Creată","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhook-endpoints/{endpoint}":{"patch":{"operationId":"updateWebhookEndpoint","tags":["webhooks"],"summary":"Schimbă adresa sau evenimentele unui endpoint","description":"Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"name":"endpoint","in":"path","required":true,"description":"ID-ul endpoint-ului de webhook.","schema":{"type":"integer","examples":[4]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWrite"}}}},"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteWebhookEndpoint","tags":["webhooks"],"summary":"Șterge un endpoint de webhook","description":"Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"name":"endpoint","in":"path","required":true,"description":"ID-ul endpoint-ului de webhook.","schema":{"type":"integer","examples":[4]}},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhook-endpoints/{endpoint}/rotate":{"post":{"operationId":"rotateWebhookSecret","tags":["webhooks"],"summary":"Rotește secretul de semnare al unui endpoint","description":"Secretul vechi rămâne valabil 24 de ore; între timp se trimit ambele semnături. Cere scope-ul webhooks:manage.","x-worbo-scopes":["webhooks:manage"],"x-worbo-live-key":false,"parameters":[{"name":"endpoint","in":"path","required":true,"description":"ID-ul endpoint-ului de webhook.","schema":{"type":"integer","examples":[4]}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/DryRun"},{"$ref":"#/components/parameters/WorboVersion"}],"responses":{"200":{"description":"OK","headers":{"Worbo-Version":{"$ref":"#/components/headers/WorboVersion"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Cheia API a organizației: wk_live_… pentru datele reale, wk_test_… pentru sandbox."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"O cheie unică a cererii, de exemplu un UUID: o cerere repetată cu aceeași cheie primește primul răspuns, fără să se facă din nou lucrul.","schema":{"type":"string","maxLength":255}},"DryRun":{"name":"dry_run","in":"query","required":false,"description":"Trece prin toate verificările și întoarce ce s-ar întâmpla, fără să salveze nimic.","schema":{"type":"boolean"}},"Limit":{"name":"limit","in":"query","required":false,"description":"Câte elemente are o pagină, între 1 și 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},"Cursor":{"name":"cursor","in":"query","required":false,"description":"next_cursor de la pagina anterioară.","schema":{"type":"string"}},"WorboVersion":{"name":"Worbo-Version","in":"header","required":false,"description":"Versiunea API, ca dată; fără ea, versiunea cheii.","schema":{"type":"string","enum":["2026-10-05"],"example":"2026-10-05"}}},"headers":{"WorboVersion":{"description":"Versiunea API folosită pentru cerere.","schema":{"type":"string","example":"2026-10-05"}}},"responses":{"Unauthenticated":{"description":"Cheia lipsește, nu e validă, a fost retrasă sau a expirat.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Forbidden":{"description":"Cheia nu are scope-ul operației sau o cheie de test citește date.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotFound":{"description":"Resursa nu există sau aparține altei organizații.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Conflict":{"description":"Idempotency-Key a fost folosit pentru altă cerere sau acea cerere încă rulează.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Unprocessable":{"description":"Cererea nu e validă: validation_failed, schema_violation sau codul regulii care a oprit-o.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"RateLimited":{"description":"Prea multe cereri; așteaptă secundele din Retry-After.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"schemas":{"AuditLogEntry":{"type":"object","properties":{"id":{"type":"integer","examples":[1201]},"action":{"type":"string","examples":["contact.created"]},"label":{"type":"string","examples":["Contact created"]},"source":{"type":"string","examples":["api"]},"actor":{"type":["object","null"],"additionalProperties":true},"subject":{"type":["object","null"],"additionalProperties":true},"properties":{"type":"object","additionalProperties":true},"created_at":{"type":"string","format":"date-time"}}},"Automation":{"type":"object","properties":{"id":{"type":"integer","examples":[8]},"name":{"type":"string","examples":["Recâștigare"]},"status":{"type":"string","enum":["draft","active","paused"],"examples":["active"]},"trigger":{"type":["string","null"],"examples":["manual"]},"number_id":{"type":["integer","null"],"examples":[3]},"recipe":{"type":["string","null"]},"version_id":{"type":["integer","null"],"examples":[14]},"holdout_percent":{"type":"integer","examples":[0]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"AutomationDetail":{"allOf":[{"$ref":"#/components/schemas/Automation"},{"type":"object","properties":{"definition":{"type":["object","null"],"additionalProperties":true},"report":{"type":"object","additionalProperties":true}}}]},"AutomationRun":{"type":"object","properties":{"id":{"type":"integer","examples":[3301]},"automation_id":{"type":"integer","examples":[8]},"contact_id":{"type":"integer","examples":[123]},"object_id":{"type":["integer","null"]},"status":{"type":"string","enum":["active","waiting","completed","exited","cancelled"],"examples":["active"]},"exit_reason":{"type":["string","null"]},"held_out":{"type":"boolean","examples":[false]},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"converted_at":{"type":["string","null"],"format":"date-time"}}},"BatchRequest":{"type":"object","description":"Cel mult 100 de elemente, scrise fiecare separat; eroarea unuia nu le oprește pe celelalte.","properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":true}}},"required":["items"]},"BatchResult":{"type":"object","properties":{"index":{"type":"integer","examples":[0]},"status":{"type":"string","enum":["created","updated","error"],"examples":["created"]},"data":{"type":"object","additionalProperties":true},"error":{"$ref":"#/components/schemas/Problem"}},"required":["index","status"]},"BotState":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]},"bot_enabled":{"type":"boolean","examples":[false]}}},"BotSwitch":{"type":"object","properties":{"enabled":{"type":"boolean","examples":[false]}},"required":["enabled"]},"Campaign":{"type":"object","properties":{"id":{"type":"integer","examples":[21]},"name":{"type":"string","examples":["Oferta de toamnă"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","stopped"],"examples":["draft"]},"kind":{"type":"string","enum":["template","free","object"],"examples":["template"]},"text":{"type":["string","null"]},"object_id":{"type":["integer","null"]},"object_roles":{"type":["array","null"],"items":{"type":"string"}},"purpose":{"type":["string","null"],"enum":["marketing","transactional",null]},"number_id":{"type":["integer","null"],"examples":[3]},"template":{"type":["string","null"],"examples":["autumn_offer"]},"variables":{"type":"array","items":{"type":["string","null"]}},"header_text":{"type":["string","null"]},"topic":{"type":["string","null"]},"segment_id":{"type":["integer","null"],"examples":[12]},"location_id":{"type":["integer","null"]},"scheduled_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"wave_by":{"type":"string","enum":["size","location","segment"],"examples":["size"]},"wave_size":{"type":["integer","null"]},"wave_hours":{"type":"integer","examples":[24]},"wave_segments":{"type":["array","null"],"items":{"type":"integer"}},"budget":{"type":["string","null"],"examples":["250.00"]},"total":{"type":["integer","null"]},"processed":{"type":["integer","null"]},"created_at":{"type":["string","null"],"format":"date-time"}}},"CampaignDetail":{"allOf":[{"$ref":"#/components/schemas/Campaign"},{"type":"object","properties":{"report":{"type":"object","additionalProperties":true}}}]},"CampaignEstimate":{"type":"object","properties":{"audience":{"type":"integer","examples":[240]},"contactable":{"type":"integer","examples":[198]},"excluded":{"type":"object","properties":{"whatsapp":{"type":"integer","examples":[12]},"consent":{"type":"integer","examples":[28]},"optin":{"type":"integer","examples":[10]},"marketing":{"type":"integer","examples":[18]},"window":{"type":"integer","examples":[0]},"undeliverable":{"type":"integer","examples":[2]}}},"capped":{"type":"integer","examples":[0]},"other_countries":{"type":"integer","examples":[0]},"number":{"type":["object","null"],"description":"Calitatea numărului (GREEN, YELLOW sau RED) și până când a oprit Meta marketingul pe el, dacă l-a oprit.","properties":{"quality":{"type":["string","null"],"examples":["GREEN"]},"marketing_paused_until":{"type":["string","null"],"format":"date-time"}}},"united_states":{"type":"integer","description":"La marketing, destinatarii din Statele Unite, după țara contactului: Meta nu livrează template-uri de marketing pe numerele din SUA.","examples":[0]},"template":{"type":["object","null"],"additionalProperties":true},"cost":{"type":"object","properties":{"amount":{"type":"number","examples":[10.79]},"free":{"type":"integer","examples":[0]},"rate":{"type":"number","examples":[0.0545]},"currency":{"type":"string","examples":["EUR"]},"country":{"type":"string","examples":["RO"]},"budget_messages":{"type":["integer","null"]}}},"waves":{"type":"object","properties":{"count":{"type":"integer","examples":[1]},"per_day":{"type":"integer","examples":[198]},"last_at":{"type":["string","null"],"format":"date-time"},"sizes":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"limit":{"type":"object","properties":{"daily":{"type":["integer","null"],"examples":[1000]},"days":{"type":["integer","null"],"examples":[1]},"over":{"type":"boolean","examples":[false]}}},"start":{"type":"string","format":"date-time"},"quiet_until":{"type":["string","null"],"format":"date-time"},"ends_before_last_wave":{"type":"boolean","examples":[false]}}},"CampaignWrite":{"type":"object","properties":{"name":{"type":"string","examples":["Oferta de toamnă"]},"kind":{"type":"string","enum":["template","free","object"],"default":"template","description":"free: un mesaj liber, fără template, doar către contactele cu fereastra de 24h deschisă pe număr. object: un template utility către oamenii unui obiect, în locul unui segment."},"object_id":{"type":["integer","null"],"description":"Cu kind object: obiectul ai cărui oameni primesc anunțul.","examples":[456]},"object_roles":{"type":["array","null"],"items":{"type":"string"},"description":"Cu kind object: rolurile oamenilor care îl primesc; fără roluri, toți.","examples":[["holder"]]},"text":{"type":["string","null"],"maxLength":4096,"description":"Mesajul liber, același pentru toți; doar cu kind free."},"purpose":{"type":["string","null"],"enum":["marketing","transactional",null],"description":"Ce este mesajul liber: marketing, cu acordul și plafonul lui, sau informare."},"number_id":{"type":["integer","null"],"examples":[3]},"template":{"type":["string","null"],"examples":["autumn_offer"]},"variables":{"type":"array","items":{"type":["string","null"]}},"header_text":{"type":["string","null"]},"topic":{"type":["string","null"]},"segment_id":{"type":["integer","null"],"examples":[12]},"location_id":{"type":["integer","null"]},"scheduled_at":{"type":["string","null"],"format":"date-time","examples":["2026-10-20T10:00:00+03:00"]},"expires_at":{"type":["string","null"],"format":"date-time"},"wave_by":{"type":"string","enum":["size","location","segment"],"examples":["size"]},"wave_size":{"type":["integer","null"]},"wave_hours":{"type":"integer","examples":[24]},"wave_segments":{"type":["array","null"],"items":{"type":"integer"}},"budget":{"type":["number","null"]}},"required":["name"]},"Catalog":{"type":"object","properties":{"key":{"type":"string","examples":["fit.classes"]},"name":{"type":"string","examples":["Classes"]},"kind":{"type":"string","enum":["product","service","class","trainer","plan","location","other"],"examples":["class"]},"currency":{"type":["string","null"],"examples":["RON"]},"source":{"type":"string","examples":["fitness"]}}},"CatalogItem":{"type":"object","properties":{"id":{"type":"integer","examples":[310]},"external_id":{"type":["string","null"],"examples":["yoga"]},"sku":{"type":["string","null"]},"name":{"type":"string","examples":["Yoga"]},"price":{"type":["string","null"],"description":"Un număr zecimal, ca text.","examples":["50.00"]},"currency":{"type":["string","null"],"examples":["RON"]},"stock":{"type":["integer","null"]},"available":{"type":["boolean","null"],"examples":[true]},"recommendable":{"type":"boolean","description":"False pentru articolele care nu se recomandă: sensibile, cu restricție de vârstă sau care nu se vând separat.","examples":[true]},"url":{"type":["string","null"]},"image_url":{"type":["string","null"]},"fields":{"type":"object","additionalProperties":true},"updated_at":{"type":["string","null"],"format":"date-time"}}},"CatalogItemWrite":{"type":"object","properties":{"id":{"type":"integer"},"external_id":{"type":"string","examples":["yoga"]},"name":{"type":"string","examples":["Yoga"]},"sku":{"type":"string"},"price":{"type":"number","examples":[50]},"currency":{"type":"string","examples":["RON"]},"stock":{"type":"integer"},"available":{"type":"boolean","examples":[true]},"recommendable":{"type":"boolean","examples":[true]},"url":{"type":"string"},"image_url":{"type":"string"},"custom":{"type":"object","additionalProperties":true}}},"ConsentRow":{"type":"object","properties":{"id":{"type":"integer","examples":[900]},"purpose":{"type":"string","enum":["channel","transactional","marketing","recommendations"],"examples":["marketing"]},"topic":{"type":["string","null"]},"state":{"type":"string","enum":["granted","revoked"],"examples":["granted"]},"basis":{"type":"string","enum":["consent","contract","soft_opt_in","legitimate_interest"],"examples":["consent"]},"source":{"type":"string","enum":["form","checkout","click_to_chat","keyword","activation_button","preference_center","panel","import","api","meta_signal","suppression"],"examples":["form"]},"proof":{"type":["object","null"],"additionalProperties":true},"occurred_at":{"type":"string","format":"date-time"}}},"ConsentStatus":{"type":"object","properties":{"purposes":{"type":"object","additionalProperties":{"type":["string","null"]},"examples":[{"channel":"granted","transactional":null,"marketing":"granted","recommendations":null}]},"topics":{"type":"object","additionalProperties":true},"meta_blocked":{"type":"boolean","examples":[false]},"blocked":{"type":"boolean","examples":[false]},"allowed":{"type":"object","properties":{"transactional":{"type":"boolean","examples":[true]},"marketing":{"type":"boolean","examples":[true]},"recommendations":{"type":"boolean","examples":[false]}}}}},"ConsentWrite":{"type":"object","properties":{"purposes":{"type":"array","minItems":1,"items":{"type":"string","enum":["channel","transactional","marketing","recommendations"]},"examples":[["channel","marketing"]]},"state":{"type":"string","enum":["granted","revoked"],"examples":["granted"]},"source":{"type":"string","enum":["form","checkout","click_to_chat","api"],"examples":["form"]},"topic":{"type":["string","null"]},"basis":{"type":"string","enum":["consent","soft_opt_in"]},"proof":{"type":"object","additionalProperties":{"type":"string"},"description":"Ce dovedește acordul: textul formularului, pagina, IP-ul.","examples":[{"form":"Newsletter, footer","text":"I agree to receive offers on WhatsApp"}]},"occurred_at":{"type":["string","null"],"format":"date-time"}},"required":["purposes","state"]},"Consents":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ConsentStatus"},"history":{"type":"array","items":{"$ref":"#/components/schemas/ConsentRow"}}}},"ConsentsRecorded":{"type":"object","properties":{"recorded":{"type":"array","items":{"$ref":"#/components/schemas/ConsentRow"}},"status":{"$ref":"#/components/schemas/ConsentStatus"},"history":{"type":"array","items":{"$ref":"#/components/schemas/ConsentRow"}}}},"Contact":{"type":"object","properties":{"id":{"type":"integer","examples":[123]},"identities":{"type":"array","items":{"$ref":"#/components/schemas/ContactIdentity"}},"fields":{"type":"object","additionalProperties":true,"description":"Câmpurile standard și câmpurile proprii ale organizației, după cheie.","examples":[{"first_name":"Ana","last_name":"Popescu","language":"ro"}]},"tags":{"type":"array","items":{"type":"string"},"examples":[["vip"]]},"source":{"type":"string","enum":["manual","whatsapp","import","api","business_app"],"examples":["api"]},"blocked":{"type":"boolean","examples":[false]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"ContactIdentity":{"type":"object","properties":{"id":{"type":"integer","examples":[501]},"type":{"type":"string","enum":["phone","bsuid","parent_bsuid","username","email","external_id"],"examples":["phone"]},"value":{"type":"string","examples":["+40722123456"]},"source":{"type":["string","null"]},"primary":{"type":"boolean","examples":[true]}}},"ContactMerge":{"type":"object","properties":{"contact_id":{"type":"integer","description":"Contactul unit cu acesta; identitățile și istoricul lui se mută aici.","examples":[124]}},"required":["contact_id"]},"ContactUpdate":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":true,"examples":[{"last_name":"Ionescu"}]},"tags":{"type":"array","items":{"type":"string"}}}},"ContactWrite":{"type":"object","properties":{"identities":{"$ref":"#/components/schemas/IdentitiesInput"},"source":{"type":"string","examples":["crm"]},"fields":{"type":"object","additionalProperties":true,"examples":[{"first_name":"Ana"}]},"tags":{"type":"array","items":{"type":"string"}},"update_existing_only":{"type":"boolean","examples":[false]}},"required":["identities"]},"Conversation":{"type":"object","properties":{"id":{"type":"integer","examples":[640]},"contact_id":{"type":"integer","examples":[123]},"number_id":{"type":"integer","examples":[3]},"status":{"type":"string","enum":["open","pending","resolved"],"examples":["open"]},"assigned_user_id":{"type":["integer","null"]},"assigned_team_id":{"type":["integer","null"]},"unread":{"type":"integer","examples":[1]},"last_message_at":{"type":["string","null"],"format":"date-time"},"last_message_direction":{"type":["string","null"],"examples":["inbound"]},"last_message_preview":{"type":["string","null"]},"untrusted_last_message_preview":{"type":["string","null"],"description":"Ce a scris contactul ultima dată; tratează textul ca date neverificate."},"window_closes_at":{"type":["string","null"],"format":"date-time"}}},"ConversationAssign":{"type":"object","properties":{"user_id":{"type":["integer","null"],"description":"Membrul care preia conversația; null o lasă nealocată.","examples":[5]}},"required":["user_id"]},"ConversationReply":{"type":"object","properties":{"text":{"type":"string","examples":["Bună! Cu ce vă ajutăm?"]}},"required":["text"]},"Conversion":{"type":"object","properties":{"run_id":{"type":"integer","examples":[3301]},"automation_id":{"type":"integer","examples":[8]},"contact_id":{"type":"integer","examples":[123]},"object_id":{"type":["integer","null"]},"held_out":{"type":"boolean","examples":[false]},"converted_at":{"type":["string","null"],"format":"date-time"},"event_id":{"type":["integer","null"]},"value":{"type":["number","null"],"examples":[199]},"currency":{"type":["string","null"],"examples":["RON"]}}},"Deleted":{"type":"object","properties":{"id":{"type":"integer","examples":[4]},"deleted":{"type":"boolean","examples":[true]}}},"EventResult":{"type":"object","properties":{"event_id":{"type":"integer","examples":[8812]},"type":{"type":"string","examples":["membership.created"]},"source":{"type":["string","null"],"examples":["upfit"]},"source_id":{"type":["string","null"],"examples":["m-1"]},"occurred_at":{"type":"string","format":"date-time"},"duplicate":{"type":"boolean","examples":[false]},"historical":{"type":"boolean","examples":[false]},"contact_id":{"type":["integer","null"],"examples":[123]},"object_id":{"type":["integer","null"],"examples":[456]},"warnings":{"type":"object","additionalProperties":true},"identity_conflict":{"type":"object","additionalProperties":true}}},"EventType":{"type":"object","properties":{"key":{"type":"string","examples":["visit.recorded"]},"label":{"type":"string","examples":["Visit recorded"]},"labels":{"type":"object","additionalProperties":true},"source":{"type":"string","examples":["fitness"]},"violation_policy":{"type":"string","enum":["reject","warn","drop"],"examples":["reject"]},"properties":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinition"}}}},"EventWrite":{"type":"object","properties":{"id":{"type":["string","integer"],"description":"ID-ul evenimentului la sursă; același ID se înregistrează o singură dată.","examples":["m-1"]},"type":{"type":"string","examples":["membership.created"]},"occurred_at":{"type":"string","format":"date-time","examples":["2026-10-15T09:00:00+03:00"]},"source":{"type":"string","examples":["upfit"]},"contact":{"type":"object","examples":[{"phone":"+40722123456"}]},"object":{"type":"object","properties":{"type":{"type":"string"},"external_id":{"type":"string"},"role":{"type":"string"},"upsert":{"type":"object"}},"examples":[{"type":"fit.membership","external_id":"abn-7781","upsert":{"statuses":{"lifecycle":"active"}}}]},"properties":{"type":"object","additionalProperties":true,"examples":[{"plan":"plan-12"}]},"historical":{"type":"boolean","examples":[false]},"update_existing_only":{"type":"boolean","examples":[false]}},"required":["type"]},"FieldDefinition":{"type":"object","properties":{"key":{"type":"string","examples":["shoe_size"]},"label":{"type":"string","examples":["Shoe size"]},"labels":{"type":"object","additionalProperties":true},"type":{"type":"string","enum":["text","number","money","date","datetime","boolean","single_select","multi_select","phone","email","url","reference","file","location","interval"],"examples":["number"]},"required":{"type":"boolean","examples":[false]},"unique":{"type":"boolean","examples":[false]},"sensitivity":{"type":"string","enum":["normal","personal","special"],"examples":["normal"]},"key_date":{"type":"boolean","examples":[false]},"calculated":{"type":"boolean","examples":[false]},"multiple":{"type":"boolean","examples":[false]},"choices":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"labels":{"type":"object","additionalProperties":true}}}},"default":{"description":"Valoarea implicită, de tipul câmpului."},"archived":{"type":"boolean","examples":[false]}}},"FieldDefinitionWrite":{"type":"object","properties":{"object_type":{"type":"string","description":"Cheia tipului de obiect; fără ea, câmpul este al contactelor.","examples":["vehicle"]},"labels":{"type":"object","additionalProperties":{"type":"string"},"examples":[{"en":"Plate","ro":"Număr de înmatriculare"}]},"key":{"type":"string","examples":["plate"]},"type":{"type":"string","enum":["text","number","money","date","datetime","boolean","single_select","multi_select","phone","email","url","reference","file","location","interval"],"examples":["text"]},"sensitivity":{"type":"string","enum":["normal","personal","special"]},"is_required":{"type":"boolean"},"is_unique":{"type":"boolean"},"segmentable":{"type":"boolean"},"templatable":{"type":"boolean"},"key_date":{"type":"boolean"},"audited":{"type":"boolean"},"settings":{"type":"object","additionalProperties":true},"default_value":{"description":"Valoarea implicită, de tipul câmpului."}},"required":["labels","type"]},"File":{"type":"object","properties":{"id":{"type":["integer","null"],"examples":[77]},"name":{"type":"string","examples":["contract.pdf"]},"mime":{"type":"string","examples":["application/pdf"]},"size":{"type":"integer","examples":[48213]},"sha256":{"type":["string","null"]},"contact_id":{"type":["integer","null"],"examples":[123]},"object_id":{"type":["integer","null"],"examples":[456]},"created_at":{"type":["string","null"],"format":"date-time"}}},"FileUpload":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Fișierul: PDF, imagine, Office, text sau CSV, până la 16 MB."}},"required":["file"]},"IdentitiesInput":{"type":"object","description":"Cel puțin o identitate; contactul se găsește după oricare dintre ele.","properties":{"phone":{"type":"string","description":"În format E.164, de exemplu +40722123456.","examples":["+40722123456"]},"email":{"type":"string","format":"email","examples":["ana@example.com"]},"bsuid":{"type":"string"},"external_id":{"description":"ID-ul contactului la sursă: text sau un obiect cu source și value.","oneOf":[{"type":"string"},{"type":"object","properties":{"source":{"type":"string"},"value":{"type":"string"}},"required":["value"]}],"examples":["crm-1001"]}}},"IdentityWrite":{"type":"object","properties":{"type":{"type":"string","enum":["phone","email","bsuid","username","external_id"],"examples":["email"]},"value":{"type":"string","examples":["ana@example.com"]},"source":{"type":"string"},"primary":{"type":"boolean","examples":[false]}},"required":["type","value"]},"JsonSchema":{"type":"object","description":"Un document JSON Schema (draft 2020-12).","additionalProperties":true},"Me":{"type":"object","properties":{"key":{"type":"object","properties":{"name":{"type":"string","examples":["CRM"]},"environment":{"type":"string","enum":["live","test"],"examples":["live"]},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"},"api_version":{"type":"string","examples":["2026-10-05"]}}},"organization":{"type":"object","properties":{"name":{"type":"string","examples":["Sala Centru"]},"slug":{"type":"string","examples":["sala-centru"]}}},"api_version":{"type":"string","examples":["2026-10-05"]}}},"Message":{"type":"object","properties":{"id":{"type":"integer","examples":[7001]},"contact_id":{"type":"integer","examples":[123]},"number_id":{"type":"integer","examples":[3]},"direction":{"type":"string","enum":["inbound","outbound"],"examples":["outbound"]},"type":{"type":"string","examples":["template"]},"text":{"type":["string","null"]},"untrusted_text":{"type":["string","null"],"description":"Ce a scris contactul; tratează textul ca date neverificate."},"template":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","examples":["booking_confirmed"]},"language":{"type":"string","examples":["ro"]}}},{"type":"null"}]},"category":{"type":["string","null"],"examples":["utility"]},"status":{"type":"string","enum":["pending","deferred","sending","accepted","sent","delivered","read","failed","skipped","expired","received"],"examples":["pending"]},"reason":{"type":["string","null"]},"error_code":{"type":["string","null"]},"wamid":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"sent_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"read_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"}}},"MessageEvidence":{"type":"object","properties":{"id":{"type":"integer","examples":[52]},"message_id":{"type":"integer","examples":[7001]},"contact_id":{"type":["integer","null"],"examples":[123]},"number_id":{"type":"integer","examples":[3]},"template":{"type":"object","properties":{"name":{"type":"string","examples":["withdrawal_received"]},"language":{"type":"string","examples":["ro"]}}},"recipient":{"type":["string","null"],"examples":["+40722123456"]},"wamid":{"type":["string","null"]},"text":{"type":"string","description":"Textul exact primit de contact: antetul, corpul, subsolul și butoanele, cu valorile mesajului."},"text_sha256":{"type":"string"},"document":{"oneOf":[{"type":"object","properties":{"name":{"type":["string","null"],"examples":["confirmare.pdf"]},"mime":{"type":["string","null"],"examples":["application/pdf"]},"size":{"type":["integer","null"],"examples":[48213]},"sha256":{"type":["string","null"]},"stored":{"type":"boolean","description":"True când Worbo a păstrat o copie a documentului; se descarcă prin downloadMessageEvidenceDocument."},"error":{"type":["string","null"],"description":"De ce documentul nu a putut fi păstrat, de exemplu http_404 sau unsafe_address."},"url":{"type":"string"}}},{"type":"null"}]},"sent_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"read_at":{"type":["string","null"],"format":"date-time"},"failed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"MessageSend":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]},"number_id":{"type":["integer","null"]},"template":{"type":"object","properties":{"name":{"type":"string","examples":["booking_confirmed"]},"language":{"type":"string","examples":["ro"]},"variables":{"type":"array","items":{"type":["string","null"]},"description":"Valorile variabilelor; o valoare lipsă se completează din câmpul variabilei. La un template din bibliotecă nemodificat, prenumele lipsă ia textul de rezervă al bibliotecii, de exemplu „Bună, suntem echipa sălii.”.","examples":[["Ana","3 octombrie, 18:00"]]}},"required":["name"]},"text":{"type":"string","description":"Un text liber, doar cât timp fereastra de 24 de ore e deschisă; în locul lui template."},"flow":{"type":"object","properties":{"key":{"type":"string","description":"Cheia unui formular WhatsApp publicat în contul numărului.","examples":["nps"]},"body":{"type":"string","description":"Textul mesajului, deasupra butonului care deschide formularul.","examples":["Ne spui în 10 secunde cum a fost?"]}},"required":["key","body"]}},"required":["contact_id"]},"Number":{"type":"object","properties":{"id":{"type":"integer","examples":[3]},"phone":{"type":["string","null"],"examples":["+40 722 000 000"]},"name":{"type":["string","null"],"examples":["Sala Centru"]},"sandbox":{"type":"boolean","examples":[false]},"quality_rating":{"type":["string","null"],"examples":["GREEN"]},"messaging_limit_tier":{"type":["string","null"],"examples":["TIER_1K"]},"warmup":{"type":"boolean","examples":[false]},"marketing_paused_until":{"type":["string","null"],"format":"date-time"},"disabled":{"type":"boolean","examples":[false]},"disabled_reason":{"type":["string","null"]}}},"Object":{"type":"object","properties":{"id":{"type":"integer","examples":[456]},"type":{"type":"string","examples":["fit.membership"]},"source":{"type":["string","null"]},"external_id":{"type":["string","null"],"examples":["abn-7781"]},"title":{"type":["string","null"],"examples":["Full access 12 luni"]},"fields":{"type":"object","additionalProperties":true,"examples":[{"plan":12,"starts_on":"2026-09-01","ends_on":"2027-08-31"}]},"statuses":{"type":"object","additionalProperties":{"type":"string"},"examples":[{"lifecycle":"active","payment":"ok"}]},"raw_status":{"type":["string","null"]},"relations":{"type":"array","items":{"$ref":"#/components/schemas/ObjectRelation"}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"ObjectRelation":{"type":"object","properties":{"id":{"type":"integer","examples":[77]},"contact_id":{"type":"integer","examples":[123]},"role":{"type":"string","examples":["holder"]},"primary":{"type":"boolean","examples":[true]},"muted":{"type":"boolean","examples":[false]},"valid_from":{"type":["string","null"],"format":"date"},"valid_until":{"type":["string","null"],"format":"date"}}},"ObjectType":{"type":"object","properties":{"key":{"type":"string","examples":["fit.membership"]},"label":{"type":"string","examples":["Membership"]},"labels":{"type":"object","additionalProperties":true},"plural_labels":{"type":["object","null"],"additionalProperties":true},"source":{"type":"string","examples":["fitness"]},"status_axes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["lifecycle"]},"labels":{"type":"object","additionalProperties":true},"statuses":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["active"]},"labels":{"type":"object","additionalProperties":true},"category":{"type":"string","examples":["active"]}}}}}}},"roles":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["holder"]},"labels":{"type":"object","additionalProperties":true},"multiple":{"type":"boolean","examples":[false]},"primary":{"type":"boolean","examples":[true]}}}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinition"}}}},"ObjectTypeWrite":{"type":"object","properties":{"labels":{"type":"object","additionalProperties":{"type":"string"},"examples":[{"en":"Vehicle","ro":"Vehicul"}]},"plural_labels":{"type":"object","additionalProperties":true},"key":{"type":"string","examples":["vehicle"]},"status_axes":{"type":"array","items":{"type":"object","additionalProperties":true}},"roles":{"type":"array","items":{"type":"object","additionalProperties":true}},"title_field":{"type":"string"},"retention_days":{"type":"integer"}},"required":["labels"]},"ObjectUpdate":{"type":"object","properties":{"source":{"type":"string"},"fields":{"type":"object","additionalProperties":true},"statuses":{"type":"object","additionalProperties":{"type":"string"},"examples":[{"lifecycle":"frozen"}]},"raw_status":{"type":"string"},"raw_status_label":{"type":"string"},"contact":{"type":"object","additionalProperties":true},"role":{"type":"string"}}},"ObjectWrite":{"type":"object","properties":{"external_id":{"type":"string","examples":["abn-7781"]},"source":{"type":"string","examples":["upfit"]},"fields":{"type":"object","additionalProperties":true,"examples":[{"starts_on":"2026-09-01","ends_on":"2027-08-31"}]},"statuses":{"type":"object","additionalProperties":{"type":"string"},"examples":[{"lifecycle":"active"}]},"raw_status":{"type":"string"},"raw_status_label":{"type":"string"},"contact":{"type":"object","description":"Contactul legat în rol: {\"id\": 123} sau {\"identities\": {...}, \"fields\": {...}}.","examples":[{"identities":{"phone":"+40722123456"}}]},"role":{"type":"string","examples":["holder"]},"update_existing_only":{"type":"boolean","examples":[false]}},"required":["external_id"]},"OfferRedeem":{"type":"object","properties":{"location_id":{"type":["integer","null"]},"beneficiary_contact_id":{"type":["integer","null"]},"occurred_at":{"type":["string","null"],"format":"date-time"}}},"Otp":{"type":"object","properties":{"id":{"type":"integer","examples":[880]},"phone":{"type":"string","examples":["+40722123456"]},"purpose":{"type":["string","null"],"examples":["login"]},"verifiable":{"type":"boolean","description":"True când Worbo a generat codul și îl verifică."},"expires_at":{"type":"string","format":"date-time"},"message_id":{"type":"integer","examples":[7001]},"status":{"type":"string","enum":["pending","deferred","sending","accepted","sent","delivered","read","failed","skipped","expired","received"],"examples":["pending"]}}},"OtpSend":{"type":"object","properties":{"phone":{"type":"string","description":"Telefonul care primește codul, în format internațional.","examples":["+40722123456"]},"code":{"type":"string","pattern":"^[A-Za-z0-9]{4,15}$","description":"Codul generat de organizație, care îl verifică singură; fără el, Worbo generează codul și îl verifică.","examples":["482913"]},"number_id":{"type":["integer","null"]},"language":{"type":"string","description":"Limba mesajului; implicit, limba contactului.","examples":["ro"]},"purpose":{"type":"string","maxLength":64,"description":"La ce folosește codul, păstrat cu el, de exemplu login sau document.","examples":["login"]}},"required":["phone"]},"OtpVerification":{"type":"object","properties":{"id":{"type":"integer","examples":[880]},"verified":{"type":"boolean"},"reason":{"type":["string","null"],"enum":["wrong_code","expired","already_used","locked",null],"description":"De ce nu a reușit verificarea; null când codul este corect."},"attempts_left":{"type":"integer","examples":[4]}}},"OtpVerify":{"type":"object","properties":{"code":{"type":"string","examples":["482913"]}},"required":["code"]},"PeriodResults":{"type":"object","properties":{"from":{"type":"string","format":"date-time","examples":["2026-09-30T21:00:00+00:00"]},"to":{"type":"string","format":"date-time","examples":["2026-10-15T20:59:59+00:00"]},"journeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","examples":[8]},"name":{"type":"string","examples":["Recâștigare"]},"conversion":{"type":["string","null"]},"entered":{"type":"integer","examples":[40]},"converted":{"type":"integer","examples":[6]},"control":{"type":["object","null"],"additionalProperties":true},"value":{"type":"number","examples":[1194]},"sent":{"type":"integer","examples":[40]},"clicked":{"type":"integer","examples":[11]},"cost":{"type":"number","examples":[2.18]}}}},"conversions":{"type":"array","items":{"type":"object","additionalProperties":true}},"baseline":{"type":["object","null"],"additionalProperties":true},"cost":{"type":"object","properties":{"amount":{"type":"number","examples":[2.18]},"currency":{"type":"string","examples":["EUR"]}}},"value":{"type":"number","examples":[1194]}}},"PreferenceLink":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]},"url":{"type":"string","format":"uri","examples":["https://my.worbo.app/preferences/abc"]},"expires_at":{"type":"string","format":"date-time"}}},"PreferenceLinkWrite":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]}},"required":["contact_id"]},"Problem":{"type":"object","description":"O eroare în formatul application/problem+json (RFC 9457), cu un cod stabil.","properties":{"type":{"type":"string","format":"uri","examples":["https://worbo.app/docs/api/errors/validation_failed"]},"title":{"type":"string","examples":["The request is not valid"]},"status":{"type":"integer","examples":[422]},"detail":{"type":"string","examples":["The name field is required."]},"code":{"type":"string","examples":["validation_failed"]},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"examples":[{"name":["The name field is required."]}]}},"required":["type","title","status","code"]},"RecommendationPreview":{"type":"object","properties":{"rule":{"type":"string","examples":["ecom.cross_sell"]},"contact_id":{"type":"integer","examples":[123]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","examples":[310]},"name":{"type":"string","examples":["Filtre de cafea"]},"price":{"type":["number","null"],"examples":[19.9]},"currency":{"type":["string","null"],"examples":["RON"]},"url":{"type":["string","null"]},"image_url":{"type":["string","null"]},"type":{"type":"string","examples":["co_purchase"]},"score":{"type":"number","examples":[5]},"reason":{"type":"string","examples":["Often bought together with Coffee beans 1kg (5 orders)."]},"details":{"type":"object","additionalProperties":true}}}},"excluded":{"type":"object","description":"Câte articole a lăsat deoparte fiecare excludere: unavailable, not_recommendable, purchased, filters, recently_recommended."},"empty":{"type":["string","null"],"enum":["cooldown","no_items",null],"description":"De ce n-ar pleca nimic: contactul e în cooldown-ul regulii sau regula n-a găsit articole."},"cooldown_until":{"type":["string","null"],"format":"date-time"},"purpose":{"type":"string","enum":["marketing","recommendations"],"description":"Scopul de consimțământ al mesajului: recommendations pentru cele din istoricul contactului."},"sendable":{"type":"boolean"},"consent_reason":{"type":["string","null"],"description":"De ce contactul nu poate primi acum mesajul, ca în motivele mesajelor; null când poate."}}},"RecommendationPreviewRequest":{"type":"object","properties":{"rule":{"type":"string","examples":["ecom.cross_sell"]},"contact_id":{"type":"integer","examples":[123]}},"required":["rule","contact_id"]},"RecommendationResults":{"type":"object","properties":{"rule":{"type":"string","examples":["ecom.cross_sell"]},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"sent":{"type":"integer","examples":[120]},"recipients":{"type":"integer","examples":[118]},"skipped":{"type":"object","description":"Pașii care nu au trimis, pe motive: no_recommendation, recommendation_cooldown, too_few_recommendations, no_purpose_consent, no_channel_optin."},"clicks":{"type":"integer","examples":[34]},"clickers":{"type":"integer","examples":[29]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","examples":[310]},"name":{"type":"string","examples":["Filtre de cafea"]},"clicks":{"type":"integer","examples":[12]}}}},"goals":{"type":"array","items":{"type":"string"},"examples":[["order.created"]]},"conversions":{"type":"integer","examples":[9]},"conversion_rate":{"type":["number","null"],"examples":[0.075]},"revenue":{"type":["number","null"],"examples":[1840.5]},"revenue_per_recipient":{"type":["number","null"],"examples":[15.6]},"currency":{"type":["string","null"],"examples":["RON"]},"control":{"type":"object","properties":{"contacts":{"type":"integer","examples":[13]},"conversions":{"type":"integer","examples":[0]},"rate":{"type":["number","null"],"examples":[0]}}},"lift":{"type":["number","null"],"examples":[0.075]},"opt_outs":{"type":"integer","examples":[1]},"cost":{"type":["number","null"],"examples":[18.4]},"cost_per_conversion":{"type":["number","null"],"examples":[2.04]}}},"RecommendationRule":{"type":"object","properties":{"key":{"type":"string","examples":["ecom.cross_sell"]},"name":{"type":"string","examples":["Bought together"]},"catalog":{"type":"string","examples":["ecom.products"]},"types":{"type":"array","description":"Tipurile, în ordinea priorității: bestsellers, co_purchase, same_category, replenishment, back_in_stock, next_class, plan_upgrade.","items":{"type":"object","properties":{"type":{"type":"string","examples":["co_purchase"]},"params":{"type":"object","additionalProperties":true}}}},"max_items":{"type":"integer","examples":[3]},"contact_cooldown_days":{"type":"integer","examples":[14]},"item_cooldown_days":{"type":"integer","examples":[30]},"fill_bestsellers":{"type":"boolean"}}},"RelationWrite":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]},"contact":{"type":"object","description":"Un contact găsit sau creat după identitățile lui, în loc de contact_id."},"role":{"type":"string","examples":["beneficiary"]},"primary":{"type":"boolean","examples":[false]},"muted":{"type":"boolean","examples":[false]},"valid_from":{"type":["string","null"],"format":"date"},"valid_until":{"type":["string","null"],"format":"date"}},"required":["role"]},"RunStart":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]}},"required":["contact_id"]},"Segment":{"type":"object","properties":{"id":{"type":"integer","examples":[12]},"name":{"type":"string","examples":["Toți membrii"]},"description":{"type":["string","null"]},"definition":{"$ref":"#/components/schemas/SegmentDefinition"},"last_count":{"type":["integer","null"],"examples":[240]},"counted_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"SegmentCount":{"type":"object","properties":{"count":{"type":"integer","examples":[240]}}},"SegmentCountRequest":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/SegmentDefinition"}},"required":["definition"]},"SegmentDefinition":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"examples":["all"]},"conditions":{"type":"array","items":{"type":"object","additionalProperties":true},"examples":[[{"type":"field","field":"first_name","operator":"not_empty"}]]}},"required":["match","conditions"]},"SegmentDetail":{"allOf":[{"$ref":"#/components/schemas/Segment"},{"type":"object","properties":{"count":{"type":"integer","examples":[240]}}}]},"SegmentWrite":{"type":"object","properties":{"name":{"type":"string","examples":["Toți membrii"]},"description":{"type":"string"},"definition":{"$ref":"#/components/schemas/SegmentDefinition"}},"required":["name","definition"]},"Template":{"type":"object","properties":{"id":{"type":"integer","examples":[31]},"number_id":{"type":["integer","null"],"examples":[3]},"name":{"type":"string","examples":["booking_confirmed"]},"language":{"type":"string","examples":["ro"]},"category":{"type":"string","examples":["utility"]},"status":{"type":"string","examples":["approved"]},"rejected_reason":{"type":["string","null"]},"quality":{"type":["string","null"]},"components":{"type":"array","items":{"type":"object","additionalProperties":true}},"variables":{"type":"array","items":{"type":"object","properties":{"example":{"type":"string","examples":["Ana"]},"field":{"type":["string","null"],"examples":["contact.first_name"]}}}},"source":{"type":["string","null"]},"submitted_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"TemplateDraft":{"allOf":[{"$ref":"#/components/schemas/Template"},{"type":"object","properties":{"lint":{"type":"object","description":"Rezultatul linter-ului: categoria prezisă și problemele găsite.","additionalProperties":true}}}]},"TemplateWrite":{"type":"object","properties":{"number_id":{"type":["integer","null"]},"name":{"type":"string","examples":["booking_confirmed"]},"language":{"type":"string","examples":["ro"]},"category":{"type":"string","enum":["utility","marketing"],"examples":["utility"]},"body":{"type":"string","examples":["Bună, {{1}}. Rezervarea ta pentru {{2}} este confirmată."]},"examples":{"type":"array","items":{"type":"string"},"examples":[["Ana","3 octombrie, 18:00"]]},"fields":{"type":"array","items":{"type":["string","null"]},"description":"Pentru fiecare variabilă, câmpul care o completează, de exemplu contact.first_name, sau null.","examples":[["contact.first_name",null]]},"header_format":{"type":"string"},"header_text":{"type":"string"},"header_example":{"type":"string"},"footer":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["name","language","category","body"]},"Usage":{"type":"object","properties":{"month":{"type":"string","examples":["2026-10"]},"currency":{"type":"string","examples":["EUR"]},"categories":{"type":"object","additionalProperties":true,"examples":[{"marketing":{"messages":120,"billable":118,"estimated_cost":6.42}}]},"estimated_cost":{"type":"number","examples":[6.42]},"plan":{"type":["string","null"],"examples":["growth"]},"billing_state":{"type":"string","examples":["active"]},"limits":{"type":"object","additionalProperties":true}}},"VaultDocument":{"type":"object","properties":{"id":{"type":"integer","examples":[15]},"contact_id":{"type":"integer","examples":[123]},"file_id":{"type":["integer","null"],"examples":[77]},"number_id":{"type":"integer","examples":[3]},"title":{"type":"string","examples":["Rezultatul analizelor"]},"state":{"type":"string","enum":["active","opened","expired","revoked"],"description":"active: încă nedeschis; opened: deschis cel puțin o dată cu codul; expired sau revoked: linkul nu mai deschide nimic."},"expires_at":{"type":"string","format":"date-time"},"opened_at":{"type":["string","null"],"format":"date-time"},"opens":{"type":"integer","examples":[1]},"message_id":{"type":["integer","null"],"examples":[7001]},"created_at":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","format":"uri","description":"Linkul documentului, doar în răspunsul care l-a creat."}}},"VaultWrite":{"type":"object","properties":{"contact_id":{"type":"integer","examples":[123]},"file_id":{"type":"integer","description":"ID-ul unui fișier urcat prin uploadFile.","examples":[77]},"title":{"type":"string","maxLength":120,"description":"Titlul pe care îl vede contactul, în mesaj și pe pagina linkului.","examples":["Rezultatul analizelor"]},"expires_in_days":{"type":"integer","minimum":1,"maximum":30,"default":7,"description":"Câte zile este valabil linkul, până la sfârșitul ultimei zile."},"number_id":{"type":["integer","null"]}},"required":["contact_id","file_id","title"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"integer","examples":[9001]},"endpoint_id":{"type":"integer","examples":[4]},"event":{"type":"object","properties":{"id":{"type":"string","examples":["msg_2mF0"]},"type":{"type":"string","examples":["contact.created"]}}},"status":{"type":"string","enum":["pending","delivered","failed"],"examples":["delivered"]},"attempts":{"type":"integer","examples":[1]},"last_status":{"type":["integer","null"],"examples":[200]},"last_error":{"type":["string","null"]},"next_attempt_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"integer","examples":[4]},"url":{"type":"string","format":"uri","examples":["https://crm.example.com/worbo"]},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"},"examples":[["contact.created","message.received"]]},"payload":{"type":"string","enum":["snapshot","thin"],"examples":["snapshot"]},"enabled":{"type":"boolean","examples":[true]},"disabled_reason":{"type":["string","null"]},"failing_since":{"type":["string","null"],"format":"date-time"},"last_success_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"WebhookEndpointSecret":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string","description":"Secretul de semnare; se arată doar acum.","examples":["whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"]}}}]},"WebhookEndpointWrite":{"type":"object","properties":{"url":{"type":"string","format":"uri","examples":["https://crm.example.com/worbo"]},"description":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["*","message.queued","message.sent","message.delivered","message.read","message.failed","message.received","interactive.button_clicked","link.clicked","flow.submitted","contact.created","contact.updated","contact.merged","contact.consent_granted","contact.consent_revoked","object.created","object.updated","object.status_changed","offer.issued","offer.redeemed","offer.expired","order.confirmed","order.cancelled","order.note_added","booking.confirmed","booking.cancelled","membership.pause_requested","automation.run_started","automation.run_completed","automation.goal_reached","automation.webhook","conversation.opened","conversation.assigned","conversation.closed","document.opened","template.status_changed","template.category_changed","template.quality_changed","webhook_endpoint.disabled","webhook.test"]},"examples":[["contact.created","message.received"]]},"payload":{"type":"string","enum":["snapshot","thin"],"examples":["snapshot"]}},"required":["url","events"]}}}}