{"components":{"responses":{},"schemas":{"AgentReplyRequest":{"description":"Request body for sending an agent reply to a conversation","example":{"content":"I can help you with that. What specifically do you need?","conversation_id":"123e4567-e89b-12d3-a456-426614174000","message_id":"ext_msg_12345","timestamp":"2025-10-31T10:30:05Z"},"properties":{"content":{"description":"Agent's reply content","type":"string"},"conversation_id":{"description":"ID of the conversation","format":"uuid","type":"string"},"message_id":{"description":"External message ID for deduplication","type":"string"},"timestamp":{"description":"Message timestamp","format":"date-time","type":"string"}},"required":["conversation_id","content","message_id"],"title":"AgentReplyRequest","type":"object"},"AgentReplyResponse":{"description":"Response after receiving agent reply","example":{"received":true,"status":"processed"},"properties":{"received":{"description":"Whether reply was received","type":"boolean"},"status":{"description":"Processing status","type":"string"}},"title":"AgentReplyResponse","type":"object"},"ErrorResponse":{"description":"Error response","example":{"error":"Agent not found","success":false},"properties":{"error":{"description":"Error message","type":"string"},"success":{"description":"Always false for errors","type":"boolean"}},"title":"ErrorResponse","type":"object"},"ListDevicesResponse":{"description":"Response listing user's registered devices","example":{"device_count":2,"devices":[{"app_version":"1.0.0","enabled":true,"environment":"production","last_used":"2025-10-31T10:00:00Z","model":"iPhone 15 Pro","os_version":"17.0","platform":"ios","registered":"2025-10-01T08:00:00Z","token":"device_token_abc123"}],"email":"user@example.com","user_id":"123e4567-e89b-12d3-a456-426614174002"},"properties":{"device_count":{"description":"Number of registered devices","type":"integer"},"devices":{"items":{"properties":{"app_version":{"description":"App version","type":"string"},"enabled":{"description":"Whether device is enabled","type":"boolean"},"environment":{"description":"Environment (sandbox/production)","type":"string"},"last_used":{"description":"Last used timestamp","format":"date-time","type":"string"},"model":{"description":"Device model","type":"string"},"os_version":{"description":"OS version","type":"string"},"platform":{"description":"Platform (ios/android)","type":"string"},"registered":{"description":"Registration timestamp","format":"date-time","type":"string"},"token":{"description":"Device token","type":"string"}},"type":"object"},"type":"array"},"email":{"description":"User email","format":"email","type":"string"},"user_id":{"description":"User ID","format":"uuid","type":"string"}},"title":"ListDevicesResponse","type":"object"},"RespondInteractiveRequest":{"description":"Request body for responding to an interactive message","example":{"response":{"approved":true,"message":"Looks good, approved!","type":"boolean"}},"properties":{"response":{"description":"Response data based on element type","properties":{"approved":{"description":"For boolean responses","type":"boolean"},"data":{"description":"Form data for fields response","type":"object"},"message":{"description":"Optional message with boolean response","type":"string"},"selected":{"description":"Selected button value","type":"string"},"type":{"description":"Response type matching the interactive element","enum":["boolean","buttons","fields"],"type":"string"}},"type":"object"}},"required":["response"],"title":"RespondInteractiveRequest","type":"object"},"RespondInteractiveResponse":{"description":"Response after submitting an interactive response","example":{"message_id":"msg-uuid-here","status":"responded","success":true},"properties":{"message_id":{"format":"uuid","type":"string"},"status":{"enum":["responded"],"type":"string"},"success":{"type":"boolean"}},"title":"RespondInteractiveResponse","type":"object"},"SendBulkPushRequest":{"description":"Request body for sending push notifications to multiple users","example":{"body":"New features are now available","data":{"update_type":"features"},"priority":"normal","recipients":["user1@example.com","user2@example.com"],"title":"System Update"},"properties":{"body":{"description":"Notification body text","type":"string"},"data":{"description":"Additional data to include in the notification","type":"object"},"priority":{"description":"Notification priority (default: normal)","enum":["critical","high","medium","normal","low"],"type":"string"},"recipients":{"description":"Array of user email addresses","items":{"format":"email","type":"string"},"type":"array"},"title":{"description":"Notification title","type":"string"}},"required":["recipients","title","body"],"title":"SendBulkPushRequest","type":"object"},"SendBulkPushResponse":{"description":"Response after sending bulk push notifications","example":{"results":[{"devices_failed":0,"devices_succeeded":1,"email":"user1@example.com","success":true},{"devices_failed":0,"devices_succeeded":2,"email":"user2@example.com","success":true}],"summary":{"failed":0,"priority":"normal","succeeded":2,"total_recipients":2}},"properties":{"results":{"description":"Individual results for each recipient","items":{"properties":{"devices_failed":{"type":"integer"},"devices_succeeded":{"type":"integer"},"email":{"format":"email","type":"string"},"error":{"type":"string"},"success":{"type":"boolean"}},"type":"object"},"type":"array"},"summary":{"properties":{"failed":{"description":"Number of failed sends","type":"integer"},"priority":{"description":"Priority used","type":"string"},"succeeded":{"description":"Number of successful sends","type":"integer"},"total_recipients":{"description":"Total recipients","type":"integer"}},"type":"object"}},"title":"SendBulkPushResponse","type":"object"},"SendInteractiveRequest":{"description":"Request body for sending an interactive message","example":{"callback_id":"approval-001","callback_url":"https://your-server.com/webhook/callback","elements":[{"text":"Expense Approval","type":"header"},{"text":"Please approve the following expense request.","type":"text"},{"type":"divider"},{"approve_label":"Approve","reject_label":"Reject","show_message_field":true,"type":"boolean"}]},"properties":{"callback_id":{"description":"Your unique identifier for this interaction","type":"string"},"callback_url":{"description":"URL to receive the user's response","format":"uri","type":"string"},"elements":{"description":"Array of UI elements to display","items":{"properties":{"approve_label":{"description":"Label for approve button (boolean)","type":"string"},"buttons":{"description":"Button options (buttons element)","items":{"properties":{"label":{"type":"string"},"value":{"type":"string"},"variant":{"enum":["default","primary","danger"],"type":"string"}},"type":"object"},"type":"array"},"inputs":{"description":"Form inputs (fields element)","items":{"properties":{"input_type":{"description":"Input type","enum":["text","number","email","date","textarea","select"],"type":"string"},"label":{"description":"Input label","type":"string"},"name":{"description":"Input name","type":"string"},"options":{"description":"Options for select inputs","items":{"properties":{"label":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"placeholder":{"type":"string"},"required":{"type":"boolean"}},"type":"object"},"type":"array"},"reject_label":{"description":"Label for reject button (boolean)","type":"string"},"show_message_field":{"description":"Show message input (boolean)","type":"boolean"},"submit_label":{"description":"Submit button label (fields)","type":"string"},"text":{"description":"Text content for header/text elements","type":"string"},"type":{"description":"Element type","enum":["header","text","divider","boolean","buttons","fields"],"type":"string"}},"type":"object"},"type":"array"}},"required":["callback_url","callback_id","elements"],"title":"SendInteractiveRequest","type":"object"},"SendInteractiveResponse":{"description":"Response after sending an interactive message","example":{"callback_id":"approval-001","conversation_id":"conv-uuid-here","message_id":"msg-uuid-here","success":true},"properties":{"callback_id":{"description":"Your callback ID echoed back","type":"string"},"conversation_id":{"format":"uuid","type":"string"},"message_id":{"description":"Created message ID","format":"uuid","type":"string"},"success":{"type":"boolean"}},"title":"SendInteractiveResponse","type":"object"},"SendMessageRequest":{"description":"Request body for sending a message to an agent","example":{"content":"Hello, I need help with my account","conversation_id":"123e4567-e89b-12d3-a456-426614174000","message_type":"text","metadata":{"source":"wordpress","user_email":"user@example.com"}},"properties":{"content":{"description":"Message content to send to the agent","type":"string"},"conversation_id":{"description":"ID of the conversation (optional - will create new if not provided)","format":"uuid","type":"string"},"message_type":{"description":"Type of message (default: text)","enum":["text","image","document"],"type":"string"},"metadata":{"description":"Optional metadata to attach to the message","type":"object"}},"required":["content"],"title":"SendMessageRequest","type":"object"},"SendMessageResponse":{"description":"Response after sending a message","example":{"conversation":{"id":"123e4567-e89b-12d3-a456-426614174000","status":"active","title":"New Conversation"},"message":{"content":"Hello, I need help with my account","conversation_id":"123e4567-e89b-12d3-a456-426614174000","created_at":"2025-10-31T10:30:00Z","id":"123e4567-e89b-12d3-a456-426614174001","status":"sent"},"success":true},"properties":{"conversation":{"properties":{"id":{"description":"Conversation ID","format":"uuid","type":"string"},"status":{"description":"Conversation status","type":"string"},"title":{"description":"Conversation title","type":"string"}},"type":"object"},"message":{"properties":{"content":{"description":"Message content","type":"string"},"conversation_id":{"description":"Conversation ID","format":"uuid","type":"string"},"created_at":{"description":"Message creation timestamp","format":"date-time","type":"string"},"id":{"description":"Message ID","format":"uuid","type":"string"},"status":{"description":"Processing status","type":"string"}},"type":"object"},"success":{"description":"Whether the message was sent successfully","type":"boolean"}},"title":"SendMessageResponse","type":"object"},"SendPushRequest":{"description":"Request body for sending a push notification to a user","example":{"body":"You have a new message from support","data":{"conversation_id":"123e4567-e89b-12d3-a456-426614174000","message_type":"agent_reply"},"email":"user@example.com","interruption_level":"time-sensitive","priority":"high","sound":"chime-medium.caf","title":"New Message"},"properties":{"body":{"description":"Notification body text","type":"string"},"data":{"description":"Additional data to include in the notification","type":"object"},"email":{"description":"Email address of the user to send notification to","format":"email","type":"string"},"interruption_level":{"description":"Interruption level: passive (silent), active (default), time-sensitive (bypasses Focus)","enum":["passive","active","time-sensitive"],"type":"string"},"priority":{"description":"Notification priority (default: normal)","enum":["critical","high","medium","normal","low"],"type":"string"},"sound":{"description":"Notification sound (optional)","enum":["default","alert-high.caf","bell.caf","cashregister.caf","chime-medium.caf","subtle-low.caf"],"type":"string"},"title":{"description":"Notification title","type":"string"}},"required":["email","title","body"],"title":"SendPushRequest","type":"object"},"SendPushResponse":{"description":"Response after sending push notification","example":{"devices_failed":0,"devices_succeeded":2,"email":"user@example.com","priority":"high","success":true,"total_devices":2,"user_id":"123e4567-e89b-12d3-a456-426614174002"},"properties":{"devices_failed":{"description":"Number of devices that failed to receive","type":"integer"},"devices_succeeded":{"description":"Number of devices that received the notification","type":"integer"},"email":{"description":"Target user email","format":"email","type":"string"},"priority":{"description":"Priority used","type":"string"},"sound":{"description":"Sound used (if specified)","type":"string"},"success":{"description":"Whether notification was sent successfully","type":"boolean"},"total_devices":{"description":"Total devices targeted","type":"integer"},"user_id":{"description":"Target user ID","format":"uuid","type":"string"}},"title":"SendPushResponse","type":"object"},"TypingIndicatorRequest":{"description":"Request body for sending typing indicator","example":{"callback_type":"typing","conversation_id":"123e4567-e89b-12d3-a456-426614174000","data":{"label":"Thinking...","show_dots":true,"timeout":60000,"typing":true}},"properties":{"callback_type":{"description":"Must be 'typing' for typing indicators","enum":["typing"],"type":"string"},"conversation_id":{"description":"ID of the conversation","format":"uuid","type":"string"},"data":{"properties":{"label":{"description":"Optional label to display with the typing indicator (e.g., 'Thinking...', 'Searching documents...')","type":"string"},"show_dots":{"description":"Whether to show the animated dots (default: true). Set to false to show only the label.","type":"boolean"},"timeout":{"description":"Timeout in milliseconds before the typing indicator auto-clears (default: 30000ms). Use for long-running operations.","type":"integer"},"typing":{"description":"Whether agent is typing (true) or stopped typing (false)","type":"boolean"}},"type":"object"}},"required":["callback_type","conversation_id"],"title":"TypingIndicatorRequest","type":"object"},"TypingIndicatorResponse":{"description":"Response after sending typing indicator","example":{"callback_result":{"label":"Thinking...","processed":true,"show_dots":true,"type":"typing","typing":true},"success":true},"properties":{"callback_result":{"properties":{"label":{"description":"Label displayed with the typing indicator (if provided)","type":"string"},"processed":{"description":"Whether callback was processed","type":"boolean"},"show_dots":{"description":"Whether dots are shown (default: true)","type":"boolean"},"type":{"description":"Callback type","type":"string"},"typing":{"description":"Current typing state","type":"boolean"}},"type":"object"},"success":{"description":"Whether the indicator was sent","type":"boolean"}},"title":"TypingIndicatorResponse","type":"object"}},"securitySchemes":{"bearer_auth":{"bearerFormat":"API Key","description":"API Key authentication. Get your API key from the Lerty dashboard.","scheme":"bearer","type":"http"}}},"info":{"description":"# Lerty Developer API Documentation\n\nWelcome to the Lerty API documentation. This API allows you to integrate Lerty's\nconversational AI capabilities into your applications and workflows.\n\n## Authentication\n\nAll API endpoints require authentication using an API Key. You can create API keys\nin your Lerty dashboard under Settings > API Keys.\n\nInclude your API key in the `Authorization` header:\n\n```\nAuthorization: Bearer YOUR_API_KEY\n```\n\n## Rate Limits\n\nAPI requests are rate-limited to ensure fair usage. Current limits:\n- 100 requests per minute per API key\n- 1000 requests per hour per API key\n\n## Support\n\nFor support, please contact us at support@lerty.ai or visit https://lerty.ai/docs\n","title":"Lerty API","version":"1.0"},"openapi":"3.0.0","paths":{"/api/push/send/approval":{"post":{"callbacks":{},"description":"Sends a push notification with approval actions that displays in iOS widgets.\n\n## Example Request\n\n```bash\ncurl -X POST https://lerty.ai/api/push/send/approval \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"user@example.com\",\n    \"approval\": {\n      \"id\": \"approval-001\",\n      \"category\": \"orders\",\n      \"status\": \"pending\",\n      \"item_title\": \"Order #1234 Approval\",\n      \"item_subtitle\": \"$129.99 - 3 items from John Doe\",\n      \"item_details\": \"Customer: John Doe\\nEmail: john@example.com\\nPayment: Credit Card\",\n      \"notification_type\": \"approval\",\n      \"plugin_name\": \"FluentCart\",\n      \"approval_required\": true,\n      \"approval_mode\": \"direct\",\n      \"customer_branding\": {\n        \"name\": \"My Store\",\n        \"color\": \"#FF5722\",\n        \"logo_url\": \"https://example.com/logo.png\"\n      },\n      \"approval_actions\": [\n        {\n          \"action_id\": \"approve\",\n          \"label\": \"Approve Order\",\n          \"api_endpoint\": \"https://example.com/webhook/approve\",\n          \"method\": \"POST\",\n          \"auth_type\": \"bearer\",\n          \"bearer_token\": \"your_webhook_token\",\n          \"confirm\": true,\n          \"body_parameters\": {\n            \"action\": \"approve\",\n            \"order_id\": \"1234\",\n            \"timestamp\": \"2025-01-15T10:30:00Z\",\n            \"notification_id\": \"approval-001\"\n          }\n        },\n        {\n          \"action_id\": \"reject\",\n          \"label\": \"Reject Order\",\n          \"api_endpoint\": \"https://example.com/webhook/reject\",\n          \"method\": \"POST\",\n          \"auth_type\": \"bearer\",\n          \"bearer_token\": \"your_webhook_token\",\n          \"confirm\": true,\n          \"body_parameters\": {\n            \"action\": \"reject\",\n            \"order_id\": \"1234\",\n            \"timestamp\": \"2025-01-15T10:30:00Z\",\n            \"notification_id\": \"approval-001\"\n          }\n        }\n      ]\n    }\n  }'\n```\n","operationId":"AgentChatWeb.API.PushController.send_approval","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"approval":{"description":"Approval data matching WidgetNotification model","type":"object"},"body":{"description":"Push notification body (optional)","type":"string"},"email":{"description":"User email","type":"string"},"title":{"description":"Push notification title (optional)","type":"string"}},"required":["email","approval"],"type":"object"}}},"description":"Approval notification","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPushResponse"}}},"description":"Notification sent"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"User not found"}},"security":[{"bearer_auth":[]}],"summary":"Send approval widget notification","tags":["Push Notifications"]}},"/api/v1/tables/{table_id}/aggregate":{"post":{"callbacks":{},"description":"Compute one or more aggregations over entries in a table.\n\n**Required permission:** `data.tables:read`\n\n## Functions\n\n- `count` — Count all entries (no field required)\n- `distinct_count` — Count distinct non-null values\n- `sum` — Sum numeric values\n- `avg` — Average numeric values\n- `min` — Minimum value\n- `max` — Maximum value\n\n## Form A — Single aggregation (backward compatible)\n\nPass `function` (and optionally `field`) at the top level.\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/aggregate \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"function\": \"count\"}'\n```\n\nResponse:\n```json\n{\"data\": {\"function\": \"count\", \"field\": null, \"result\": 42}}\n```\n\n## Form B — Multiple aggregations (new)\n\nPass an `aggregates` array. Each element has `function` and optional `field` (display ID or name).\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/aggregate \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"aggregates\": [{\"function\": \"count\"}, {\"function\": \"sum\", \"field\": \"fd_amount\"}]}'\n```\n\nResponse (map keyed by function name when all functions are unique):\n```json\n{\"data\": {\"count\": 42, \"sum\": 1500}}\n```\n\nResponse (array when duplicate function names are present):\n```json\n{\"data\": [{\"function\": \"sum\", \"value\": 500}, {\"function\": \"sum\", \"value\": 200}]}\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.aggregate","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"table_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"Use either Form A (top-level `function`) or Form B (`aggregates` array). Do not mix both.","properties":{"aggregates":{"description":"Form B: array of aggregation specs to compute in one request","items":{"properties":{"field":{"description":"Field display ID or field name (not required for `count`). Alias: `field_id`.","type":"string"},"field_id":{"description":"Alias for `field`","type":"string"},"function":{"enum":["count","distinct_count","sum","avg","min","max"],"type":"string"}},"required":["function"],"type":"object"},"type":"array"},"field":{"description":"Form A: field display ID or field name to aggregate over (not required for `count`)","type":"string"},"function":{"description":"Form A: aggregation function to compute","enum":["count","distinct_count","sum","avg","min","max"],"type":"string"}},"type":"object"}}},"description":"Aggregation parameters","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Aggregation result"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid aggregation"}},"security":[{"bearer_auth":[]}],"summary":"Compute aggregation","tags":["Entries"]}},"/api/v1/tables/{table_id}/entries/query":{"post":{"callbacks":{},"description":"Query entries in a table with complex filtering, sorting, and pagination.\n\nUse this endpoint for complex queries. For simple listing, use `GET /tables/:table_id/entries`.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/entries/query \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"limit\": 20,\n    \"filters\": [\n      {\"field\": \"fd_status\", \"op\": \"is\", \"value\": \"op_done\"},\n      {\"field\": \"fd_date\", \"op\": \"is_after\", \"value\": \"2025-01-01\"}\n    ],\n    \"sort\": [{\"field\": \"fd_date\", \"direction\": \"desc\"}]\n  }'\n```\n\n## Filter key aliases\n\nEach filter object accepts the following keys:\n- `field` (string) — field display ID (e.g. `fd_abc123`) or field name (case-insensitive)\n- `field_id` (string) — alias for `field`\n- `op` (string) — operator (legacy key)\n- `operator` (string) — alias for `op`\n- `value` — the filter value\n\nBoth `{\"field\": \"Status\", \"op\": \"is\", \"value\": \"Active\"}` and\n`{\"field_id\": \"fd_abc123\", \"operator\": \"is\", \"value\": \"Active\"}` are equivalent.\n\nField names for select/multi_select fields accept human-readable option labels as values;\nthey are resolved to option IDs automatically.\n\n## Filter operators by field type\n\n| Field type | Operators |\n|------------|-----------|\n| text | contains, does_not_contain, is, is_not, starts_with, ends_with, is_empty, is_not_empty |\n| number | equals, not_equals, greater_than, less_than, greater_or_equal, less_or_equal, is_empty, is_not_empty |\n| date | is, is_not, is_before, is_after, is_on_or_before, is_on_or_after, is_empty, is_not_empty |\n| select | is, is_not, is_empty, is_not_empty |\n| multi_select | contains_any, contains_all, does_not_contain, is_empty, is_not_empty |\n| checkbox | is_checked, is_unchecked |\n| user | contains_any, contains_all, does_not_contain, is_empty, is_not_empty |\n| relation | contains, is_empty, is_not_empty |\n| file | is_empty, is_not_empty |\n| formula, rollup | _(not filterable)_ |\n\n## Notes\n- Filters are combined with AND logic\n- Dates respect the `timezone` parameter (default: UTC)\n- Maximum 200 entries per page\n- The `meta` object includes `has_more` (boolean) indicating whether additional pages exist\n","operationId":"AgentChatWeb.API.V1.EntryController.query","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"table_id","required":true,"schema":{"type":"string"}},{"description":"When true, response values are keyed by field name instead of field display ID (e.g. \"Status\" instead of \"fd_abc123\"). Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"filters":{"description":"Array of filter conditions combined with AND logic. Each filter supports key aliases: `field_id` = `field`, `operator` = `op`.","items":{"properties":{"field":{"description":"Field display ID (e.g. fd_abc123) or field name (case-insensitive)","type":"string"},"field_id":{"description":"Alias for `field`","type":"string"},"op":{"description":"Filter operator. Valid values depend on field type — see description above.","type":"string"},"operator":{"description":"Alias for `op`","type":"string"},"value":{"description":"Filter value. For select/multi_select fields, option labels are accepted in addition to option IDs."}},"type":"object"},"type":"array"},"limit":{"default":50,"type":"integer"},"offset":{"default":0,"type":"integer"},"search":{"type":"string"},"sort":{"items":{"properties":{"direction":{"enum":["asc","desc"],"type":"string"},"field":{"type":"string"}},"type":"object"},"type":"array"},"timezone":{"default":"UTC","type":"string"}},"type":"object"}}},"description":"Query parameters","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Filtered entries"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid filter"}},"security":[{"bearer_auth":[]}],"summary":"Query entries with filters","tags":["Entries"]}},"/api/v1/agents/{id}/webhooks/{webhook_id}":{"delete":{"callbacks":{},"description":"Removes a registered webhook.","operationId":"AgentChatWeb.API.V1.AgentController.delete_webhook","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Webhook ID","in":"path","name":"webhook_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Webhook deleted"}},"security":[{"bearer_auth":[]}],"summary":"Delete webhook","tags":["Agents"]}},"/api/push/stats":{"get":{"callbacks":{},"operationId":"AgentChatWeb.API.PushController.stats","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"by_environment":{"type":"object"},"by_platform":{"type":"object"},"total_devices":{"type":"integer"},"total_users":{"type":"integer"}},"type":"object"}}},"description":"Push notification statistics"}},"security":[{"bearer_auth":[]}],"summary":"Get push notification statistics","tags":["Push Notifications"]}},"/api/v1/files/confirm":{"post":{"callbacks":{},"description":"Call after PUTting the file to S3. Verifies the file exists, checks size\nand quota, records it, and attaches it to the entry field.\n\n**Required permissions:** `files:write`, `data.tables:write`\n","operationId":"AgentChatWeb.API.V1.FileController.confirm","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"upload_token":{"description":"Token from the upload response","type":"string"}},"required":["upload_token"],"type":"object"}}},"description":"Confirmation","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"File recorded and attached"},"400":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid/expired token or size mismatch"},"402":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Storage quota exceeded"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"File not in S3 or entry not found"}},"security":[{"bearer_auth":[]}],"summary":"Confirm a file upload","tags":["Files"]}},"/api/agents/{agent_id}/callback":{"post":{"callbacks":{},"description":"Handles agent callbacks including typing indicators, status updates, and error notifications.\n\n## Sending Typing Indicator\n\n```bash\ncurl -X POST https://lerty.ai/api/agents/AGENT_ID/callback \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"callback_type\": \"typing\",\n    \"conversation_id\": \"CONVERSATION_ID\",\n    \"data\": {\n      \"typing\": true,\n      \"label\": \"Thinking...\",\n      \"show_dots\": true\n    }\n  }'\n```\n\n- `label` (optional): Displays shimmer-animated text alongside the typing dots\n- `show_dots` (optional, default: true): Set to false to hide dots and show only the label\n\nTo stop typing indicator, send the same request with `\"typing\": false`.\n","operationId":"AgentChatWeb.AgentApiController.handle_callback","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypingIndicatorRequest"}}},"description":"Callback data","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypingIndicatorResponse"}}},"description":"Callback processed"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid callback"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Send typing indicator or status update","tags":["Messaging"]}},"/webhooks/agents/{agent_id}/webhook":{"delete":{"callbacks":{},"operationId":"AgentChatWeb.AgentWebhookController.delete_webhook","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"success":{"type":"boolean"}},"type":"object"}}},"description":"Webhook deleted"}},"security":[{"bearer_auth":[]}],"summary":"Delete agent webhook","tags":["Agent Replies"]}},"/api/agents/{agent_id}/conversations":{"get":{"callbacks":{},"operationId":"AgentChatWeb.AgentApiController.list_conversations","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}},{"description":"Number of conversations to return (default: 20)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Pagination offset (default: 0)","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"Filter by conversation status","in":"query","name":"status","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"conversations":{"items":{"type":"object"},"type":"array"},"success":{"type":"boolean"}},"type":"object"}}},"description":"List of conversations"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"List agent conversations","tags":["Messaging"]},"post":{"callbacks":{},"operationId":"AgentChatWeb.AgentApiController.create_conversation","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"initial_message":{"description":"First message (optional)","type":"string"},"metadata":{"description":"Additional metadata (optional)","type":"object"},"title":{"description":"Conversation title","type":"string"}},"type":"object"}}},"description":"Conversation details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"conversation":{"type":"object"},"success":{"type":"boolean"}},"type":"object"}}},"description":"Conversation created"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Create new conversation","tags":["Messaging"]}},"/api/v1/databases/{id}":{"delete":{"callbacks":{},"description":"Soft-deletes a database. The database will no longer appear in listings.\n\n**Required permission:** `data.databases:write`\n\n## Example\n\n```bash\ncurl -X DELETE https://lerty.ai/api/v1/databases/db_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.DatabaseController.delete","parameters":[{"description":"Database identifier — display ID (e.g. db_abc123), UUID, or human-readable name (e.g. \"My Database\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Database deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a database","tags":["Databases"]},"get":{"callbacks":{},"description":"Returns a single database by its display ID, UUID, or name.\n\n**Required permission:** `data.databases:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/databases/db_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.DatabaseController.show","parameters":[{"description":"Database identifier — display ID (e.g. db_abc123), UUID, or human-readable name (e.g. \"My Database\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Database details"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get a database","tags":["Databases"]},"patch":{"callbacks":{},"description":"Updates an existing database.\n\n**Required permission:** `data.databases:write`\n\n## Example\n\n```bash\ncurl -X PATCH https://lerty.ai/api/v1/databases/db_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Updated Name\"}'\n```\n","operationId":"AgentChatWeb.API.V1.DatabaseController.update","parameters":[{"description":"Database identifier — display ID (e.g. db_abc123), UUID, or human-readable name (e.g. \"My Database\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"color":{"type":"string"},"description":{"type":"string"},"name":{"type":"string"}},"type":"object"}}},"description":"Database updates","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Database updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a database","tags":["Databases"]}},"/api/v1/entries/{id}":{"delete":{"callbacks":{},"description":"Soft-deletes an entry.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X DELETE https://lerty.ai/api/v1/entries/en_bbb222 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.delete","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Entry deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete an entry","tags":["Entries"]},"get":{"callbacks":{},"description":"Returns a single entry by its display ID.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/entries/en_bbb222 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.show","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"When true, response values are keyed by field name instead of field display ID (e.g. \"Status\" instead of \"fd_abc123\"). Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Entry details"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get an entry","tags":["Entries"]},"patch":{"callbacks":{},"description":"Updates an entry's values. Values are merged with existing values.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X PATCH https://lerty.ai/api/v1/entries/en_bbb222 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\": {\"fd_aaa111\": \"Updated task name\"}}'\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.update","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"When true, response values are keyed by field name instead of field display ID (e.g. \"Status\" instead of \"fd_abc123\"). Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"values":{"description":"Field display ID to value mapping","type":"object"}},"type":"object"}}},"description":"Entry updates","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Entry updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update an entry","tags":["Entries"]}},"/api/push/devices":{"get":{"callbacks":{},"description":"Returns all registered push notification devices for a user.\n\n## Example Request\n\n```bash\ncurl -X GET \"https://lerty.ai/api/push/devices?email=user@example.com\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.PushController.list_devices","parameters":[{"description":"User email address","in":"query","name":"email","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDevicesResponse"}}},"description":"Device list"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"User not found"}},"security":[{"bearer_auth":[]}],"summary":"List user's registered devices","tags":["Push Notifications"]}},"/api/v1/organization":{"get":{"callbacks":{},"description":"Returns the organization associated with the API key.\n\n**Required permission:** `organizations:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/organization \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.OrganizationApiController.show","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"organization":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"}},"type":"object"}}},"description":"Organization details"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"Get organization","tags":["Organizations"]}},"/webhooks/agents/{agent_id}/setup":{"post":{"callbacks":{},"operationId":"AgentChatWeb.AgentWebhookController.setup_webhook","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"enabled":{"description":"Enable/disable webhook","type":"boolean"},"webhook_url":{"description":"Webhook URL","type":"string"}},"type":"object"}}},"description":"Webhook configuration","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"webhook":{"type":"object"}},"type":"object"}}},"description":"Webhook configured"}},"security":[{"bearer_auth":[]}],"summary":"Setup agent webhook","tags":["Agent Replies"]}},"/api/v1/entries/{id}/notes":{"get":{"callbacks":{},"description":"Returns the TipTap JSON notes for an entry.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/entries/en_bbb222/notes \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.show_notes","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Entry notes"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get entry notes","tags":["Entries"]},"patch":{"callbacks":{},"description":"Replaces the entry's TipTap JSON notes. Pass `null` to clear notes.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X PATCH https://lerty.ai/api/v1/entries/en_bbb222/notes \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"notes\": {\"type\": \"doc\", \"content\": [{\"type\": \"paragraph\", \"content\": [{\"type\": \"text\", \"text\": \"Hello\"}]}]}}'\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.update_notes","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"notes":{"description":"TipTap JSON document, or null to clear","nullable":true,"type":"object"}},"type":"object"}}},"description":"Notes content","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated notes"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update entry notes","tags":["Entries"]}},"/api/v1/agents/{id}/connection-info":{"get":{"callbacks":{},"description":"Returns connection details including webhook URLs and API endpoints for an agent.\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/agents/{agent_id}/connection-info \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.connection_info","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Connection info"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Get agent connection info","tags":["Agents"]}},"/api/push/send":{"post":{"callbacks":{},"description":"Sends a push notification to all registered devices for a user identified by email.\n\n## Priority Levels\n\n- `critical`: Time-sensitive alerts (bypasses Do Not Disturb on iOS)\n- `high`: Important notifications\n- `medium/normal`: Standard notifications (default)\n- `low`: Background updates\n\n## Example Request\n\n```bash\ncurl -X POST https://lerty.ai/api/push/send \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"user@example.com\",\n    \"title\": \"New Message\",\n    \"body\": \"You have a new message from support\",\n    \"priority\": \"high\",\n    \"data\": {\n      \"conversation_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n    }\n  }'\n```\n","operationId":"AgentChatWeb.API.PushController.send_to_email","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPushRequest"}}},"description":"Push notification","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPushResponse"}}},"description":"Notification sent"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"User not found"}},"security":[{"bearer_auth":[]}],"summary":"Send push notification to user by email","tags":["Push Notifications"]}},"/api/v1/agents/{id}":{"get":{"callbacks":{},"description":"Returns a single agent by ID.\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/agents/{agent_id} \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.show","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Include detailed info","in":"query","name":"detailed","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent details"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Get agent","tags":["Agents"]},"patch":{"callbacks":{},"description":"Updates an agent's configuration including webhook URLs.\n\n## Example\n\n```bash\ncurl -X PUT https://lerty.ai/api/v1/agents/{agent_id} \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"webhook_url\": \"https://n8n.example.com/webhook/xxx\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.update_agent (2)","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"enabled":{"type":"boolean"},"name":{"type":"string"},"webhook_token":{"type":"string"},"webhook_url":{"format":"uri","type":"string"}},"type":"object"}}},"description":"Agent configuration","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent updated"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Update agent","tags":["Agents"]},"put":{"callbacks":{},"description":"Updates an agent's configuration including webhook URLs.\n\n## Example\n\n```bash\ncurl -X PUT https://lerty.ai/api/v1/agents/{agent_id} \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"webhook_url\": \"https://n8n.example.com/webhook/xxx\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.update_agent","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"enabled":{"type":"boolean"},"name":{"type":"string"},"webhook_token":{"type":"string"},"webhook_url":{"format":"uri","type":"string"}},"type":"object"}}},"description":"Agent configuration","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent updated"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Update agent","tags":["Agents"]}},"/api/v1/agents/{id}/messages":{"post":{"callbacks":{},"description":"Sends a message to an agent and receives a response.\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/agents/{agent_id}/messages \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"Hello!\", \"conversation_id\": \"optional-uuid\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.send_message","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"example":{"content":"Hello, I need help","conversation_id":"uuid-here"},"properties":{"content":{"description":"Message text","type":"string"},"conversation_id":{"description":"Optional conversation ID","format":"uuid","type":"string"}},"required":["content"],"type":"object"}}},"description":"Message content","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Message sent"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Send message to agent","tags":["Agents"]}},"/api/v1/tables/{table_id}/entries/bulk":{"post":{"callbacks":{},"description":"Perform multiple entry operations in a single request.\nMaximum 100 operations per request.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/entries/bulk \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"operations\": [\n      {\"action\": \"create\", \"values\": {\"fd_abc\": \"New item\"}},\n      {\"action\": \"update\", \"id\": \"en_123\", \"values\": {\"fd_abc\": \"Updated\"}},\n      {\"action\": \"delete\", \"id\": \"en_456\"}\n    ]\n  }'\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.bulk","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"table_id","required":true,"schema":{"type":"string"}},{"description":"When true, response values in each result are keyed by field name instead of field display ID. Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"operations":{"items":{"properties":{"action":{"enum":["create","update","delete"],"type":"string"},"id":{"description":"Entry display ID (for update/delete)","type":"string"},"values":{"description":"Entry values (for create/update)","type":"object"}},"type":"object"},"type":"array"}},"required":["operations"],"type":"object"}}},"description":"Bulk operations","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Bulk results"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Bulk create/update/delete entries","tags":["Entries"]}},"/api/agents/{agent_id}/status":{"get":{"callbacks":{},"operationId":"AgentChatWeb.AgentApiController.get_status","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"type":"object"},"success":{"type":"boolean"}},"type":"object"}}},"description":"Agent status"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent not found"}},"security":[{"bearer_auth":[]}],"summary":"Get agent status","tags":["Messaging"]}},"/api/v1/databases/{db_id}/tables":{"get":{"callbacks":{},"description":"Returns all tables in the specified database.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/databases/db_abc123/tables \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.TableController.index","parameters":[{"description":"Database identifier — display ID (e.g. db_abc123), UUID, or human-readable name (e.g. \"My Database\", case-insensitive)","in":"path","name":"db_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"List of tables"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Database not found"}},"security":[{"bearer_auth":[]}],"summary":"List tables in a database","tags":["Tables"]},"post":{"callbacks":{},"description":"Creates a new table in a database. The table is created with 4 default fields\n(Entry/text, Status/select, Date/date, Boolean/checkbox) and starts with no entries.\n\nYou may optionally pass a `fields` array to create additional custom fields inline\nwith the table. Each field requires `name` and `field_type`.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\n# Minimal create\ncurl -X POST https://lerty.ai/api/v1/databases/db_abc123/tables \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Tasks\", \"description\": \"All project tasks\"}'\n\n# With inline fields\ncurl -X POST https://lerty.ai/api/v1/databases/db_abc123/tables \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Tasks\", \"fields\": [{\"name\": \"Score\", \"type\": \"number\"}, {\"name\": \"Priority\", \"type\": \"select\", \"options\": [\"Low\", \"Medium\", \"High\"]}]}'\n```\n","operationId":"AgentChatWeb.API.V1.TableController.create","parameters":[{"description":"Database identifier — display ID (e.g. db_abc123), UUID, or human-readable name (e.g. \"My Database\", case-insensitive)","in":"path","name":"db_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"description":"Optional description","type":"string"},"fields":{"description":"Optional array of fields to create inline with the table. Each field is added after the 4 default fields. Use `type` (or `field_type`) to set the field type. For select/multi_select, pass `options` as a list of strings.","items":{"properties":{"name":{"description":"Field name","example":"Score","type":"string"},"options":{"description":"Shorthand for select/multi_select options. Pass a list of label strings (e.g. [\"Low\", \"Medium\", \"High\"]). Alternatively use config.options with full objects.","items":{"type":"string"},"type":"array"},"type":{"description":"Field type (alias: field_type)","enum":["text","number","select","multi_select","checkbox","date","file","formula","relation","rollup","user","created_date","updated_date","created_by","last_edited_by"],"type":"string"}},"required":["name","type"],"type":"object"},"type":"array"},"name":{"description":"Table name","example":"Tasks","type":"string"}},"required":["name"],"type":"object"}}},"description":"Table details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table created"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Database not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a table","tags":["Tables"]}},"/api/v1/messages/{message_id}":{"get":{"callbacks":{},"description":"Returns a single message by ID, including interactive message status.\nUse this to poll for interactive message response status.\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/messages/{message_id} \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n\n## Response Fields\n\nFor interactive messages, check `metadata.interactive.status`:\n- `pending` - Waiting for user response\n- `responded` - User has responded\n- `callback_failed` - Response recorded but callback failed\n","operationId":"AgentChatWeb.API.V1.AgentController.show_message","parameters":[{"description":"Message ID","in":"path","name":"message_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"content":{"type":"string"},"conversation_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"inserted_at":{"format":"date-time","type":"string"},"metadata":{"type":"object"},"role":{"type":"string"}},"type":"object"}}},"description":"Message details"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Message not found"}},"security":[{"bearer_auth":[]}],"summary":"Get message details","tags":["Agents"]}},"/api/v1/messages/{message_id}/respond":{"post":{"callbacks":{},"description":"Submits a response to an interactive message. This triggers the callback to the original sender.\n\n## Response Types\n\n- **boolean**: `{\"response\": {\"type\": \"boolean\", \"approved\": true, \"message\": \"Optional note\"}}`\n- **buttons**: `{\"response\": {\"type\": \"buttons\", \"selected\": \"button_value\"}}`\n- **fields**: `{\"response\": {\"type\": \"fields\", \"data\": {\"field_name\": \"value\"}}}`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/messages/{message_id}/respond \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"response\": {\"type\": \"boolean\", \"approved\": true, \"message\": \"Looks good!\"}}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.respond_interactive","parameters":[{"description":"Message ID","in":"path","name":"message_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RespondInteractiveRequest"}}},"description":"Response data","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RespondInteractiveResponse"}}},"description":"Response recorded"},"400":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid state"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Message not found"}},"security":[{"bearer_auth":[]}],"summary":"Respond to interactive message","tags":["Agents"]}},"/api/v1/conversations/{conversation_id}/originate":{"post":{"callbacks":{},"description":"Sends a new message to a conversation from an external source (not a reply).\nIncludes deduplication via external_message_id.\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/conversations/{conversation_id}/originate \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"Hello from external system\", \"external_message_id\": \"ext-123\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.originate_message","parameters":[{"description":"Conversation ID","in":"path","name":"conversation_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content":{"description":"Message text","type":"string"},"external_message_id":{"description":"External ID for deduplication","type":"string"},"metadata":{"description":"Additional metadata","type":"object"},"role":{"description":"Message role","enum":["agent","user"],"type":"string"}},"required":["content"],"type":"object"}}},"description":"Message content","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Message created"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Conversation not found"},"409":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Duplicate message"}},"security":[{"bearer_auth":[]}],"summary":"Originate message in conversation","tags":["Agents"]}},"/api/v1/agents/{id}/conversations":{"get":"ok"},"/api/v1/agents":{"get":{"callbacks":{},"description":"Returns all agents accessible to the API key's organization.\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/agents \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.index","parameters":[{"description":"Include detailed agent info (system instructions, LLM config)","in":"query","name":"detailed","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"agents":{"items":{"properties":{"description":{"type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"status":{"enum":["active","inactive"],"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"List of agents"}},"security":[{"bearer_auth":[]}],"summary":"List agents","tags":["Agents"]}},"/api/v1/fields/{id}":{"delete":{"callbacks":{},"description":"Soft-deletes a field.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X DELETE https://lerty.ai/api/v1/fields/fd_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.FieldController.delete","parameters":[{"description":"Field display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Field deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a field","tags":["Fields"]},"get":{"callbacks":{},"description":"Returns a single field by its display ID.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/fields/fd_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.FieldController.show","parameters":[{"description":"Field display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Field details"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get a field","tags":["Fields"]},"patch":{"callbacks":{},"description":"Updates a field's name or configuration.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X PATCH https://lerty.ai/api/v1/fields/fd_abc123 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Updated Field Name\"}'\n```\n","operationId":"AgentChatWeb.API.V1.FieldController.update","parameters":[{"description":"Field display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"config":{"type":"object"},"name":{"type":"string"}},"type":"object"}}},"description":"Field updates","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Field updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a field","tags":["Fields"]}},"/api/v1/files/upload":{"post":{"callbacks":{},"description":"Returns a presigned S3 URL for direct upload. The file is tied to an entry\nfield — every file must belong to an entry.\n\n**Step 1** — Call this with file metadata + where to attach it:\n\n    POST /files/upload\n    { \"entry_id\": \"en_abc\", \"field_id\": \"fd_xyz\", \"filename\": \"clip.mp4\",\n      \"content_type\": \"video/mp4\", \"size_bytes\": 5242880 }\n\n**Step 2** — PUT the file directly to the returned `upload_url`:\n\n    PUT <upload_url>\n    Content-Type: video/mp4\n    <binary data>\n\n**Step 3** — Confirm the upload:\n\n    POST /files/confirm\n    { \"upload_token\": \"<token from step 1>\" }\n\nFor URL imports (e.g. importing a video from fal.ai), download the content\nyourself first, then PUT it to the presigned URL. Same 3-step flow.\n\n**Required permissions:** `files:write`, `data.tables:write`\n","operationId":"AgentChatWeb.API.V1.FileController.upload","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"description":"MIME type (e.g. video/mp4)","type":"string"},"entry_id":{"description":"Entry display ID (e.g. en_abc123)","type":"string"},"field_id":{"description":"Field display ID (e.g. fd_xyz789)","type":"string"},"filename":{"description":"Filename with extension","type":"string"},"size_bytes":{"description":"File size in bytes","type":"integer"}},"required":["entry_id","field_id","filename","content_type","size_bytes"],"type":"object"}}},"description":"Upload request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Presigned upload URL and token"},"400":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Invalid parameters"},"402":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Storage quota exceeded"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Entry not found"}},"security":[{"bearer_auth":[]}],"summary":"Upload a file","tags":["Files"]}},"/api/agents/{agent_id}/send":{"post":{"callbacks":{},"description":"Sends a message to an agent. If conversation_id is not provided, a new conversation will be created.\nThe agent will process the message and respond via webhook or push notification.\n\n## Example Request\n\n```bash\ncurl -X POST https://lerty.ai/api/agents/AGENT_ID/send \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": \"Hello, I need help with my account\",\n    \"metadata\": {\n      \"source\": \"wordpress\",\n      \"user_email\": \"user@example.com\"\n    }\n  }'\n```\n","operationId":"AgentChatWeb.AgentApiController.send_message","parameters":[{"description":"Agent ID","example":"123e4567-e89b-12d3-a456-426614174000","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}},"description":"Message to send","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}},"description":"Message sent successfully"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent not found"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent unavailable"}},"security":[{"bearer_auth":[]}],"summary":"Send message to agent","tags":["Messaging"]}},"/api/push/send/token":{"post":{"callbacks":{},"operationId":"AgentChatWeb.API.PushController.send_to_token","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"description":"Notification body","type":"string"},"priority":{"enum":["critical","high","medium","normal","low"],"type":"string"},"title":{"description":"Notification title","type":"string"},"token":{"description":"Device token","type":"string"}},"required":["token"],"type":"object"}}},"description":"Push notification","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"}},"type":"object"}}},"description":"Notification sent"}},"security":[{"bearer_auth":[]}],"summary":"Send push notification to device token","tags":["Push Notifications"]}},"/api/v1/organization/members/{user_id}":{"delete":{"callbacks":{},"description":"Removes a member from the organization by user ID.\n\n**Restrictions:**\n- Cannot remove organization owners\n- Cannot remove admins via API\n- Cannot remove yourself\n\n**Required permission:** `members:write`\n\n## Example\n\n```bash\ncurl -X DELETE https://lerty.ai/api/v1/organization/members/{user_id} \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.OrganizationApiController.remove_member","parameters":[{"description":"User ID to remove","in":"path","name":"user_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"content":{"application/json":{}},"description":"Member removed"},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Cannot remove this user"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"User not found"}},"security":[{"bearer_auth":[]}],"summary":"Remove member from organization","tags":["Organizations"]}},"/api/v1/entries/{id}/notes/append":{"post":{"callbacks":{},"description":"Appends TipTap block nodes to the entry's existing notes. If the entry has no notes,\ncreates a new document with the provided content.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/entries/en_bbb222/notes/append \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": [{\"type\": \"paragraph\", \"content\": [{\"type\": \"text\", \"text\": \"Appended note\"}]}]}'\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.append_notes","parameters":[{"description":"Entry display ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content":{"description":"Array of TipTap block nodes to append","items":{"type":"object"},"type":"array"}},"required":["content"],"type":"object"}}},"description":"Content nodes to append","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Updated notes"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Append to entry notes","tags":["Entries"]}},"/api/v1/tables/{table_id}/fields":{"get":{"callbacks":{},"description":"Returns all fields in the specified table, ordered by position.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/tables/tb_xyz789/fields \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.FieldController.index","parameters":[{"description":"Table display ID","in":"path","name":"table_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"List of fields"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"}},"security":[{"bearer_auth":[]}],"summary":"List fields in a table","tags":["Fields"]},"post":{"callbacks":{},"description":"Creates a new field in a table.\n\n**Required permission:** `data.tables:write`\n\n## Field types\n\nValid types: `text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `file`,\n`relation`, `formula`, `rollup`, `user`.\n\n## Config by field type\n\n| Type | Config |\n|------|--------|\n| `select`, `multi_select` | `{\"options\": [{\"label\": \"...\", \"color\": \"...\"}]}` |\n| `formula` | `{\"expression\": \"{Price} * {Quantity}\"}` |\n| `relation` | `{\"related_table_id\": \"tb_xxx\"}` |\n| other types | `{}` (empty or omit) |\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/fields \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Priority\", \"type\": \"select\", \"config\": {\"options\": [{\"label\": \"High\", \"color\": \"red\"}, {\"label\": \"Low\", \"color\": \"gray\"}]}}'\n```\n","operationId":"AgentChatWeb.API.V1.FieldController.create","parameters":[{"description":"Table display ID","in":"path","name":"table_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"config":{"description":"Type-specific configuration","type":"object"},"name":{"description":"Field name","type":"string"},"type":{"description":"Field type","type":"string"}},"required":["name","type"],"type":"object"}}},"description":"Field details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Field created"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a field","tags":["Fields"]}},"/api/v1/organization/members":{"get":{"callbacks":{},"description":"Returns all members of the organization associated with the API key.\n\n**Required permission:** `members:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/organization/members \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.OrganizationApiController.list_members","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"members":{"items":{"properties":{"email":{"format":"email","type":"string"},"id":{"format":"uuid","type":"string"},"role":{"enum":["owner","admin","member"],"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"List of members"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"}},"security":[{"bearer_auth":[]}],"summary":"List organization members","tags":["Organizations"]},"post":{"callbacks":{},"description":"Invites a user to the organization by email. If the user doesn't have an account,\none will be created and they will receive a magic link to log in.\n\nNew members are always assigned the \"member\" role.\n\n**Required permission:** `members:write`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/organization/members \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"user@example.com\"}'\n```\n","operationId":"AgentChatWeb.API.V1.OrganizationApiController.invite_member","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"example":{"email":"user@example.com"},"properties":{"email":{"description":"Email address to invite","format":"email","type":"string"}},"required":["email"],"type":"object"}}},"description":"Invitation details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"member":{"properties":{"email":{"format":"email","type":"string"},"id":{"format":"uuid","type":"string"},"role":{"type":"string"}},"type":"object"}},"type":"object"}}},"description":"Member invited"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Forbidden"},"409":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"}},"type":"object"}}},"description":"Already a member"}},"security":[{"bearer_auth":[]}],"summary":"Invite member to organization","tags":["Organizations"]}},"/webhooks/agents/{agent_id}/message":{"post":{"callbacks":{},"description":"Receives agent responses from external systems (e.g., N8N workflows, custom backends).\nThis endpoint is typically called by your agent integration to send replies back to users.\n\n## Example Request\n\n```bash\ncurl -X POST https://lerty.ai/webhooks/agents/AGENT_ID/message \\\n  -H \"Authorization: Bearer AGENT_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"conversation_id\": \"CONVERSATION_ID\",\n    \"content\": \"I can help you with that. What specifically do you need?\",\n    \"message_id\": \"ext_msg_12345\",\n    \"timestamp\": \"2025-10-31T10:30:05Z\"\n  }'\n```\n","operationId":"AgentChatWeb.AgentWebhookController.receive_message","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReplyRequest"}}},"description":"Agent reply","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReplyResponse"}}},"description":"Reply received"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Security violation"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Agent or conversation not found"}},"security":[{"bearer_auth":[]}],"summary":"Receive agent reply message","tags":["Agent Replies"]}},"/api/v1/tables/{id}":{"delete":{"callbacks":{},"description":"Soft-deletes a table.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X DELETE https://lerty.ai/api/v1/tables/tb_xyz789 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.TableController.delete","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Table deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a table","tags":["Tables"]},"get":{"callbacks":{},"description":"Returns a single table with its fields included.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/tables/tb_xyz789 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.TableController.show","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table details with fields"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"}},"security":[{"bearer_auth":[]}],"summary":"Get a table","tags":["Tables"]},"patch":{"callbacks":{},"description":"Updates a table's name or description.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\ncurl -X PATCH https://lerty.ai/api/v1/tables/tb_xyz789 \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Updated Tasks\"}'\n```\n","operationId":"AgentChatWeb.API.V1.TableController.update","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"name":{"type":"string"}},"type":"object"}}},"description":"Table updates","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Update a table","tags":["Tables"]}},"/api/push/live-activity/update":{"post":{"callbacks":{},"description":"Updates a Live Activity by notification ID from server-side applications.\nThis endpoint uses API key authentication for backend services.\n\n## Starting a Live Activity\n\nTo **start** a Live Activity, use `/api/push/send` with `workflow_state` in the `data` field.\nSee the Quick Start Guide for complete examples.\n\n## Content State Fields\n\n- **itemTitle** (required): Main title displayed\n- **itemSubtitle** (optional): Additional subtitle text\n- **status** (required): Current status text\n- **currentStep** (optional): Current step number\n- **totalSteps** (optional): Total number of steps\n- **stepName** (optional): Name of current step\n- **progressPercent** (required): Progress percentage (0-100)\n- **lastUpdate** (optional): Unix timestamp in seconds (e.g., 1730462400). Defaults to current UTC time if not provided. Live Activities auto-dismiss after 2 minutes without updates.\n\n## Event Types\n\n- **update**: Update the Live Activity content (default)\n- **end**: End and dismiss the Live Activity\n\n## Priority Levels for Updates\n\n- **critical**: Bypasses Do Not Disturb, plays sound\n- **high**: Time-sensitive, plays sound in some Focus modes\n- **medium/normal**: Standard notifications (default)\n- **low**: Silent background updates, no sound/banner (recommended for frequent updates)\n\n## Example Request (Update)\n\n```bash\ncurl -X POST https://lerty.ai/api/push/live-activity/update \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"notification_id\": \"notif_456\",\n    \"content_state\": {\n      \"itemTitle\": \"Order Delivery\",\n      \"status\": \"In Transit\",\n      \"progressPercent\": 75,\n      \"lastUpdate\": 1730462400\n    }\n  }'\n```\n\n## Example Request (Silent Update)\n\n```bash\ncurl -X POST https://lerty.ai/api/push/live-activity/update \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"notification_id\": \"notif_456\",\n    \"priority\": \"low\",\n    \"content_state\": {\n      \"itemTitle\": \"Order Processing\",\n      \"status\": \"Preparing\",\n      \"progressPercent\": 35,\n      \"currentStep\": 2\n    }\n  }'\n```\n\n## Example Request (End Activity)\n\n```bash\ncurl -X POST https://lerty.ai/api/push/live-activity/update \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"notification_id\": \"notif_456\",\n    \"event\": \"end\",\n    \"dismissal_date\": 1730465000,\n    \"content_state\": {\n      \"itemTitle\": \"Delivery Complete\",\n      \"status\": \"Delivered\",\n      \"progressPercent\": 100\n    }\n  }'\n```\n","operationId":"AgentChatWeb.API.PushController.update_live_activity","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_state":{"description":"Live Activity content state","properties":{"currentStep":{"description":"Current step number (optional)","type":"integer"},"itemSubtitle":{"description":"Subtitle text (optional)","type":"string"},"itemTitle":{"description":"Main title displayed on Live Activity","type":"string"},"lastUpdate":{"description":"Unix timestamp in seconds (e.g., 1730462400). Defaults to current UTC time if omitted. Live Activities auto-dismiss after 2 minutes without updates.","type":"integer"},"progressPercent":{"description":"Progress percentage (0-100)","type":"integer"},"status":{"description":"Current status text","type":"string"},"stepName":{"description":"Name of current step (optional)","type":"string"},"totalSteps":{"description":"Total number of steps (optional)","type":"integer"}},"required":["itemTitle","status","progressPercent"],"type":"object"},"dismissal_date":{"description":"Unix timestamp in seconds for dismissal (only for end event, e.g., 1730465000)","type":"integer"},"event":{"description":"Event type: 'update' (default) or 'end' to dismiss","enum":["update","end"],"type":"string"},"notification_id":{"description":"Notification ID associated with the Live Activity","type":"string"},"priority":{"description":"Priority level: 'critical' bypasses DND, 'high' time-sensitive, 'normal' default, 'low' silent updates","enum":["critical","high","medium","normal","low"],"type":"string"}},"required":["notification_id","content_state"],"type":"object"}}},"description":"Live Activity update","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"notification_id":{"type":"string"},"success":{"type":"boolean"},"tokens_updated":{"type":"integer"}},"type":"object"}}},"description":"Live Activity updated"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"No active Live Activity found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Update failed"}},"security":[{"bearer_auth":[]}],"summary":"Update Live Activity (Server API)","tags":["Push Notifications"]}},"/webhooks/agents/{agent_id}/info":{"get":{"callbacks":{},"operationId":"AgentChatWeb.AgentWebhookController.webhook_info","parameters":[{"description":"Agent ID","in":"path","name":"agent_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"},"webhook":{"type":"object"}},"type":"object"}}},"description":"Webhook information"}},"security":[{"bearer_auth":[]}],"summary":"Get webhook information","tags":["Agent Replies"]}},"/api/v1/agents/{id}/conversations/create":{"post":{"callbacks":{},"description":"Creates a new conversation with an agent.\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/agents/{agent_id}/conversations/create \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"user_email\": \"user@example.com\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.create_conversation","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"example":{"user_email":"user@example.com"},"properties":{"metadata":{"description":"Optional metadata","type":"object"},"user_email":{"description":"User's email","format":"email","type":"string"}},"type":"object"}}},"description":"Conversation details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Conversation created"}},"security":[{"bearer_auth":[]}],"summary":"Create conversation","tags":["Agents"]}},"/api/v1/tables/{table_id}/entries":{"get":{"callbacks":{},"description":"Returns paginated entries from a table with optional simple sort and search.\nNew tables start empty — no default entries are created.\n\nFor complex filtering, use `POST /tables/:table_id/entries/query` instead.\n\n**Required permission:** `data.tables:read`\n\n## Example\n\n```bash\ncurl \"https://lerty.ai/api/v1/tables/tb_xyz789/entries?limit=20&sort=fd_abc:asc&search=login\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n\n## Query parameters\n\n| Param | Type | Default | Description |\n|-------|------|---------|-------------|\n| limit | integer | 50 | Page size (max 200) |\n| offset | integer | 0 | Pagination offset |\n| sort | string | - | `field_id:direction` or `field_name:direction` e.g. `fd_abc:asc` or `Status:desc` |\n| search | string | - | Full-text search across text fields |\n| timezone | string | UTC | IANA timezone for date comparisons |\n| field_names | boolean | false | When true, response values are keyed by field name instead of field display ID |\n\n## Pagination\n\nThe `meta` object includes `has_more` (boolean) indicating whether additional pages exist.\n","operationId":"AgentChatWeb.API.V1.EntryController.index","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"table_id","required":true,"schema":{"type":"string"}},{"description":"Page size (max 200)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Pagination offset","in":"query","name":"offset","required":false,"schema":{"type":"integer"}},{"description":"field_id:direction","in":"query","name":"sort","required":false,"schema":{"type":"string"}},{"description":"Search text","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"IANA timezone","in":"query","name":"timezone","required":false,"schema":{"type":"string"}},{"description":"When true, response values are keyed by field name instead of field display ID (e.g. \"Status\" instead of \"fd_abc123\"). Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"List of entries"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"}},"security":[{"bearer_auth":[]}],"summary":"List entries in a table","tags":["Entries"]},"post":{"callbacks":{},"description":"Creates a new entry in a table.\n\nEntry values can be keyed by field display IDs (e.g. `fd_abc123`) or field names (e.g. `\"Status\"`). Field names are resolved case-insensitively.\n\nThe body key `data` is accepted as an alias for `values` — both work identically.\n\n**Required permission:** `data.tables:write`\n\n## Example\n\n```bash\n# Using \"values\" key\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/entries \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"values\": {\"fd_aaa111\": \"Build login page\", \"fd_ccc333\": \"op_todo\"}}'\n\n# Using \"data\" alias\ncurl -X POST https://lerty.ai/api/v1/tables/tb_xyz789/entries \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"data\": {\"Status\": \"Active\"}}'\n```\n","operationId":"AgentChatWeb.API.V1.EntryController.create","parameters":[{"description":"Table identifier — display ID (e.g. tb_abc123), UUID, or human-readable name (e.g. \"My Table\", case-insensitive)","in":"path","name":"table_id","required":true,"schema":{"type":"string"}},{"description":"When true, response values are keyed by field name instead of field display ID (e.g. \"Status\" instead of \"fd_abc123\"). Option values for select/multi_select fields are also returned as human-readable labels.","in":"query","name":"field_names","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Alias for `values`. Either `values` or `data` may be used.","type":"object"},"values":{"description":"Field display ID or field name to value mapping. Keys can be field display IDs (e.g. fd_abc123) or field names (case-insensitive).","type":"object"}},"type":"object"}}},"description":"Entry values","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Entry created"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Table not found"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create an entry","tags":["Entries"]}},"/api/v1/agents/{id}/callback":{"post":"ok"},"/api/push/send/bulk":{"post":{"callbacks":{},"description":"Sends the same push notification to multiple users by email.\n\n## Example Request\n\n```bash\ncurl -X POST https://lerty.ai/api/push/send/bulk \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"recipients\": [\"user1@example.com\", \"user2@example.com\"],\n    \"title\": \"System Update\",\n    \"body\": \"New features are now available\",\n    \"priority\": \"normal\"\n  }'\n```\n","operationId":"AgentChatWeb.API.PushController.send_bulk","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBulkPushRequest"}}},"description":"Bulk push notification","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBulkPushResponse"}}},"description":"Notifications sent"}},"security":[{"bearer_auth":[]}],"summary":"Send push notification to multiple users","tags":["Push Notifications"]}},"/api/v1/databases":{"get":{"callbacks":{},"description":"Returns all databases in the organization associated with the API key.\n\n**Required permission:** `data.databases:read`\n\n## Example\n\n```bash\ncurl https://lerty.ai/api/v1/databases \\\n  -H \"Authorization: Bearer YOUR_API_KEY\"\n```\n","operationId":"AgentChatWeb.API.V1.DatabaseController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"type":"object"},"type":"array"},"meta":{"type":"object"}},"type":"object"}}},"description":"List of databases"}},"security":[{"bearer_auth":[]}],"summary":"List all databases","tags":["Databases"]},"post":{"callbacks":{},"description":"Creates a new database in the organization.\n\n**Required permission:** `data.databases:write`\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/databases \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Project Tracker\", \"description\": \"Track all tasks\", \"color\": \"#3B82F6\"}'\n```\n","operationId":"AgentChatWeb.API.V1.DatabaseController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"color":{"description":"Hex color code","example":"#3B82F6","type":"string"},"description":{"description":"Optional description","type":"string"},"name":{"description":"Database name","example":"Project Tracker","type":"string"}},"required":["name"],"type":"object"}}},"description":"Database details","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Database created"},"422":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Validation error"}},"security":[{"bearer_auth":[]}],"summary":"Create a database","tags":["Databases"]}},"/api/push/live-activity/start":{"post":"ok"},"/api/v1/files":{"get":{"callbacks":{},"description":"Returns all files in the organization.\n\n**Required permission:** `files:read`\n","operationId":"AgentChatWeb.API.V1.FileController.index","parameters":[{"description":"Page size (max 200)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Pagination offset","in":"query","name":"offset","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"List of files"}},"security":[{"bearer_auth":[]}],"summary":"List files","tags":["Files"]}},"/api/v1/agents/{id}/files":{"post":{"callbacks":{},"description":"Uploads a file attachment for an agent.","operationId":"AgentChatWeb.API.V1.AgentController.upload_file","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"File to upload","format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"description":"File upload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"File uploaded"},"400":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"No file provided"}},"security":[{"bearer_auth":[]}],"summary":"Upload file to agent","tags":["Agents"]}},"/api/push/send/organization":{"post":{"callbacks":{},"operationId":"AgentChatWeb.API.PushController.send_to_organization","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"body":{"description":"Notification body","type":"string"},"organization_id":{"description":"Organization ID","type":"string"},"priority":{"enum":["critical","high","medium","normal","low"],"type":"string"},"title":{"description":"Notification title","type":"string"}},"required":["organization_id"],"type":"object"}}},"description":"Push notification to organization","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean"}},"type":"object"}}},"description":"Notifications sent"}},"security":[{"bearer_auth":[]}],"summary":"Send push notification to organization","tags":["Push Notifications"]}},"/api/v1/conversations/{conversation_id}/messages":{"post":{"callbacks":{},"description":"Alternative endpoint for sending a message directly to a conversation.\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/conversations/{conversation_id}/messages \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"Hello!\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.send_message_to_conversation","parameters":[{"description":"Conversation ID","in":"path","name":"conversation_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content":{"description":"Message text","type":"string"},"metadata":{"description":"Additional metadata","type":"object"}},"required":["content"],"type":"object"}}},"description":"Message content","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Message sent"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Conversation not found"}},"security":[{"bearer_auth":[]}],"summary":"Send message to conversation","tags":["Agents"]}},"/api/v1/agents/{id}/webhooks":{"post":{"callbacks":{},"description":"Registers a webhook URL to receive messages from an agent.\nUsed by n8n Lerty Trigger node.\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/agents/{agent_id}/webhooks \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"webhook_url\": \"https://n8n.example.com/webhook/xxx\"}'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.register_webhook","parameters":[{"description":"Agent ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"webhook_url":{"format":"uri","type":"string"}},"required":["webhook_url"],"type":"object"}}},"description":"Webhook URL","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Webhook registered"}},"security":[{"bearer_auth":[]}],"summary":"Register webhook","tags":["Agents"]}},"/api/v1/files/{id}":{"delete":{"callbacks":{},"description":"Soft-deletes a file.\n\n**Required permission:** `files:write`\n","operationId":"AgentChatWeb.API.V1.FileController.delete","parameters":[{"description":"File ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"File deleted"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"File not found"}},"security":[{"bearer_auth":[]}],"summary":"Delete a file","tags":["Files"]}},"/api/v1/conversations/{conversation_id}/interactive":{"post":{"callbacks":{},"description":"Sends an interactive message (forms, buttons, approval requests) to a conversation.\nWhen the user responds, a callback is sent to your specified URL.\n\n## Element Types\n\n- **header**: Large text heading\n- **text**: Body text\n- **divider**: Visual separator\n- **boolean**: Approve/Reject buttons with optional message field\n- **buttons**: Multiple choice buttons\n- **fields**: Form with multiple input fields\n\n## Example\n\n```bash\ncurl -X POST https://lerty.ai/api/v1/conversations/{conversation_id}/interactive \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"callback_url\": \"https://your-server.com/callback\",\n    \"callback_id\": \"approval-001\",\n    \"elements\": [\n      {\"type\": \"header\", \"text\": \"Expense Approval\"},\n      {\"type\": \"text\", \"text\": \"Please approve $500 expense\"},\n      {\"type\": \"boolean\", \"approve_label\": \"Approve\", \"reject_label\": \"Reject\"}\n    ]\n  }'\n```\n","operationId":"AgentChatWeb.API.V1.AgentController.send_interactive","parameters":[{"description":"Conversation ID","in":"path","name":"conversation_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInteractiveRequest"}}},"description":"Interactive message","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInteractiveResponse"}}},"description":"Message created"},"403":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Not authorized"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Conversation not found"}},"security":[{"bearer_auth":[]}],"summary":"Send interactive message","tags":["Agents"]}},"/api/v1/files/{id}/download":{"get":{"callbacks":{},"description":"Returns a presigned download URL. Expires in 60 minutes.\n\n**Required permission:** `files:read`\n","operationId":"AgentChatWeb.API.V1.FileController.download","parameters":[{"description":"File ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Download URL"},"404":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"File not found"}},"security":[{"bearer_auth":[]}],"summary":"Get download URL","tags":["Files"]}}},"security":[],"servers":[{"url":"https://lerty.ai","variables":{}}],"tags":[{"description":"CRUD operations for databases","name":"Databases"},{"description":"CRUD operations for tables","name":"Tables"},{"description":"CRUD operations for fields","name":"Fields"},{"description":"CRUD operations for entries, bulk, and aggregations","name":"Entries"},{"description":"File upload, download, and management via presigned S3 URLs","name":"Files"},{"description":"Agent management","name":"Agents"},{"description":"Conversation management","name":"Conversations"},{"description":"Message operations","name":"Messages"},{"description":"Webhook configuration","name":"Webhooks"},{"description":"Organization information","name":"Organizations"},{"description":"Member management","name":"Members"}]}