{"openapi":"3.0.0","info":{"title":"Flowella REST API","version":"1.1.0","description":"Public REST API for Flowella (contract v1.1). Authenticate with `Authorization: Bearer <api_key>` (`flo_` prefix) or an OAuth access token. Canonical base: `{API_PUBLIC_BASE_URL}/v1` (rewrites to `/api/v1` on the app). See `/docs` and `docs/api/conventions.md`."},"servers":[{"url":"https://api.flowella.io","description":"Canonical API host (FLOV2-403)"},{"url":"https://app.flowella.io","description":"Legacy app host — /api/v1 permanently redirects (308) to the API host /v1"}],"tags":[{"name":"System","description":"Health and auth checks"},{"name":"Messages","description":"Send WhatsApp messages"},{"name":"Conversations","description":"Inbox conversations"},{"name":"Contacts","description":"CRM contacts"},{"name":"Templates","description":"WhatsApp templates and bulk send"},{"name":"Analytics","description":"Usage and delivery metrics"},{"name":"Webhooks","description":"Outbound webhook configuration"},{"name":"Events","description":"Org event feed"},{"name":"Jobs","description":"Async jobs"},{"name":"Flows","description":"WhatsApp Flow definitions"},{"name":"Forms","description":"Form providers and submissions"},{"name":"Sandbox","description":"API sandbox mode"},{"name":"Observability","description":"Usage, rate limits, capabilities, integrations, request lookup"}],"components":{"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":255},"description":"Optional replay key on mutating /v1 routes. The same key and body return the stored response."},"ApiVersion":{"name":"API-Version","in":"header","required":false,"schema":{"type":"string","example":"2026-08-11"},"description":"Optional contract date pin. Responses echo API-Version."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Organization API key (`flo_…`) or OAuth access token. Paste the full token; Scalar sends `Authorization: Bearer <token>`."},"oauth2":{"type":"oauth2","description":"Authorization code + PKCE (`S256`), client credentials, and refresh. Client authentication is HTTP Basic or body client_id/client_secret.","flows":{"authorizationCode":{"authorizationUrl":"/api/oauth/authorize","tokenUrl":"/api/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"/api/oauth/token","scopes":{}}}}},"schemas":{"FlowTemplateReferencesErrorDetails":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"language":{"type":"string"},"source":{"type":"string","enum":["db","meta"]},"status":{"type":"string"}},"required":["name","language","source","status"]}}},"required":["templates"],"description":"error.details when error.code is FLOW_REFERENCED_BY_TEMPLATES."},"FlowStatusUpdatedWebhookPayload":{"type":"object","properties":{"flowId":{"type":"string"},"metaFlowId":{"type":"string"},"previousStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"]},"source":{"type":"string","enum":["api_deprecate","status_refresh"]},"occurredAt":{"type":"string"}},"required":["flowId","metaFlowId","previousStatus","status","source","occurredAt"],"description":"Outbound webhook `flow.status_updated` payload. Sent on POST deprecate and when a GET refresh sees a status change. No contact data or Flow answers."}}},"paths":{"/v1/ping":{"get":{"operationId":"v1Ping","summary":"Ping (auth check)","description":"Returns `ok` and the organization id for the resolved API key. Use to verify credentials.","tags":["System"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Authenticated","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"organizationId":{"type":"string"},"authKind":{"type":"string","enum":["api_key","oauth"]},"scopes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["all"]}]},"clientId":{"type":"string","nullable":true}},"required":["ok","organizationId","authKind","scopes","clientId"],"example":{"ok":true,"organizationId":"clxxxxxxxxxxxxxxxxxxxxxxxx","authKind":"api_key","scopes":"all","clientId":null}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":[],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/messages":{"post":{"operationId":"v1SendMessage","summary":"Send WhatsApp text message","tags":["Messages"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":3,"maxLength":32},"text":{"type":"string","minLength":1,"maxLength":4096},"whatsappChannelId":{"type":"string","format":"cuid"}},"required":["to","text"],"example":{"to":"+15551234567","text":"Hello from Flowella API"}}}}},"responses":{"200":{"description":"Message accepted and stored","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"contactId":{"type":"string"},"metaMessageId":{"type":"string","nullable":true}},"required":["id","conversationId","contactId","metaMessageId"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","conversationId":"clxxxxxxxxxxxxxxxxxxxxxxxx","contactId":"clxxxxxxxxxxxxxxxxxxxxxxxx","metaMessageId":"wamid.xxx"}}}}},"400":{"description":"Validation or Meta error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Forbidden (e.g. opt-out, Meta not connected)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Channel not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["messages:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"messaging","x-flowella-excluded":false},"get":{"operationId":"v1ListMessages","summary":"List messages","tags":["Messages"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"cuid"},"required":false,"name":"conversationId","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"updatedAfter","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["PENDING","SENT","DELIVERED","READ","FAILED","HELD"]},"body":{"type":"string","nullable":true},"metaMessageId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","conversationId","direction","type","status","body","metaMessageId","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["messages:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/conversations":{"get":{"operationId":"v1ListConversations","summary":"List conversations","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"updatedAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"deletedAfter","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Paginated conversations","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"lastMessageAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"whatsappChannelId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"waId":{"type":"string","nullable":true}},"required":["id","name","phone","waId"]}},"required":["id","status","lastMessageAt","createdAt","whatsappChannelId","contact"]}},"nextCursor":{"type":"string"}},"required":["items"],"example":{"items":[]}}}}},"400":{"description":"Bad query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/contacts":{"get":{"operationId":"v1ListContacts","summary":"List contacts","tags":["Contacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"updatedAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"deletedAfter","in":"query"},{"schema":{"type":"string","enum":["createdAt","updatedAt"]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":256},"required":false,"name":"externalId","in":"query"}],"responses":{"200":{"description":"Paginated contacts","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"waId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"isOptedOut":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","phone","waId","name","email","externalId","isOptedOut","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Bad query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"contacts","x-flowella-excluded":false},"post":{"operationId":"v1UpsertContact","summary":"Create or update contact","tags":["Contacts"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"maxLength":32},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"email":{"type":"string","nullable":true,"format":"email"},"waId":{"type":"string","nullable":true,"minLength":1,"maxLength":64},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":256}},"required":["phone"],"example":{"phone":"+15551234567","name":"Ada Lovelace","email":"ada@example.com"}}}}},"responses":{"200":{"description":"Contact upserted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"waId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"isOptedOut":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","phone","waId","name","email","externalId","isOptedOut","createdAt","updatedAt"]}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"contacts","x-flowella-excluded":false}},"/v1/opt-outs":{"post":{"operationId":"v1OptOutsMutate","summary":"Set or clear per-channel WhatsApp opt-out","description":"`action: set` creates or reactivates an opt-out for the given channel and phone. `action: clear` revokes it. Idempotent clears are safe.","tags":["Contacts"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["set"]},"whatsappChannelId":{"type":"string","format":"cuid"},"phone":{"type":"string","minLength":3,"maxLength":32},"reason":{"type":"string","maxLength":500}},"required":["action","whatsappChannelId","phone"],"example":{"action":"set","whatsappChannelId":"clxxxxxxxxxxxxxxxxxxxxxxxx","phone":"+15551234567","reason":"User requested via CRM"}},{"type":"object","properties":{"action":{"type":"string","enum":["clear"]},"whatsappChannelId":{"type":"string","format":"cuid"},"phone":{"type":"string","minLength":3,"maxLength":32}},"required":["action","whatsappChannelId","phone"],"example":{"action":"clear","whatsappChannelId":"clxxxxxxxxxxxxxxxxxxxxxxxx","phone":"+15551234567"}}]}}}},"responses":{"200":{"description":"Current opt-out state","content":{"application/json":{"schema":{"type":"object","properties":{"optOutId":{"type":"string","nullable":true},"active":{"type":"boolean"},"revokedAt":{"type":"string","nullable":true}},"required":["optOutId","active","revokedAt"],"example":{"optOutId":"clxxxxxxxxxxxxxxxxxxxxxxxx","active":true,"revokedAt":null}}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Forbidden (e.g. integration disabled)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Channel not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"contacts","x-flowella-excluded":false},"get":{"operationId":"v1ListOptOuts","summary":"List opt-outs","tags":["Contacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":32},"required":false,"name":"phone","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"updatedAfter","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"reason":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string"},"createdAt":{"type":"string"},"revokedAt":{"type":"string","nullable":true}},"required":["id","phone","reason","whatsappChannelId","createdAt","revokedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"contacts","x-flowella-excluded":false}},"/v1/templates":{"get":{"operationId":"v1ListTemplates","summary":"List WhatsApp templates","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["DRAFT","PENDING","APPROVED","REJECTED","PAUSED","DISABLED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"cuid"},"required":false,"name":"whatsappChannelId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Paginated templates","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["meta","draft"]},"name":{"type":"string"},"language":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING","APPROVED","REJECTED","PAUSED","DISABLED"]},"wabaId":{"type":"string"},"whatsappChannelId":{"type":"string","nullable":true},"metaTemplateId":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true}},"required":["id","source","name","language","status","wabaId","whatsappChannelId","metaTemplateId","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"400":{"description":"Bad query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Channel not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"templates","x-flowella-excluded":false},"post":{"operationId":"v1CreateTemplate","summary":"Create a local draft template","tags":["Templates"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"},"language":{"type":"string","minLength":2,"maxLength":32},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"default":"UTILITY"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS","CAROUSEL"]}},"required":["type"]},"description":"Ordered components. type is HEADER, BODY, FOOTER, BUTTONS, or CAROUSEL. An http(s) media sample may be stored on a draft and is rejected on submit."},"wabaId":{"type":"string","minLength":1},"whatsappChannelId":{"type":"string","format":"cuid"}},"required":["name","language"],"example":{"name":"order_update","language":"en_US","category":"UTILITY","wabaId":"1234567890"}}}}},"responses":{"201":{"description":"Draft created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["draft","meta"]},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","nullable":true},"status":{"type":"string"},"wabaId":{"type":"string"},"whatsappChannelId":{"type":"string","nullable":true},"components":{"nullable":true},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true}},"required":["id","source","name","language","category","status","wabaId","whatsappChannelId","createdAt","updatedAt"]}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/{id}":{"get":{"operationId":"v1GetTemplate","summary":"Get a draft or Meta template","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"wabaId","in":"query"}],"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["draft","meta"]},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","nullable":true},"status":{"type":"string"},"wabaId":{"type":"string"},"whatsappChannelId":{"type":"string","nullable":true},"components":{"nullable":true},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true}},"required":["id","source","name","language","category","status","wabaId","whatsappChannelId","createdAt","updatedAt"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"templates","x-flowella-excluded":false},"patch":{"operationId":"v1UpdateTemplate","summary":"Update a draft or push Meta template edits","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"wabaId","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"},"language":{"type":"string","minLength":2,"maxLength":32},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"]},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS","CAROUSEL"]}},"required":["type"]},"description":"Ordered components. type is HEADER, BODY, FOOTER, BUTTONS, or CAROUSEL. An http(s) media sample may be stored on a draft and is rejected on submit."},"wabaId":{"type":"string","minLength":1},"whatsappChannelId":{"type":"string","nullable":true,"format":"cuid"}},"example":{"category":"MARKETING"}}}}},"responses":{"200":{"description":"Updated template","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["draft","meta"]},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string","nullable":true},"status":{"type":"string"},"wabaId":{"type":"string"},"whatsappChannelId":{"type":"string","nullable":true},"components":{"nullable":true},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true}},"required":["id","source","name","language","category","status","wabaId","whatsappChannelId","createdAt","updatedAt"]}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false},"delete":{"operationId":"v1DeleteTemplate","summary":"Delete a draft or Meta template","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"wabaId","in":"query"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/send":{"post":{"operationId":"v1SendTemplatesBulk","summary":"Queue template send job","tags":["Templates"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":128},"templateWabaId":{"type":"string","minLength":1},"whatsappChannelId":{"type":"string","format":"cuid"},"headerMedia":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":4000,"format":"uri"},"fileName":{"type":"string","minLength":1,"maxLength":240}},"required":["url"]},"recipients":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"maxLength":32},"contactId":{"type":"string","nullable":true,"format":"cuid"},"bodyParameters":{"type":"array","items":{"type":"string"},"maxItems":20},"buttonParameters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["url"]},"text":{"type":"string","maxLength":2000}},"required":["index","subType","text"]},{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["flow"]},"flowToken":{"type":"string","minLength":1,"maxLength":256},"flowActionData":{"type":"object","additionalProperties":{"nullable":true}}},"required":["index","subType","flowToken"]},{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["copy_code"]},"couponCode":{"type":"string","minLength":1,"maxLength":20,"pattern":"^[a-zA-Z0-9]+$"}},"required":["index","subType","couponCode"]}]},"maxItems":20}},"required":["phone"]},"minItems":1,"maxItems":50000},"carouselCards":{"type":"array","items":{"type":"object","properties":{"mediaUrl":{"type":"string","maxLength":4000,"format":"uri"},"mediaId":{"type":"string","minLength":1,"maxLength":256},"bodyParameters":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20},"buttonParameters":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":1},"text":{"type":"string","minLength":1,"maxLength":2000},"payload":{"type":"string","minLength":1,"maxLength":256}},"required":["index"]},"maxItems":2}}},"minItems":2,"maxItems":10},"scheduledAt":{"type":"string","nullable":true},"throttlePerHour":{"type":"integer","minimum":1,"maximum":100000}},"required":["templateId","whatsappChannelId","recipients"],"example":{"templateId":"clxxxxxxxxxxxxxxxxxxxxxxxx","whatsappChannelId":"clxxxxxxxxxxxxxxxxxxxxxxxx","recipients":[{"phone":"+15551234567","bodyParameters":["Ada"]}],"carouselCards":[{"mediaUrl":"https://cdn.example/card-1.jpg","buttonParameters":[{"index":1,"text":"summer"}]},{"mediaUrl":"https://cdn.example/card-2.jpg"}]}}}}},"responses":{"200":{"description":"Job created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"templateId":{"type":"string","nullable":true},"scheduledFor":{"type":"string","nullable":true}},"required":["id","status","templateId","scheduledFor"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","status":"PENDING","templateId":"clxxxxxxxxxxxxxxxxxxxxxxxx","scheduledFor":null}}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/{id}/submit":{"post":{"operationId":"v1TemplateSubmit","summary":"Submit draft template to Meta","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"default":"UTILITY"},"wabaId":{"type":"string","minLength":1},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS","CAROUSEL"]}},"required":["type"]},"description":"Ordered components. type is HEADER, BODY, FOOTER, BUTTONS, or CAROUSEL. An http(s) media sample may be stored on a draft and is rejected on submit."}},"example":{"category":"UTILITY"}}}}},"responses":{"200":{"description":"Async submit job","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"sandbox":{"type":"boolean"},"status":{"type":"string","enum":["APPROVED","REJECTED"]},"rejectedReason":{"type":"string","nullable":true}},"required":["jobId"],"example":{"jobId":"clxxxxxxxxxxxxxxxxxxxxxxxx","sandbox":true,"status":"APPROVED","rejectedReason":null}}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/{id}/resubmit":{"post":{"operationId":"v1TemplateResubmit","summary":"Resubmit draft template to Meta","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"default":"UTILITY"},"wabaId":{"type":"string","minLength":1},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS","CAROUSEL"]}},"required":["type"]},"description":"Ordered components. type is HEADER, BODY, FOOTER, BUTTONS, or CAROUSEL. An http(s) media sample may be stored on a draft and is rejected on submit."}},"example":{"category":"UTILITY"}}}}},"responses":{"200":{"description":"Async submit job","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"sandbox":{"type":"boolean"},"status":{"type":"string","enum":["APPROVED","REJECTED"]},"rejectedReason":{"type":"string","nullable":true}},"required":["jobId"],"example":{"jobId":"clxxxxxxxxxxxxxxxxxxxxxxxx","sandbox":true,"status":"APPROVED","rejectedReason":null}}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/{id}/approval":{"get":{"operationId":"v1TemplateApproval","summary":"Template Meta approval status","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"wabaId","in":"query"}],"responses":{"200":{"description":"Approval status","content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string"},"wabaId":{"type":"string"},"status":{"type":"string"},"qualityScore":{"type":"string","nullable":true},"rejectedReason":{"type":"string","nullable":true},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"toStatus":{"type":"string"},"fromStatus":{"type":"string","nullable":true},"qualityScore":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"sourceField":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","toStatus","fromStatus","qualityScore","reason","sourceField","createdAt"]}}},"required":["templateId","wabaId","status","qualityScore","rejectedReason","history"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/templates/{id}/test-send":{"post":{"operationId":"v1TemplateTestSend","summary":"Send template test message","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"templateWabaId":{"type":"string","minLength":1},"whatsappChannelId":{"type":"string","format":"cuid"},"to":{"type":"string","minLength":3,"maxLength":32},"bodyParameters":{"type":"array","items":{"type":"string"},"maxItems":20},"buttonParameters":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["url"]},"text":{"type":"string","maxLength":2000}},"required":["index","subType","text"]},{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["flow"]},"flowToken":{"type":"string","minLength":1,"maxLength":256},"flowActionData":{"type":"object","additionalProperties":{"nullable":true}}},"required":["index","subType","flowToken"]},{"type":"object","properties":{"index":{"type":"integer","nullable":true,"minimum":0,"maximum":9},"subType":{"type":"string","enum":["copy_code"]},"couponCode":{"type":"string","minLength":1,"maxLength":20,"pattern":"^[a-zA-Z0-9]+$"}},"required":["index","subType","couponCode"]}]},"maxItems":20},"headerParameters":{"type":"array","items":{"type":"string"},"maxItems":20},"headerMedia":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":4000,"format":"uri"},"fileName":{"type":"string","minLength":1,"maxLength":240},"mediaId":{"type":"string","minLength":1,"maxLength":128}},"required":["url"]},"headerLocation":{"type":"object","properties":{"latitude":{"anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"longitude":{"anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"name":{"type":"string","maxLength":512},"address":{"type":"string","maxLength":512}},"required":["latitude","longitude"]},"approvalMaxWaitMs":{"type":"integer","nullable":true,"minimum":0,"maximum":900000}},"required":["whatsappChannelId","to"],"example":{"whatsappChannelId":"clxxxxxxxxxxxxxxxxxxxxxxxx","to":"+15551234567","bodyParameters":["Ada"]}}}}},"responses":{"200":{"description":"Test send accepted","content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":"string"},"status":{"type":"string"}},"required":["messageId","status"]}}}},"400":{"description":"Bad body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}},"/v1/flows":{"get":{"operationId":"v1ListFlows","summary":"List flows","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false},"post":{"operationId":"v1CreateFlow","summary":"Create a flow","tags":["Flows"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"language":{"type":"string","minLength":2,"maxLength":32,"default":"en"},"category":{"type":"string","minLength":1,"maxLength":64,"default":"OTHER"},"schema":{"type":"object","properties":{"version":{"type":"string","default":"1.0"},"title":{"type":"string","minLength":1,"maxLength":200},"submitLabel":{"type":"string","minLength":1,"maxLength":64},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["text","email","tel","select","multiselect","textarea","date","number","boolean"]},"label":{"type":"string","minLength":1,"maxLength":256},"required":{"type":"boolean","default":false},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"title":{"type":"string","minLength":1,"maxLength":256}},"required":["id","title"]},"maxItems":200},"validation":{"type":"object","properties":{"minLength":{"type":"integer","minimum":0},"maxLength":{"type":"integer","minimum":1},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string","maxLength":256}}}},"required":["id","type","label"]},"minItems":1,"maxItems":50},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["fields"]},"submitDestination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["flowella.contact"]},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["flowella.conversation"]},"whatsappChannelId":{"type":"string","format":"cuid"},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hubspot.form"]},"hubspotFormId":{"type":"string","minLength":1},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","hubspotFormId"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"url":{"type":"string","format":"uri"},"secret":{"type":"string","minLength":8}},"required":["type","url"]}]},"whatsappChannelId":{"type":"string","format":"cuid"}},"required":["name","schema","submitDestination"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/flows/{id}":{"get":{"operationId":"v1GetFlow","summary":"Get a flow","description":"Accepts an ApiFlow id or a HubSpot form row id. screens/fields come from the last published Flow JSON (structureSource=published), else the would-be JSON (draft); HubSpot-backed Flows without published JSON report unavailable. metaStatus refreshes from Meta at most every 60s (3s timeout); on failure the cache is returned with metaStatusStale=true.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."},"screens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"terminal":{"type":"boolean"}},"required":["id","title","terminal"]}},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"screenId":{"type":"string"},"component":{"type":"string"},"label":{"type":"string","nullable":true},"required":{"type":"boolean"},"options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"]}}},"required":["name","screenId","component","label","required","options"]}},"submitAction":{"type":"string","nullable":true,"enum":["data_exchange","complete"]},"jsonVersion":{"type":"string","nullable":true},"metaStatusStale":{"type":"boolean","description":"True when the Graph refresh failed and metaStatus is cached."}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource","screens","fields","submitAction","jsonVersion","metaStatusStale"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false},"patch":{"operationId":"v1UpdateFlow","summary":"Update a flow","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"language":{"type":"string","minLength":2,"maxLength":32,"default":"en"},"category":{"type":"string","minLength":1,"maxLength":64,"default":"OTHER"},"schema":{"type":"object","properties":{"version":{"type":"string","default":"1.0"},"title":{"type":"string","minLength":1,"maxLength":200},"submitLabel":{"type":"string","minLength":1,"maxLength":64},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["text","email","tel","select","multiselect","textarea","date","number","boolean"]},"label":{"type":"string","minLength":1,"maxLength":256},"required":{"type":"boolean","default":false},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"title":{"type":"string","minLength":1,"maxLength":256}},"required":["id","title"]},"maxItems":200},"validation":{"type":"object","properties":{"minLength":{"type":"integer","minimum":0},"maxLength":{"type":"integer","minimum":1},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string","maxLength":256}}}},"required":["id","type","label"]},"minItems":1,"maxItems":50},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["fields"]},"submitDestination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["flowella.contact"]},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["flowella.conversation"]},"whatsappChannelId":{"type":"string","format":"cuid"},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hubspot.form"]},"hubspotFormId":{"type":"string","minLength":1},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","hubspotFormId"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"url":{"type":"string","format":"uri"},"secret":{"type":"string","minLength":8}},"required":["type","url"]}]},"whatsappChannelId":{"type":"string","format":"cuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false},"delete":{"operationId":"v1DeleteFlow","summary":"Delete a flow","description":"Deletes the Flowella row only; the Meta Flow is not deleted (metaFlowRetained). Use POST /v1/flows/{id}/deprecate to retire it on Meta. 409 HUBSPOT_FLOW_MANAGED for HubSpot-backed Flows; 409 FLOW_REFERENCED_BY_TEMPLATES when a Flowella template draft FLOW button still uses the Meta Flow.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]},"metaFlowRetained":{"type":"boolean","description":"True when the Flow had a Meta Flow, which still exists."}},"required":["id","deleted","metaFlowRetained"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Flow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"409":{"description":"HUBSPOT_FLOW_MANAGED | FLOW_REFERENCED_BY_TEMPLATES","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/flows/{id}/flow-json":{"get":{"operationId":"v1GetFlowJson","summary":"Get the Flow JSON (published, or would-be draft)","description":"Never calls Meta. 404 FLOW_JSON_UNAVAILABLE for HubSpot-backed Flows that were not published yet.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["published","draft"]},"flowJson":{"type":"object","additionalProperties":{"nullable":true}}},"required":["source","flowJson"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"FLOW_JSON_UNAVAILABLE or not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}}}},"/v1/flows/{id}/deprecate":{"post":{"operationId":"v1DeprecateFlow","summary":"Deprecate the Meta Flow (irreversible)","description":"Irreversible on Meta. Honors Idempotency-Key. Refused for HubSpot-backed Flows (HUBSPOT_FLOW_MANAGED), unpublished/draft Meta Flows (FLOW_NOT_PUBLISHED) and running publishes (FLOW_PUBLISH_IN_PROGRESS). Without force, FLOW buttons on DB drafts and live Meta templates of the same WABA block with FLOW_REFERENCED_BY_TEMPLATES (details: FlowTemplateReferencesErrorDetails); if the Meta template list is unreachable returns 503 META_UNAVAILABLE. Already deprecated returns 200 alreadyDeprecated=true. Emits flow.status_updated.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Skip the template reference check (and its Meta availability requirement)."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"metaFlowId":{"type":"string"},"metaStatus":{"type":"string","enum":["DEPRECATED"]},"alreadyDeprecated":{"type":"boolean"}},"required":["id","metaFlowId","metaStatus","alreadyDeprecated"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Flow not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"409":{"description":"HUBSPOT_FLOW_MANAGED | FLOW_NOT_PUBLISHED | FLOW_PUBLISH_IN_PROGRESS | FLOW_REFERENCED_BY_TEMPLATES","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"502":{"description":"META_DEPRECATE_FAILED","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"503":{"description":"META_UNAVAILABLE","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}}}},"/v1/flows/{id}/publish":{"post":{"operationId":"v1PublishFlow","summary":"Enqueue flow publish. hubspot.form runs the app endpoint sync instead of uploading a static complete Flow","description":"dry_run=true returns the would-be Flow JSON (v1ApiFlowDryRunResponse) with no job and no DB write; HubSpot-backed Flows return 409 HUBSPOT_FLOW_MANAGED for dry runs. Deprecated Flows return 409 FLOW_DEPRECATED.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"true returns the would-be Flow JSON without enqueuing a job or changing syncStatus."},"required":false,"name":"dry_run","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]},{"type":"object","properties":{"dryRun":{"type":"boolean","enum":[true]},"flowJson":{"type":"object","additionalProperties":{"nullable":true}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["dryRun","flowJson","warnings"]}]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"409":{"description":"FLOW_DEPRECATED | HUBSPOT_FLOW_MANAGED","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/flows/{id}/sync-status":{"get":{"operationId":"v1FlowSyncStatus","summary":"Get flow sync status","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"flowId":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"metaFlowId":{"type":"string","nullable":true},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true}},"required":["flowId","hubspotFormRowId","syncStatus","metaFlowId","lastSyncAt","lastError"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers":{"get":{"operationId":"v1FormProviders","summary":"List form providers","tags":["Forms"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supported":{"type":"boolean"},"inbound":{"type":"boolean"},"notes":{"type":"string"}},"required":["id","name","supported","inbound","notes"]}}},"required":["providers"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers/{provider}/flows":{"post":{"operationId":"v1FormProviderCreateFlow","summary":"Create a flow from a form provider. hubspot body is { hubspotFormId, whatsappChannelId } and returns 202","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"provider","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"language":{"type":"string","minLength":2,"maxLength":32,"default":"en"},"category":{"type":"string","minLength":1,"maxLength":64,"default":"OTHER"},"schema":{"type":"object","properties":{"version":{"type":"string","default":"1.0"},"title":{"type":"string","minLength":1,"maxLength":200},"submitLabel":{"type":"string","minLength":1,"maxLength":64},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["text","email","tel","select","multiselect","textarea","date","number","boolean"]},"label":{"type":"string","minLength":1,"maxLength":256},"required":{"type":"boolean","default":false},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"title":{"type":"string","minLength":1,"maxLength":256}},"required":["id","title"]},"maxItems":200},"validation":{"type":"object","properties":{"minLength":{"type":"integer","minimum":0},"maxLength":{"type":"integer","minimum":1},"min":{"type":"number"},"max":{"type":"number"},"pattern":{"type":"string","maxLength":256}}}},"required":["id","type","label"]},"minItems":1,"maxItems":50},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["fields"]},"submitDestination":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["flowella.contact"]},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["flowella.conversation"]},"whatsappChannelId":{"type":"string","format":"cuid"},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hubspot.form"]},"hubspotFormId":{"type":"string","minLength":1},"fieldMap":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","hubspotFormId"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"url":{"type":"string","format":"uri"},"secret":{"type":"string","minLength":8}},"required":["type","url"]}]},"whatsappChannelId":{"type":"string","format":"cuid"},"form":{"nullable":true}},"required":["name","submitDestination"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource"]}}}},"202":{"description":"HubSpot sync job","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"apiFlowId":{"type":"string"},"hubspotFormRowId":{"type":"string"},"entryScreenId":{"type":"string"},"metaFlowId":{"type":"string","nullable":true},"alreadyRunning":{"type":"boolean"}},"required":["jobId","apiFlowId","hubspotFormRowId","entryScreenId","metaFlowId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers/{provider}/flows/{id}/resync":{"patch":{"operationId":"v1FormProviderResync","summary":"Resync a provider-backed flow. hubspot re-runs the app sync and returns 202","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"provider","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"submitDestination":{"type":"object","additionalProperties":{"nullable":true}},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"syncStatus":{"type":"string"},"lastSyncAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"hubspotFormRowId":{"type":"string","nullable":true},"metaStatus":{"type":"string","nullable":true,"enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED","UNKNOWN"],"description":"Cached Meta Flow status. Refreshed on GET one (60s TTL); list returns the cache only."},"metaStatusAt":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"entryScreenId":{"type":"string","nullable":true},"structureSource":{"type":"string","enum":["published","draft","unavailable"],"description":"published = last Flow JSON Meta accepted; draft = would-be JSON from schema; unavailable = HubSpot-backed Flow not yet published."},"diff":{"type":"object","properties":{"added":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"required":["id","label","type"]}},"removed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"required":["id","label","type"]}},"renamed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fromLabel":{"type":"string"},"toLabel":{"type":"string"}},"required":["id","fromLabel","toLabel"]}}},"required":["added","removed","renamed"]}},"required":["id","name","language","category","schema","submitDestination","metaFlowId","whatsappChannelId","syncStatus","lastSyncAt","lastError","createdAt","updatedAt","hubspotFormRowId","metaStatus","metaStatusAt","publishedAt","entryScreenId","structureSource","diff"]}}}},"202":{"description":"HubSpot sync job","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"apiFlowId":{"type":"string"},"hubspotFormRowId":{"type":"string"},"entryScreenId":{"type":"string"},"metaFlowId":{"type":"string","nullable":true},"alreadyRunning":{"type":"boolean"}},"required":["jobId","apiFlowId","hubspotFormRowId","entryScreenId","metaFlowId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers/{provider}/validate":{"post":{"operationId":"v1FormProviderValidate","summary":"Validate a provider form payload","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"provider","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"provider":{"type":"string"},"fieldCount":{"type":"integer"},"unsupported":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"reason":{"type":"string"}},"required":["id","type","reason"]}},"schema":{"type":"object","additionalProperties":{"nullable":true}},"entryScreenId":{"type":"string"}},"required":["ok","provider","fieldCount","unsupported"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers/{provider}/field-types":{"get":{"operationId":"v1FormProviderFieldTypes","summary":"List provider field types","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"supported":{"type":"boolean"},"fieldTypes":{"type":"array","items":{"type":"object","properties":{"providerType":{"type":"string"},"normalisedType":{"type":"string","nullable":true},"notes":{"type":"string"}},"required":["providerType","normalisedType"]}}},"required":["provider","supported","fieldTypes"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/forms/providers/{provider}/forms":{"get":{"operationId":"v1FormProviderForms","summary":"List HubSpot forms with Flowella id, ApiFlow id, Meta id, last sync, and drift","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"hubspotFormRowId":{"type":"string"},"hubspotFormId":{"type":"string"},"name":{"type":"string","nullable":true},"apiFlowId":{"type":"string","nullable":true},"metaFlowId":{"type":"string","nullable":true},"whatsappChannelId":{"type":"string","nullable":true},"lastSyncAt":{"type":"string","nullable":true},"syncStatus":{"type":"string","nullable":true},"drift":{"type":"boolean"}},"required":["hubspotFormRowId","hubspotFormId","name","apiFlowId","metaFlowId","whatsappChannelId","lastSyncAt","syncStatus","drift"]}}},"required":["items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/form-submissions":{"get":{"operationId":"v1ListFormSubmissions","summary":"List form submissions","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false},"post":{"operationId":"v1CreateFormSubmission","summary":"Ingest a form submission","tags":["Forms"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","minLength":1,"maxLength":64,"default":"generic"},"submissionId":{"type":"string","minLength":1,"maxLength":256},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","additionalProperties":{"nullable":true}},"flowId":{"type":"string","format":"cuid"},"externalFormId":{"type":"string","minLength":1,"maxLength":256}},"required":["submissionId","fields"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/form-submissions/{id}":{"get":{"operationId":"v1GetFormSubmission","summary":"Get a form submission","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/form-submissions/{id}/retry":{"post":{"operationId":"v1RetryFormSubmission","summary":"Retry a form submission","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/webhooks/inbound/typeform":{"post":{"operationId":"v1InboundTypeform","summary":"Inbound Typeform webhook","tags":["Forms"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":true}},"/v1/webhooks/inbound/surveymonkey":{"post":{"operationId":"v1InboundSurveyMonkey","summary":"Inbound SurveyMonkey webhook","tags":["Forms"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":true}},"/v1/webhooks/inbound/{adapterId}":{"post":{"operationId":"v1InboundGenericForm","summary":"Inbound generic form webhook","tags":["Forms"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"adapterId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"submissionId":{"type":"string"},"flowId":{"type":"string","nullable":true},"externalFormId":{"type":"string","nullable":true},"fields":{"type":"object","additionalProperties":{"nullable":true}},"contactHints":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"mappedContactId":{"type":"string","nullable":true},"conversationId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","submissionId","flowId","externalFormId","fields","contactHints","status","mappedContactId","conversationId","error","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["forms:ingest"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":true}},"/v1/messages/{id}":{"get":{"operationId":"v1GetMessage","summary":"Get a message","tags":["Messages"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["PENDING","SENT","DELIVERED","READ","FAILED","HELD"]},"body":{"type":"string","nullable":true},"metaMessageId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"mediaUrl":{"type":"string","nullable":true},"statusTimeline":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"at":{"type":"string"}},"required":["status","at"]}}},"required":["id","conversationId","direction","type","status","body","metaMessageId","createdAt","updatedAt","statusTimeline"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["messages:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/conversations/{id}":{"get":{"operationId":"v1GetConversation","summary":"Get a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"lastMessageAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"whatsappChannelId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"waId":{"type":"string","nullable":true}},"required":["id","name","phone","waId"]}},"required":["id","status","lastMessageAt","createdAt","whatsappChannelId","contact"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"messaging","x-flowella-excluded":false},"patch":{"operationId":"v1PatchConversation","summary":"Patch a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"lastMessageAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"whatsappChannelId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"waId":{"type":"string","nullable":true}},"required":["id","name","phone","waId"]}},"required":["id","status","lastMessageAt","createdAt","whatsappChannelId","contact"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/conversations/{id}/close":{"post":{"operationId":"v1CloseConversation","summary":"Close a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"lastMessageAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"whatsappChannelId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"waId":{"type":"string","nullable":true}},"required":["id","name","phone","waId"]}},"required":["id","status","lastMessageAt","createdAt","whatsappChannelId","contact"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/conversations/{id}/reopen":{"post":{"operationId":"v1ReopenConversation","summary":"Reopen a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["OPEN","CLOSED","PENDING","ARCHIVED","SNOOZED"]},"lastMessageAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"whatsappChannelId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string"},"waId":{"type":"string","nullable":true}},"required":["id","name","phone","waId"]}},"required":["id","status","lastMessageAt","createdAt","whatsappChannelId","contact"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"messaging","x-flowella-excluded":false}},"/v1/contacts/{id}":{"get":{"operationId":"v1GetContact","summary":"Get a contact","tags":["Contacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"waId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"isOptedOut":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","phone","waId","name","email","externalId","isOptedOut","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"contacts","x-flowella-excluded":false},"patch":{"operationId":"v1PatchContact","summary":"Patch a contact","tags":["Contacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"maxLength":32},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"email":{"type":"string","nullable":true,"format":"email"},"waId":{"type":"string","nullable":true,"minLength":1,"maxLength":64},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":256}},"example":{"phone":"+15551234567","name":"Ada Lovelace","email":"ada@example.com"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"waId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"isOptedOut":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","phone","waId","name","email","externalId","isOptedOut","createdAt","updatedAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"contacts","x-flowella-excluded":false},"delete":{"operationId":"v1DeleteContact","summary":"Soft-delete a contact","tags":["Contacts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"contacts","x-flowella-excluded":false}},"/v1/contacts/bulk-upsert":{"post":{"operationId":"v1ContactsBulkUpsert","summary":"Bulk upsert contacts","tags":["Contacts"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"maxLength":32},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"email":{"type":"string","nullable":true,"format":"email"},"waId":{"type":"string","nullable":true,"minLength":1,"maxLength":64},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":256}},"required":["phone"],"example":{"phone":"+15551234567","name":"Ada Lovelace","email":"ada@example.com"}},"minItems":1,"maxItems":5000}},"required":["contacts"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["contacts:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"contacts","x-flowella-excluded":false}},"/v1/channels":{"get":{"operationId":"v1ListChannels","summary":"List WhatsApp channels","tags":["Conversations"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"wabaId":{"type":"string"},"phoneNumberId":{"type":"string"},"displayPhoneNumber":{"type":"string","nullable":true},"verifiedName":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"isDefault":{"type":"boolean"},"qualityRating":{"type":"string","nullable":true},"accountStatus":{"type":"string","nullable":true}},"required":["id","wabaId","phoneNumberId","displayPhoneNumber","verifiedName","label","isDefault","qualityRating","accountStatus"]}}},"required":["items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["conversations:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/sandbox":{"get":{"operationId":"v1GetSandbox","summary":"Get org sandbox flag","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"sandboxKey":{"type":"boolean"}},"required":["enabled"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false},"patch":{"operationId":"v1PatchSandbox","summary":"Set org sandbox flag","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"sandboxKey":{"type":"boolean"}},"required":["enabled"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/sandbox/status":{"get":{"operationId":"v1SandboxStatus","summary":"Get sandbox status including key flag","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"sandboxKey":{"type":"boolean"}},"required":["enabled"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/sandbox/fixtures/reset":{"post":{"operationId":"v1SandboxReset","summary":"Reset sandbox fixtures","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reset":{"type":"boolean","enum":[true]},"deletedEvents":{"type":"integer"},"deletedJobs":{"type":"integer"}},"required":["reset","deletedEvents","deletedJobs"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/test/contacts":{"post":{"operationId":"v1TestSeedContact","summary":"Seed a sandbox contact (no Meta send)","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":5},"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email"}},"required":["phone"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"type":"string"},"phone":{"type":"string"},"sandbox":{"type":"boolean","enum":[true]}},"required":["contactId","phone","sandbox"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":true}},"/v1/test/messages/{id}/simulate-status":{"post":{"operationId":"v1TestSimulateMessageStatus","summary":"Simulate a message delivery status event","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["sent","delivered","read","failed","accepted"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":"string"},"status":{"type":"string"},"eventId":{"type":"string"},"sandbox":{"type":"boolean","enum":[true]}},"required":["messageId","status","eventId","sandbox"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":true}},"/v1/test/webhooks/replay-event":{"post":{"operationId":"v1TestReplayWebhookEvent","summary":"Replay or emit a sandbox webhook-style event","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"type":{"type":"string"},"sandbox":{"type":"boolean","enum":[true]}},"required":["eventId","type","sandbox"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":true}},"/v1/test/reset":{"post":{"operationId":"v1TestReset","summary":"Alias of /v1/sandbox/fixtures/reset","tags":["Sandbox"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reset":{"type":"boolean","enum":[true]},"deletedEvents":{"type":"integer"},"deletedJobs":{"type":"integer"}},"required":["reset","deletedEvents","deletedJobs"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["sandbox:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":true}},"/v1/usage":{"get":{"operationId":"v1Usage","summary":"Get API usage summary","tags":["Observability"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","nullable":true,"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"used":{"type":"integer"},"cap":{"type":"integer","nullable":true},"remaining":{"type":"integer","nullable":true},"plan":{"type":"string"},"status":{"type":"string"}},"required":["period","used","cap","remaining"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["analytics:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/usage/history":{"get":{"operationId":"v1UsageHistory","summary":"Billable usage by day","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer"},"since":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"used":{"type":"integer"}},"required":["day","used"]}}},"required":["days","since","items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["analytics:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/usage/by-app":{"get":{"operationId":"v1UsageByApp","summary":"API request counts by OAuth app / actor","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer"},"since":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"oauthAppId":{"type":"string","nullable":true},"oauthClientId":{"type":"string","nullable":true},"requests":{"type":"integer"}},"required":["key","oauthAppId","oauthClientId","requests"]}}},"required":["days","since","items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["analytics:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/rate-limits":{"get":{"operationId":"v1RateLimits","summary":"Get current rate-limit window","tags":["Observability"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer"},"remaining":{"type":"integer"},"reset":{"type":"number"},"headers":{"type":"array","items":{"type":"string"}}},"required":["limit","remaining","reset","headers"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":[],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/capabilities":{"get":{"operationId":"v1Capabilities","summary":"Get API capabilities","tags":["Observability"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"apiVersion":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"features":{"type":"object","properties":{"sandbox":{"type":"boolean"},"flows":{"type":"boolean"},"oauthInstall":{"type":"boolean"},"formSubmissions":{"type":"boolean"}},"required":["sandbox","flows","oauthInstall","formSubmissions"]},"limits":{"type":"object","properties":{"contactsBulkUpsertMax":{"type":"integer"}},"required":["contactsBulkUpsertMax"]},"flowDestinations":{"type":"array","items":{"type":"string"}},"templateCategories":{"type":"array","items":{"type":"string"}},"messageTypes":{"type":"array","items":{"type":"string"}},"sandboxActive":{"type":"boolean"}},"required":["apiVersion","scopes","features"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["account:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/integrations":{"get":{"operationId":"v1Integrations","summary":"List connected integrations","tags":["Observability"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"status":{"type":"string"},"updatedAt":{"type":"string"},"expiresAt":{"type":"string","nullable":true},"warning":{"type":"string","enum":["ok","expiring_soon","expired"]},"channelId":{"type":"string","nullable":true},"wabaId":{"type":"string"},"phoneNumberId":{"type":"string"},"displayPhoneNumber":{"type":"string"}},"required":["provider","status","updatedAt"]}}},"required":["items"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["account:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/requests/{requestId}":{"get":{"operationId":"v1RequestLookup","summary":"Look up a request by X-Request-Id","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"requestId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"source":{"type":"string","enum":["audit_log","http_log","correlation"]},"action":{"type":"string"},"resource":{"type":"string"},"httpStatus":{"type":"integer"},"method":{"type":"string"},"path":{"type":"string"},"statusCode":{"type":"integer"},"durationMs":{"type":"integer"},"createdAt":{"type":"string"},"related":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"occurredAt":{"type":"string"},"correlationId":{"type":"string","nullable":true}},"required":["id","type","occurredAt","correlationId"]}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"correlationId":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","type","status","correlationId","createdAt"]}},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"success":{"type":"boolean"},"statusCode":{"type":"integer","nullable":true},"correlationId":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","eventType","success","statusCode","correlationId","createdAt"]}}},"required":["events","jobs","deliveries"]}},"required":["requestId","source","createdAt"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["account:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/analytics":{"get":{"operationId":"v1AnalyticsOutbound","summary":"Outbound message analytics","description":"Aggregates outbound message counts and rates by status for a date range.","tags":["Analytics"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","nullable":true},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"endDate","in":"query"}],"responses":{"200":{"description":"Analytics for period","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"outboundMessages":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"counts":{"type":"object","properties":{"PENDING":{"type":"integer","minimum":0},"SENT":{"type":"integer","minimum":0},"DELIVERED":{"type":"integer","minimum":0},"READ":{"type":"integer","minimum":0},"FAILED":{"type":"integer","minimum":0},"HELD":{"type":"integer","minimum":0}}},"deliveryRate":{"type":"number"},"readRate":{"type":"number"},"failureRate":{"type":"number"}},"required":["total","counts","deliveryRate","readRate","failureRate"]}},"required":["period","outboundMessages"],"example":{"period":{"start":"2025-01-01T00:00:00.000Z","end":"2025-02-01T00:00:00.000Z"},"outboundMessages":{"total":42,"counts":{"PENDING":0,"SENT":10,"DELIVERED":20,"READ":10,"FAILED":2},"deliveryRate":0.85,"readRate":0.33,"failureRate":0.05}}}}}},"400":{"description":"Invalid range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"402":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["analytics:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/webhooks":{"get":{"operationId":"v1WebhooksList","summary":"List outbound webhooks","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Webhooks for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}}}},"required":["items"],"example":{"items":[]}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Missing webhooks:manage scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"webhooks","x-flowella-excluded":false},"post":{"operationId":"v1WebhooksCreate","summary":"Create outbound webhook","description":"Mints a signing secret and returns it once in `signingSecret`. Store it securely; only `signingSecretPrefix` is shown afterward.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"name":{"type":"string","minLength":1,"maxLength":80},"events":{"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","conversation.opened","conversation.closed","optout.created","template.status_updated","flow.status_updated","contact.created","contact.updated","contact.deleted"]},"minItems":1,"maxItems":32}},"required":["url","events"],"example":{"url":"https://example.com/webhooks/flowella","events":["message.sent"]}}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}},"signingSecret":{"type":"string"}},"required":["webhook","signingSecret"],"example":{"webhook":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"},"signingSecret":"whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"403":{"description":"Missing webhooks:manage scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}":{"get":{"operationId":"v1WebhookGet","summary":"Get outbound webhook","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"webhooks","x-flowella-excluded":false},"patch":{"operationId":"v1WebhookUpdate","summary":"Update outbound webhook","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"name":{"type":"string","nullable":true,"minLength":1,"maxLength":80},"events":{"type":"array","items":{"type":"string","enum":["message.received","message.sent","message.delivered","message.read","message.failed","conversation.opened","conversation.closed","optout.created","template.status_updated","flow.status_updated","contact.created","contact.updated","contact.deleted"]},"minItems":1,"maxItems":32},"isActive":{"type":"boolean"}},"example":{"isActive":false}}}}},"responses":{"200":{"description":"Updated webhook","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false},"delete":{"operationId":"v1WebhookDelete","summary":"Delete outbound webhook","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/test":{"post":{"operationId":"v1WebhookTest","summary":"Send synthetic webhook.test event","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Test delivery enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"example":{"ok":true}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"v1WebhookRotateSecret","summary":"Rotate signing secret","description":"Moves the current secret into a 24-hour overlap window and returns the new plaintext secret once.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Secret rotated","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}},"signingSecret":{"type":"string"}},"required":["webhook","signingSecret"],"example":{"webhook":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_cd","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T09:00:00.000Z"},"signingSecret":"whsec_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"v1WebhookDeliveriesList","summary":"List webhook delivery attempts","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["success","failed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":120},"required":false,"name":"event","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"occurredAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"occurredBefore","in":"query"}],"responses":{"200":{"description":"Paginated deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"attemptNumber":{"type":"integer"},"statusCode":{"type":"integer","nullable":true},"success":{"type":"boolean"},"durationMs":{"type":"integer","nullable":true},"replayedFromDeliveryId":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"responseHeaders":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}},"nextRetryAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","eventType","attemptNumber","statusCode","success","durationMs","replayedFromDeliveryId","correlationId","responseHeaders","nextRetryAt","createdAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","eventType":"message.sent","attemptNumber":1,"statusCode":200,"success":true,"durationMs":120,"replayedFromDeliveryId":null,"correlationId":null,"responseHeaders":null,"nextRetryAt":null,"createdAt":"2026-08-11T08:00:00.000Z"}}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/deliveries/{deliveryId}":{"get":{"operationId":"v1WebhookDeliveryGet","summary":"Get delivery attempt","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Delivery detail","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"attemptNumber":{"type":"integer"},"statusCode":{"type":"integer","nullable":true},"success":{"type":"boolean"},"durationMs":{"type":"integer","nullable":true},"replayedFromDeliveryId":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"responseHeaders":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}},"nextRetryAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"responseBody":{"type":"string","nullable":true},"payload":{"nullable":true}},"required":["id","eventType","attemptNumber","statusCode","success","durationMs","replayedFromDeliveryId","correlationId","responseHeaders","nextRetryAt","createdAt","responseBody"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","eventType":"message.sent","attemptNumber":1,"statusCode":200,"success":true,"durationMs":120,"replayedFromDeliveryId":null,"correlationId":null,"responseHeaders":null,"nextRetryAt":null,"createdAt":"2026-08-11T08:00:00.000Z"}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/deliveries/{deliveryId}/replay":{"post":{"operationId":"v1WebhookDeliveryReplay","summary":"Replay a delivery","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Replay enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"deliveryId":{"type":"string"},"enqueued":{"type":"boolean","enum":[true]}},"required":["deliveryId","enqueued"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/deliveries/bulk-replay":{"post":{"operationId":"v1WebhookDeliveriesBulkReplay","summary":"Bulk replay deliveries (async job)","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deliveryIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100}},"required":["deliveryIds"]}}}},"responses":{"202":{"description":"Bulk replay job created","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/webhooks/{id}/reactivate":{"post":{"operationId":"v1WebhookReactivate","summary":"Reactivate disabled webhook","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Webhook reactivated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"consecutiveFailures":{"type":"integer","minimum":0},"signingSecretPrefix":{"type":"string","nullable":true},"payloadVersion":{"type":"string"},"lastTriggeredAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","events","isActive","consecutiveFailures","signingSecretPrefix","payloadVersion","lastTriggeredAt","disabledAt","createdAt","updatedAt"],"example":{"id":"clxxxxxxxxxxxxxxxxxxxxxxxx","name":null,"url":"https://example.com/webhooks/flowella","events":["message.sent","message.received"],"isActive":true,"consecutiveFailures":0,"signingSecretPrefix":"whsec_ab","payloadVersion":"1","lastTriggeredAt":null,"disabledAt":null,"createdAt":"2026-08-11T08:00:00.000Z","updatedAt":"2026-08-11T08:00:00.000Z"}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["webhooks:manage"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"webhooks","x-flowella-excluded":false}},"/v1/events":{"get":{"operationId":"v1EventsList","summary":"List org events (7-day retention)","tags":["Events"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":512},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"occurredAfter","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"occurredBefore","in":"query"}],"responses":{"200":{"description":"Paginated events","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"occurredAt":{"type":"string"},"version":{"type":"string"},"correlationId":{"type":"string","nullable":true},"data":{"nullable":true}},"required":["id","type","occurredAt","version","correlationId"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"403":{"description":"Missing events:read scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["events:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/jobs":{"get":{"operationId":"v1JobsList","summary":"List async jobs","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"}],"responses":{"200":{"description":"Paginated jobs","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"sourceJobId":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"metadata":{"nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","sourceJobId","canceledAt","createdAt","updatedAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}}},"x-flowella-scopes":["jobs:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/jobs/{id}":{"get":{"operationId":"v1JobGet","summary":"Get async job","tags":["Jobs"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"sourceJobId":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"metadata":{"nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","sourceJobId","canceledAt","createdAt","updatedAt"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["jobs:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/jobs/{id}/results":{"get":{"operationId":"v1JobResultsList","summary":"List job results","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"createdAfter","in":"query"}],"responses":{"200":{"description":"Paginated results","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"data":{"nullable":true},"createdAt":{"type":"string"}},"required":["id","label","createdAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}}},"x-flowella-scopes":["jobs:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/jobs/{id}/cancel":{"post":{"operationId":"v1JobCancel","summary":"Cancel async job","tags":["Jobs"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Canceled job","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED","CANCELLED","PAUSED"]},"sourceJobId":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"metadata":{"nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","sourceJobId","canceledAt","createdAt","updatedAt"]}}}},"400":{"description":"Not cancelable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["jobs:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"account","x-flowella-excluded":false}},"/v1/blueprints":{"get":{"operationId":"v1ListBlueprints","summary":"List blueprints. Coming-soon slugs cannot be installed.","tags":["Flows"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/blueprints/{slug}":{"get":{"operationId":"v1GetBlueprint","summary":"Get one blueprint manifest. Use this before adapting a blueprint.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/blueprints/{slug}/install":{"post":{"operationId":"v1InstallBlueprint","summary":"Install an available blueprint. Returns a job id. Then call the job read.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"businessName":{"type":"string"},"whatsappChannelId":{"type":"string"},"wabaId":{"type":"string"},"hubspotFormId":{"type":"string"},"videoUrl":{"type":"string"},"initialMessage":{"type":"string"},"followUpCadence":{"type":"string"},"language":{"type":"string"},"goalProperty":{"type":"string"}},"required":["businessName","whatsappChannelId","wabaId"]}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:write"],"x-flowella-destructive":true,"x-flowella-idempotent":true,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/blueprints/{slug}/adapt":{"post":{"operationId":"v1AdaptBlueprint","summary":"Return a blueprint with the caller's changes applied. Does not install.","tags":["Flows"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","additionalProperties":{"nullable":true}}},"required":["changes"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["flows:read"],"x-flowella-destructive":false,"x-flowella-idempotent":false,"x-flowella-toolset":"flows","x-flowella-excluded":false}},"/v1/templates/{id}/localize":{"post":{"operationId":"v1LocalizeTemplate","summary":"Clone a template into a new draft with a language suffix. Submit the new template after this.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"components":{"nullable":true},"tone_notes":{"type":"string"}},"required":["language"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"nullable":true}},"required":["code","message"]}},"required":["error"],"description":"Machine codes include INVALID_TEMPLATE_NAME and INVALID_TEMPLATE_COMPONENTS. requestId is copied from X-Request-Id when present.","example":{"error":{"code":"INVALID_TEMPLATE_COMPONENTS","message":"INVALID_TEMPLATE_COMPONENTS","requestId":"req_019abc"}}}}}}},"x-flowella-scopes":["templates:write"],"x-flowella-destructive":false,"x-flowella-idempotent":true,"x-flowella-toolset":"templates","x-flowella-excluded":false}}},"x-tagGroups":[{"name":"Messaging","tags":["Messages","Conversations","Contacts","Templates"]},{"name":"Automation","tags":["Flows","Forms","Webhooks","Events","Jobs"]},{"name":"Platform","tags":["System","Analytics","Sandbox","Observability"]}]}