{"openapi":"3.1.0","info":{"title":"WATI-like Workflow Bot Backend","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/login":{"post":{"summary":"Auth Login","operationId":"auth_login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"summary":"Auth Me","operationId":"auth_me_auth_me_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage":{"get":{"summary":"Ai Usage","description":"This client's ai_conversation token usage + estimated cost (own data only).","operationId":"ai_usage_usage_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leads/schema":{"get":{"summary":"Leads Schema","description":"CRM: this client's lead-field schema (labels / types / options), derived\nfrom its published workflow (sheet column headers, questions, AI fields).","operationId":"leads_schema_leads_schema_get","parameters":[{"name":"workflow_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leads":{"get":{"summary":"Leads List","description":"CRM: the lead feed, newest first, one row per arrival (workflow run;\na number that comes back another day is a new lead). Conversations with\nan inbound message but no run are one row each. `q` matches name/phone,\n`source` is whatsapp|ctwa.","operationId":"leads_list_leads_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients":{"post":{"summary":"Clients Create","operationId":"clients_create_clients_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Clients List","operationId":"clients_list_clients_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients/{client_id}":{"get":{"summary":"Clients Get","operationId":"clients_get_clients__client_id__get","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Clients Update","operationId":"clients_update_clients__client_id__patch","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Clients Delete","operationId":"clients_delete_clients__client_id__delete","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients/{client_id}/long-live-token":{"post":{"summary":"Clients Long Live Token","operationId":"clients_long_live_token_clients__client_id__long_live_token_post","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"X-Admin-Secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/clients":{"get":{"summary":"Admin Clients","description":"Ripplica-only: every client with its CRM feature switches.","operationId":"admin_clients_admin_clients_get","parameters":[{"name":"X-Admin-Secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/clients/{client_id}/features":{"patch":{"summary":"Admin Client Features","description":"Ripplica-only: merge feature switches into a client, e.g.\n{\"features\": {\"campaigns\": false}}. Not reachable with a client token.","operationId":"admin_client_features_admin_clients__client_id__features_patch","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"X-Admin-Secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetClientFeaturesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients/{client_id}/users":{"post":{"summary":"Users Create","operationId":"users_create_clients__client_id__users_post","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Users List","operationId":"users_list_clients__client_id__users_get","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}":{"get":{"summary":"Users Get","operationId":"users_get_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Users Update","operationId":"users_update_users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients/{client_id}/whatsapp-accounts":{"post":{"summary":"Accounts Create","operationId":"accounts_create_clients__client_id__whatsapp_accounts_post","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWhatsAppAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Accounts List","operationId":"accounts_list_clients__client_id__whatsapp_accounts_get","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}":{"get":{"summary":"Accounts Get","operationId":"accounts_get_whatsapp_accounts__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Accounts Update","operationId":"accounts_update_whatsapp_accounts__account_id__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Accounts Delete","operationId":"accounts_delete_whatsapp_accounts__account_id__delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/verify":{"post":{"summary":"Accounts Verify","operationId":"accounts_verify_whatsapp_accounts__account_id__verify_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/subscribe-webhook":{"post":{"summary":"Accounts Subscribe Webhook","operationId":"accounts_subscribe_webhook_whatsapp_accounts__account_id__subscribe_webhook_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows":{"post":{"summary":"Workflows Create","operationId":"workflows_create_workflows_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/clients/{client_id}/workflows":{"get":{"summary":"Workflows List","operationId":"workflows_list_clients__client_id__workflows_get","parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"whatsapp_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Account Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/nodes/{node_id}":{"get":{"summary":"Workflow Node Get","operationId":"workflow_node_get_workflows__workflow_id__nodes__node_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Workflow Node Update","operationId":"workflow_node_update_workflows__workflow_id__nodes__node_id__patch","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"expected_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Version"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowNodeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Workflow Node Delete","operationId":"workflow_node_delete_workflows__workflow_id__nodes__node_id__delete","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"new_first_node_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New First Node Id"}},{"name":"expected_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Version"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/nodes":{"get":{"summary":"Workflow Nodes List","operationId":"workflow_nodes_list_workflows__workflow_id__nodes_get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Workflow Node Add","operationId":"workflow_node_add_workflows__workflow_id__nodes_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"expected_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Version"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowNodeInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/connections":{"get":{"summary":"Workflow Connections Get","operationId":"workflow_connections_get_workflows__workflow_id__connections_get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Workflow Connections Update","operationId":"workflow_connections_update_workflows__workflow_id__connections_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"expected_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Version"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConnectionsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/validate":{"post":{"summary":"Workflow Validate","operationId":"workflow_validate_workflows__workflow_id__validate_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/publish":{"post":{"summary":"Workflow Publish","operationId":"workflow_publish_workflows__workflow_id__publish_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/unpublish":{"post":{"summary":"Workflow Unpublish","operationId":"workflow_unpublish_workflows__workflow_id__unpublish_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/set-default":{"post":{"summary":"Workflow Set Default","description":"Publish this workflow (if it isn't already) and make it the account's\ndefault, clearing any workflow currently marked default on the same\nWhatsApp account. Idempotent: re-calling on the current default is a no-op\nswap. Returns 400 if the workflow can't be published, 404 if not owned.","operationId":"workflow_set_default_workflows__workflow_id__set_default_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/duplicate":{"post":{"summary":"Workflow Duplicate","operationId":"workflow_duplicate_workflows__workflow_id__duplicate_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}":{"get":{"summary":"Workflow Get","operationId":"workflow_get_workflows__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Workflow Update","operationId":"workflow_update_workflows__workflow_id__patch","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"expected_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Version"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Workflow Delete","operationId":"workflow_delete_workflows__workflow_id__delete","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/debug":{"get":{"summary":"Debug Run","operationId":"debug_run_runs_debug_get","parameters":[{"name":"workflow_run_id","in":"query","required":true,"schema":{"type":"string","title":"Workflow Run Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs":{"get":{"summary":"Runs List","operationId":"runs_list_runs_get","parameters":[{"name":"whatsapp_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Account Id"}},{"name":"workflow_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"}},{"name":"contact_phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}":{"get":{"summary":"Runs Get","operationId":"runs_get_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/cancel":{"post":{"summary":"Runs Cancel","operationId":"runs_cancel_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dev/setup":{"post":{"summary":"Dev Setup","operationId":"dev_setup_dev_setup_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dev/google-connections":{"post":{"summary":"Dev Create Google Connection","operationId":"dev_create_google_connection_dev_google_connections_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevGoogleConnectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/google/oauth/callback":{"get":{"summary":"Google Oauth Callback","operationId":"google_oauth_callback_google_oauth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp/embedded-signup/complete":{"post":{"summary":"Embedded Signup Complete","operationId":"embedded_signup_complete_whatsapp_embedded_signup_complete_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddedSignupCompleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/register":{"post":{"summary":"Whatsapp Account Register","operationId":"whatsapp_account_register_whatsapp_accounts__account_id__register_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPhoneNumberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhook/test":{"post":{"summary":"Test Webhook","operationId":"test_webhook_webhook_test_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestWebhookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhook/whatsapp":{"get":{"summary":"Whatsapp Webhook Verify","operationId":"whatsapp_webhook_verify_webhook_whatsapp_get","parameters":[{"name":"hub.mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Mode"}},{"name":"hub.verify_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Verify Token"}},{"name":"hub.challenge","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Challenge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Whatsapp Webhook Receive","operationId":"whatsapp_webhook_receive_webhook_whatsapp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/conversations":{"get":{"summary":"List Inbox Conversations","description":"`view` picks the CRM inbox tab: 'inbox' (All / Unread) hides chats waiting\non a reply to a template, 'template' returns only those. Omitted = no filter.\n`counts` carries both tab totals so a badge is right before the tab is paged.","operationId":"list_inbox_conversations_conversations_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"whatsapp_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Account Id"}},{"name":"view","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"View"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/messages":{"get":{"summary":"Conversation Messages","operationId":"conversation_messages_conversations__conversation_id__messages_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/events":{"get":{"summary":"Inbox Events","description":"Real-time inbox stream (Server-Sent Events). The browser's EventSource\ncan't send an Authorization header, so the client JWT arrives as ?token=\n(same as the media proxy). Pushes conversation/message changes so the inbox\ndoesn't have to poll.","operationId":"inbox_events_events_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/close":{"post":{"summary":"Conversation Close","operationId":"conversation_close_conversations__conversation_id__close_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/open":{"post":{"summary":"Conversation Open","operationId":"conversation_open_conversations__conversation_id__open_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}":{"delete":{"summary":"Conversation Delete","operationId":"conversation_delete_conversations__conversation_id__delete","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/cancel-run":{"post":{"summary":"Conversation Cancel Run","operationId":"conversation_cancel_run_conversations__conversation_id__cancel_run_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/mark-viewed":{"post":{"summary":"Conversation Mark Viewed","operationId":"conversation_mark_viewed_conversations__conversation_id__mark_viewed_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/contact":{"patch":{"summary":"Conversation Update Contact","operationId":"conversation_update_contact_conversations__conversation_id__contact_patch","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/disposition":{"patch":{"summary":"Conversation Update Disposition","description":"Agent-set lead outcome (disposition + remark) on a conversation.","operationId":"conversation_update_disposition_conversations__conversation_id__disposition_patch","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDispositionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/notes":{"get":{"summary":"Conversation Notes List","operationId":"conversation_notes_list_conversations__conversation_id__notes_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Conversation Notes Add","operationId":"conversation_notes_add_conversations__conversation_id__notes_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/notes/{note_id}":{"delete":{"summary":"Conversation Notes Delete","operationId":"conversation_notes_delete_conversations__conversation_id__notes__note_id__delete","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/send":{"post":{"summary":"Conversation Send Agent Message","operationId":"conversation_send_agent_message_conversations__conversation_id__send_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}/send-audio":{"post":{"summary":"Conversation Send Agent Audio","description":"Send a voice note from the inbox: accepts the browser's recording (WebM/\nOpus, MP4, ...), transcoded server-side to OGG/Opus before it goes to Meta.","operationId":"conversation_send_agent_audio_conversations__conversation_id__send_audio_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_conversation_send_agent_audio_conversations__conversation_id__send_audio_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dev/whatsapp/send-text":{"post":{"summary":"Dev Send Whatsapp Text","operationId":"dev_send_whatsapp_text_dev_whatsapp_send_text_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsAppTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dev/whatsapp/send-buttons":{"post":{"summary":"Dev Send Whatsapp Buttons","operationId":"dev_send_whatsapp_buttons_dev_whatsapp_send_buttons_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsAppButtonTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dev/whatsapp/send-list":{"post":{"summary":"Dev Send Whatsapp List","operationId":"dev_send_whatsapp_list_dev_whatsapp_send_list_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWhatsAppListTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/fasterq":{"post":{"summary":"Fasterq Webhook","description":"FasterQ call webhook (call ended / recording ready). Authenticated by the\nAPI key FasterQ sends in `Authorization`. Always 2xx once authenticated so\nFasterQ never retry-loops; the recording copy runs after the response.","operationId":"fasterq_webhook_webhooks_fasterq_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls":{"get":{"summary":"Calls List","operationId":"calls_list_calls_get","parameters":[{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"answered","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Answered"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/reviews":{"get":{"summary":"Call Reviews List","description":"Every AI call review this clinic owns, so the Calls page can show a score\nper patient without a request per row.","operationId":"call_reviews_list_calls_reviews_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Call Review Start","description":"Queue an AI review of one patient's calls (the button on the Calls page).\nReturns straight away; the result arrives over SSE as `call_review`.","operationId":"call_review_start_calls_reviews_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCallReviewRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/recording":{"get":{"summary":"Call Recording","description":"Redirects the <audio> element to a short-lived signed URL of the stored\nrecording (token via ?token= like /media, since <audio> cannot set headers).","operationId":"call_recording_calls__call_id__recording_get","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/media/{message_id}":{"get":{"summary":"Get Message Media","description":"Inbox media proxy. Streams a stored image/PDF from private GCS (or\nredirects to a literal external link) for a client-owned message. Takes the\nJWT via ?token= (not the Authorization header) because an <img> tag cannot\nset headers. Images are served inline; documents as a download.","operationId":"get_message_media_media__message_id__get","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/templates":{"post":{"summary":"Templates Create","operationId":"templates_create_whatsapp_accounts__account_id__templates_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Templates List","operationId":"templates_list_whatsapp_accounts__account_id__templates_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/templates/sync":{"post":{"summary":"Templates Sync","operationId":"templates_sync_whatsapp_accounts__account_id__templates_sync_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/templates/{template_id}":{"get":{"summary":"Templates Get","operationId":"templates_get_whatsapp_accounts__account_id__templates__template_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Templates Delete","operationId":"templates_delete_whatsapp_accounts__account_id__templates__template_id__delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/templates/{template_id}/test-send":{"post":{"summary":"Templates Test Send","operationId":"templates_test_send_whatsapp_accounts__account_id__templates__template_id__test_send_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/contacts":{"get":{"summary":"Contacts List","operationId":"contacts_list_whatsapp_accounts__account_id__contacts_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"opted_out","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Opted Out"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/contacts/import":{"post":{"summary":"Contacts Import","operationId":"contacts_import_whatsapp_accounts__account_id__contacts_import_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportContactsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/contacts/{contact_id}/opt-out":{"post":{"summary":"Contacts Opt Out","operationId":"contacts_opt_out_whatsapp_accounts__account_id__contacts__contact_id__opt_out_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/contacts/{contact_id}/opt-in":{"post":{"summary":"Contacts Opt In","operationId":"contacts_opt_in_whatsapp_accounts__account_id__contacts__contact_id__opt_in_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/contacts/{contact_id}":{"patch":{"summary":"Contacts Update","description":"CRM: edit a contact's name / tags (tags replace the list).","operationId":"contacts_update_whatsapp_accounts__account_id__contacts__contact_id__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactFieldsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/broadcasts/preview":{"post":{"summary":"Broadcasts Preview","operationId":"broadcasts_preview_whatsapp_accounts__account_id__broadcasts_preview_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBroadcastRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/whatsapp-accounts/{account_id}/broadcasts":{"post":{"summary":"Broadcasts Create","operationId":"broadcasts_create_whatsapp_accounts__account_id__broadcasts_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBroadcastRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Broadcasts List","operationId":"broadcasts_list_whatsapp_accounts__account_id__broadcasts_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/broadcasts/{broadcast_id}":{"get":{"summary":"Broadcasts Get","operationId":"broadcasts_get_broadcasts__broadcast_id__get","parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","title":"Broadcast Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/broadcasts/{broadcast_id}/pause":{"post":{"summary":"Broadcasts Pause","operationId":"broadcasts_pause_broadcasts__broadcast_id__pause_post","parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","title":"Broadcast Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/broadcasts/{broadcast_id}/resume":{"post":{"summary":"Broadcasts Resume","operationId":"broadcasts_resume_broadcasts__broadcast_id__resume_post","parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","title":"Broadcast Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/broadcasts/{broadcast_id}/cancel":{"post":{"summary":"Broadcasts Cancel","operationId":"broadcasts_cancel_broadcasts__broadcast_id__cancel_post","parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","title":"Broadcast Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/broadcasts/{broadcast_id}/recipients":{"get":{"summary":"Broadcasts Recipients","operationId":"broadcasts_recipients_broadcasts__broadcast_id__recipients_get","parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","title":"Broadcast Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"Authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentSendRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"AgentSendRequest"},"Body_conversation_send_agent_audio_conversations__conversation_id__send_audio_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_conversation_send_agent_audio_conversations__conversation_id__send_audio_post"},"BroadcastAudience":{"properties":{"type":{"type":"string","enum":["all","tag","phones"],"title":"Type","default":"all"},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"},"phones":{"items":{"type":"string"},"type":"array","title":"Phones"}},"type":"object","title":"BroadcastAudience"},"CallRecordingConfig":{"properties":{"agent_names":{"items":{"type":"string"},"type":"array","title":"Agent Names"}},"type":"object","title":"CallRecordingConfig","description":"Client-settable (Settings → Call recording): the agent names, exactly as\nFasterQ reports them, whose calls belong to this clinic."},"Client":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"long_live_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Long Live Token"},"long_live_token_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Long Live Token Expires At"},"status":{"type":"string","enum":["active","inactive"],"title":"Status","default":"active"},"crm_push":{"anyOf":[{"$ref":"#/components/schemas/CrmPushConfig"},{"type":"null"}]},"disposition_sync":{"anyOf":[{"$ref":"#/components/schemas/DispositionSyncConfig"},{"type":"null"}]},"crm_columns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Crm Columns"},"features":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Features"},"feature_prefs":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Feature Prefs"},"crm_view":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Crm View"},"call_recording":{"anyOf":[{"$ref":"#/components/schemas/CallRecordingConfig"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name"],"title":"Client"},"ConnectionChange":{"properties":{"source_node_id":{"type":"string","title":"Source Node Id"},"handle":{"type":"string","title":"Handle","default":"default"},"target_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Node Id"}},"type":"object","required":["source_node_id"],"title":"ConnectionChange"},"CreateBroadcastRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"template_name":{"type":"string","title":"Template Name"},"template_language":{"type":"string","title":"Template Language"},"variable_mapping":{"additionalProperties":true,"type":"object","title":"Variable Mapping"},"audience":{"$ref":"#/components/schemas/BroadcastAudience"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["template_name","template_language"],"title":"CreateBroadcastRequest"},"CreateClientRequest":{"properties":{"name":{"type":"string","title":"Name"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["name","username","password"],"title":"CreateClientRequest"},"CreateNoteRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"CreateNoteRequest"},"CreateTemplateRequest":{"properties":{"name":{"type":"string","title":"Name"},"language":{"type":"string","title":"Language"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"title":"Category"},"components":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Components"}},"type":"object","required":["name","language","category","components"],"title":"CreateTemplateRequest"},"CreateUserRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"admin"}},"type":"object","required":["name","email"],"title":"CreateUserRequest"},"CreateWhatsAppAccountRequest":{"properties":{"name":{"type":"string","title":"Name"},"phone_number_id":{"type":"string","title":"Phone Number Id"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"whatsapp_business_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Business Account Id"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"webhook_verify_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Verify Token"}},"type":"object","required":["name","phone_number_id"],"title":"CreateWhatsAppAccountRequest"},"CreateWorkflowRequest":{"properties":{"whatsapp_account_id":{"type":"string","title":"Whatsapp Account Id"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"first_node_id":{"type":"string","title":"First Node Id"},"trigger_keywords":{"items":{"type":"string"},"type":"array","title":"Trigger Keywords"},"is_default":{"type":"boolean","title":"Is Default","default":false},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNodeInput"},"type":"array","title":"Nodes"}},"type":"object","required":["whatsapp_account_id","created_by_user_id","name","first_node_id","nodes"],"title":"CreateWorkflowRequest"},"CrmPushConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"url":{"type":"string","title":"Url","default":""},"method":{"type":"string","enum":["POST","PUT"],"title":"Method","default":"POST"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"static_fields":{"additionalProperties":true,"type":"object","title":"Static Fields"},"payload_template":{"additionalProperties":{"type":"string"},"type":"object","title":"Payload Template"},"fire_on":{"items":{"type":"string","enum":["completed","timeout"]},"type":"array","title":"Fire On"},"timeout_seconds":{"type":"integer","title":"Timeout Seconds","default":15}},"type":"object","title":"CrmPushConfig","description":"Per-client outbound lead push. When a run ends, the collected variables are\nrendered through `payload_template` and POSTed to `url` - so a client whose\nCRM wants leads directly no longer needs a Google-Sheets Apps Script polling\nthe sheet.\n\n`payload_template` is the \"choose what to send\" part: CRM key -> @variable\ntemplate. Keys whose variables were never collected are dropped rather than\nsent as literal \"@name\" text. `static_fields` carries constants merged into\nevery payload (an auth key, a source tag) and is REDACTED by the client API."},"DevGoogleConnectionRequest":{"properties":{"connection":{"$ref":"#/components/schemas/GoogleConnection"}},"type":"object","required":["connection"],"title":"DevGoogleConnectionRequest"},"DispositionSyncConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"mongo_uri":{"type":"string","title":"Mongo Uri","default":""},"db_name":{"type":"string","title":"Db Name","default":"ssb"},"collection":{"type":"string","title":"Collection","default":"crm_dispositions"},"google_connection_id":{"type":"string","title":"Google Connection Id","default":""},"spreadsheet_id":{"type":"string","title":"Spreadsheet Id","default":""},"sheet_name":{"type":"string","title":"Sheet Name","default":"Sheet1"},"key_column":{"type":"string","title":"Key Column","default":"lead_id"},"columns":{"additionalProperties":{"type":"string"},"type":"object","title":"Columns"},"lookback_hours":{"type":"integer","title":"Lookback Hours","default":6}},"type":"object","title":"DispositionSyncConfig","description":"Pull call outcomes the CRM reported back, and write them onto the lead's\nsheet row.\n\nThe dispositions live in the relay's OWN Mongo (it already keeps one document\nper Lead_ID, incrementing call_attempt_no, keeping the newest Disposition and\nappending Remarks). We only ever READ that collection - the sheet is the one\nthing we write, because only this backend holds the Google credentials."},"EmbeddedSignupCompleteRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"code":{"type":"string","title":"Code"},"waba_id":{"type":"string","title":"Waba Id"},"phone_number_id":{"type":"string","title":"Phone Number Id"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},"type":"object","required":["client_id","code","waba_id","phone_number_id"],"title":"EmbeddedSignupCompleteRequest","description":"Sent by the admin console after the Meta Embedded Signup popup finishes.\nCarries the exchangeable code + the WABA/phone ids the flow returned."},"FullSetupRequest":{"properties":{"client":{"$ref":"#/components/schemas/Client"},"user":{"$ref":"#/components/schemas/User"},"whatsapp_account":{"$ref":"#/components/schemas/WhatsAppAccount"},"google_connections":{"items":{"$ref":"#/components/schemas/GoogleConnection"},"type":"array","title":"Google Connections"},"workflow":{"$ref":"#/components/schemas/Workflow"},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNode"},"type":"array","title":"Nodes"}},"type":"object","required":["client","user","whatsapp_account","workflow","nodes"],"title":"FullSetupRequest"},"GoogleConnection":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"google_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Email"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_expiry":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Token Expiry"},"status":{"type":"string","enum":["connected","disconnected","failed"],"title":"Status","default":"connected"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","refresh_token"],"title":"GoogleConnection","description":"A stored Google account authorization. Holds the long-lived refresh token\n(V1: not encrypted) used to mint short-lived access tokens at runtime. The\nconnection holds only the Google account + token - no spreadsheet id."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImportContactItem":{"properties":{"phone":{"type":"string","title":"Phone"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"opted_in":{"type":"boolean","title":"Opted In","default":false}},"type":"object","required":["phone"],"title":"ImportContactItem"},"ImportContactsRequest":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/ImportContactItem"},"type":"array","title":"Contacts"}},"type":"object","required":["contacts"],"title":"ImportContactsRequest"},"LoginRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"LoginRequest"},"RegisterPhoneNumberRequest":{"properties":{"pin":{"type":"string","title":"Pin"}},"type":"object","required":["pin"],"title":"RegisterPhoneNumberRequest"},"SendWhatsAppButtonTestRequest":{"properties":{"phone_number_id":{"type":"string","title":"Phone Number Id"},"to_phone":{"type":"string","title":"To Phone"},"text":{"type":"string","title":"Text"}},"type":"object","required":["phone_number_id","to_phone","text"],"title":"SendWhatsAppButtonTestRequest"},"SendWhatsAppListTestRequest":{"properties":{"phone_number_id":{"type":"string","title":"Phone Number Id"},"to_phone":{"type":"string","title":"To Phone"},"body_text":{"type":"string","title":"Body Text"},"list_config":{"additionalProperties":true,"type":"object","title":"List Config"}},"type":"object","required":["phone_number_id","to_phone","body_text","list_config"],"title":"SendWhatsAppListTestRequest"},"SendWhatsAppTestRequest":{"properties":{"phone_number_id":{"type":"string","title":"Phone Number Id"},"to_phone":{"type":"string","title":"To Phone"},"text":{"type":"string","title":"Text"}},"type":"object","required":["phone_number_id","to_phone","text"],"title":"SendWhatsAppTestRequest"},"SetClientFeaturesRequest":{"properties":{"features":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Features"}},"type":"object","required":["features"],"title":"SetClientFeaturesRequest","description":"Admin-only: merge these keys into Client.features (true restores one)."},"StartCallReviewRequest":{"properties":{"phone":{"type":"string","title":"Phone"}},"type":"object","required":["phone"],"title":"StartCallReviewRequest","description":"Body of POST /calls/reviews - the patient's number, which is how the\nCalls page identifies a row (conversation_id is null for \"not in inbox\")."},"TestSendTemplateRequest":{"properties":{"to_phone":{"type":"string","title":"To Phone"},"params":{"items":{"type":"string"},"type":"array","title":"Params"}},"type":"object","required":["to_phone"],"title":"TestSendTemplateRequest"},"TestWebhookRequest":{"properties":{"phone_number_id":{"type":"string","title":"Phone Number Id"},"from_phone":{"type":"string","title":"From Phone"},"text":{"type":"string","title":"Text"},"message_type":{"type":"string","title":"Message Type","default":"text"}},"type":"object","required":["phone_number_id","from_phone","text"],"title":"TestWebhookRequest"},"UpdateClientRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"},"crm_push":{"anyOf":[{"$ref":"#/components/schemas/CrmPushConfig"},{"type":"null"}]},"disposition_sync":{"anyOf":[{"$ref":"#/components/schemas/DispositionSyncConfig"},{"type":"null"}]},"crm_columns":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Crm Columns"},"feature_prefs":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Feature Prefs"},"crm_view":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Crm View"},"call_recording":{"anyOf":[{"$ref":"#/components/schemas/CallRecordingConfig"},{"type":"null"}]}},"type":"object","title":"UpdateClientRequest"},"UpdateConnectionsRequest":{"properties":{"changes":{"items":{"$ref":"#/components/schemas/ConnectionChange"},"type":"array","title":"Changes"}},"type":"object","required":["changes"],"title":"UpdateConnectionsRequest"},"UpdateContactFieldsRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"UpdateContactFieldsRequest","description":"PATCH a contact's editable fields. `tags` REPLACES the list."},"UpdateContactRequest":{"properties":{"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attributes"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"UpdateContactRequest"},"UpdateDispositionRequest":{"properties":{"disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"}},"type":"object","title":"UpdateDispositionRequest","description":"CRM: agent-set lead outcome on a conversation."},"UpdateUserRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"UpdateUserRequest"},"UpdateWhatsAppAccountRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phone_number_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number Id"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"whatsapp_business_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Business Account Id"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"webhook_verify_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Verify Token"},"status":{"anyOf":[{"type":"string","enum":["connected","disconnected"]},{"type":"null"}],"title":"Status"},"inactivity_timeout_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Inactivity Timeout Enabled"},"inactivity_timeout_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inactivity Timeout Minutes"},"inactivity_timeout_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inactivity Timeout Message"}},"type":"object","title":"UpdateWhatsAppAccountRequest"},"UpdateWorkflowNodeRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"next_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Node Id"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"position":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Position"}},"type":"object","title":"UpdateWorkflowNodeRequest"},"UpdateWorkflowRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"first_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Node Id"},"trigger_keywords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trigger Keywords"},"is_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Default"}},"type":"object","title":"UpdateWorkflowRequest"},"User":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"admin"},"status":{"type":"string","enum":["active","inactive"],"title":"Status","default":"active"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","name","email"],"title":"User"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WhatsAppAccount":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"name":{"type":"string","title":"Name"},"phone_number_id":{"type":"string","title":"Phone Number Id"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"whatsapp_business_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Business Account Id"},"verified_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified Name"},"quality_rating":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality Rating"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"webhook_verify_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Verify Token"},"status":{"type":"string","enum":["connected","disconnected"],"title":"Status","default":"connected"},"inactivity_timeout_enabled":{"type":"boolean","title":"Inactivity Timeout Enabled","default":true},"inactivity_timeout_minutes":{"type":"integer","title":"Inactivity Timeout Minutes","default":15},"inactivity_timeout_message":{"type":"string","title":"Inactivity Timeout Message","default":"Your chat was closed due to inactivity. Send us a message anytime to start again."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","name","phone_number_id"],"title":"WhatsAppAccount"},"Workflow":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"whatsapp_account_id":{"type":"string","title":"Whatsapp Account Id"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"updated_by_user_id":{"type":"string","title":"Updated By User Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"node_ids":{"items":{"type":"string"},"type":"array","title":"Node Ids"},"first_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Node Id"},"trigger_keywords":{"items":{"type":"string"},"type":"array","title":"Trigger Keywords"},"is_default":{"type":"boolean","title":"Is Default","default":false},"status":{"type":"string","enum":["draft","published","archived"],"title":"Status","default":"draft"},"deleted":{"type":"boolean","title":"Deleted","default":false},"version":{"type":"integer","title":"Version","default":1},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","whatsapp_account_id","created_by_user_id","updated_by_user_id","name"],"title":"Workflow"},"WorkflowNode":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"updated_by_user_id":{"type":"string","title":"Updated By User Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["send_message","ask_question","condition","webhook","google_sheets","ai_conversation","generate_id","set_variable"],"title":"Type"},"next_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Node Id"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"position":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Position"},"deleted":{"type":"boolean","title":"Deleted","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","client_id","workflow_id","created_by_user_id","updated_by_user_id","name","type"],"title":"WorkflowNode"},"WorkflowNodeInput":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["send_message","ask_question","condition","webhook","google_sheets","ai_conversation","generate_id","set_variable"],"title":"Type"},"next_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Node Id"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"position":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Position"}},"type":"object","required":["id","name","type"],"title":"WorkflowNodeInput","description":"Node as clients send it: a short local id (\"welcome\", \"ask_issue\").\nThe server namespaces it under the workflow id and rewrites every\nnext_node_id reference, so callers never build full ids."}}}}