{"openapi":"3.1.0","info":{"version":"1.0.0","title":"My API","description":"This is the API"},"servers":[{"url":"v1"}],"components":{"schemas":{},"parameters":{}},"paths":{"/v1/iam/resources/{resource_type}/{resource_id}/role_bindings":{"post":{"summary":"Assign a role binding to a principal for a resource","parameters":[{"schema":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"]},"required":true,"name":"resource_type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"resource_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"principal":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]},"role":{"type":"string"}},"required":["principal","role"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the role binding"},"principal":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}],"description":"Who this role binding applies to (member, group, or organization)"},"resource_type":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"],"description":"Type of resource being accessed"},"resource_id":{"type":"string","description":"ID of the specific resource"},"role":{"type":"string","description":"Role name (e.g., 'viewer', 'editor', 'manager', 'user')"}},"required":["id","principal","resource_type","resource_id","role"]}}}}}},"get":{"summary":"Get all role bindings for a specific resource","parameters":[{"schema":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"]},"required":true,"name":"resource_type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"resource_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the role binding"},"principal":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}],"description":"Who this role binding applies to (member, group, or organization)"},"resource_type":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"],"description":"Type of resource being accessed"},"resource_id":{"type":"string","description":"ID of the specific resource"},"role":{"type":"string","description":"Role name (e.g., 'viewer', 'editor', 'manager', 'user')"}},"required":["id","principal","resource_type","resource_id","role"]}}}}}}}},"/v1/iam/organization_groups":{"post":{"summary":"Create a new group","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"member_ids":{"type":"array","items":{"type":"string"}}},"required":["name","member_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the organization group"},"name":{"type":"string","description":"Display name of the group"},"description":{"type":"string","description":"Optional description of the group's purpose"},"member_ids":{"type":"array","items":{"type":"string"},"description":"Array of member IDs in this group"},"organization_id":{"type":"string","description":"ID of the organization this group belongs to"},"created_at":{"type":"string","description":"Timestamp when group was created"},"created_by":{"type":"string","description":"Member ID of the user who created this group"}},"required":["id","name","member_ids","organization_id","created_at","created_by"]}}}}}},"get":{"summary":"List all groups in the organization","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the organization group"},"name":{"type":"string","description":"Display name of the group"},"description":{"type":"string","description":"Optional description of the group's purpose"},"member_ids":{"type":"array","items":{"type":"string"},"description":"Array of member IDs in this group"},"organization_id":{"type":"string","description":"ID of the organization this group belongs to"},"created_at":{"type":"string","description":"Timestamp when group was created"},"created_by":{"type":"string","description":"Member ID of the user who created this group"}},"required":["id","name","member_ids","organization_id","created_at","created_by"]}}},"required":["groups"]}}}}}}},"/v1/iam/organization_groups/{group_id}":{"delete":{"summary":"Delete a group","parameters":[{"schema":{"type":"string"},"required":true,"name":"group_id","in":"path"}],"responses":{}},"get":{"summary":"Get a specific group by ID","parameters":[{"schema":{"type":"string"},"required":true,"name":"group_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the organization group"},"name":{"type":"string","description":"Display name of the group"},"description":{"type":"string","description":"Optional description of the group's purpose"},"member_ids":{"type":"array","items":{"type":"string"},"description":"Array of member IDs in this group"},"organization_id":{"type":"string","description":"ID of the organization this group belongs to"},"created_at":{"type":"string","description":"Timestamp when group was created"},"created_by":{"type":"string","description":"Member ID of the user who created this group"}},"required":["id","name","member_ids","organization_id","created_at","created_by"]}}}}}},"put":{"summary":"Update a group","parameters":[{"schema":{"type":"string"},"required":true,"name":"group_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"member_ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the organization group"},"name":{"type":"string","description":"Display name of the group"},"description":{"type":"string","description":"Optional description of the group's purpose"},"member_ids":{"type":"array","items":{"type":"string"},"description":"Array of member IDs in this group"},"organization_id":{"type":"string","description":"ID of the organization this group belongs to"},"created_at":{"type":"string","description":"Timestamp when group was created"},"created_by":{"type":"string","description":"Member ID of the user who created this group"}},"required":["id","name","member_ids","organization_id","created_at","created_by"]}}}}}}},"/v1/iam/me/role_bindings":{"get":{"summary":"Get all role bindings for the current authenticated member","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the role binding"},"principal":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}],"description":"Who this role binding applies to (member, group, or organization)"},"resource_type":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"],"description":"Type of resource being accessed"},"resource_id":{"type":"string","description":"ID of the specific resource"},"role":{"type":"string","description":"Role name (e.g., 'viewer', 'editor', 'manager', 'user')"}},"required":["id","principal","resource_type","resource_id","role"]}}}}}}}},"/v1/iam/my_permissions":{"get":{"summary":"Get all permissions for the current user","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"is_org_admin":{"type":"boolean"},"resources":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["is_org_admin","resources"]}}}}}}},"/v1/iam/resources/{resource_type}/{resource_id}/my_actions":{"get":{"summary":"Get the current user's effective actions for a resource","parameters":[{"schema":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"]},"required":true,"name":"resource_type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"resource_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"actions":{"type":"array","items":{"type":"string"}},"is_org_admin":{"type":"boolean"}},"required":["actions","is_org_admin"]}}}}}}},"/v1/iam/role_bindings/{binding_id}":{"delete":{"summary":"Remove a role binding","parameters":[{"schema":{"type":"string"},"required":true,"name":"binding_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"patch":{"summary":"Update a role binding","parameters":[{"schema":{"type":"string"},"required":true,"name":"binding_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string"}},"required":["role"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the role binding"},"principal":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}],"description":"Who this role binding applies to (member, group, or organization)"},"resource_type":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"],"description":"Type of resource being accessed"},"resource_id":{"type":"string","description":"ID of the specific resource"},"role":{"type":"string","description":"Role name (e.g., 'viewer', 'editor', 'manager', 'user')"}},"required":["id","principal","resource_type","resource_id","role"]}}}}}}},"/v1/iam/tables/{table_id}/sync_linked_access":{"post":{"summary":"Enable or disable auto-grant of editor access on a linked table","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"linked_table_id":{"type":"string"},"enabled":{"type":"boolean"}},"required":["linked_table_id","enabled"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"synced_count":{"type":"number"}},"required":["synced_count"]}}}}}}},"/v1/iam/resources/{resource_type}/{resource_id}/transfer_authorship":{"post":{"summary":"Transfer resource authorship to another member","parameters":[{"schema":{"type":"string","enum":["table","table_view","app","automation","skill","document_template","instruction","knowledge_doc"]},"required":true,"name":"resource_type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"resource_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string"}},"required":["member_id"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/v1/members/{member_id}":{"patch":{"summary":"Update a member's per-organization display name","parameters":[{"schema":{"type":"string"},"required":true,"name":"member_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string","description":"Unique identifier for the member"},"organization_id":{"type":"string","description":"Organization ID the member belongs to"},"name":{"type":"string","description":"Display name of the member"},"email_address":{"type":"string","description":"Email address of the member"},"role":{"type":"string","enum":["owner","admin","member"],"description":"Organization role"},"image":{"type":["string","null"],"description":"URL to the member's profile picture"}},"required":["member_id","organization_id","name","email_address","role"]}}}}}}},"/v1/system_agents/{chat_session_id}/messages/{message_id}/archive":{"post":{"summary":"Archive a chat message","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"message_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}}},"/v1/system_agents/chat_sessions/{chat_session_id}":{"delete":{"summary":"Delete a chat session","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}}}},"get":{"summary":"Get chat session","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Unique identifier for the system agent session"},"workspace_id":{"type":"string","description":"ID of the workspace this session belongs to"},"member_id":{"type":"string","description":"ID of the member who owns this session"},"title":{"type":"string","description":"Title/name for the chat session"},"summarized_text":{"type":"string","description":"Summary of the conversation history"},"last_summarized_at_message_index":{"type":"number","description":"Index of the last message included in the summary"},"created_at":{"type":"string","description":"Timestamp when session was created"}},"required":["id","workspace_id","member_id","title","summarized_text","last_summarized_at_message_index","created_at"]}}}}}}},"/v1/system_agents/chat_sessions":{"get":{"summary":"Get chat sessions","parameters":[{"schema":{"type":"number"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the system agent session"},"workspace_id":{"type":"string","description":"ID of the workspace this session belongs to"},"member_id":{"type":"string","description":"ID of the member who owns this session"},"title":{"type":"string","description":"Title/name for the chat session"},"summarized_text":{"type":"string","description":"Summary of the conversation history"},"last_summarized_at_message_index":{"type":"number","description":"Index of the last message included in the summary"},"created_at":{"type":"string","description":"Timestamp when session was created"}},"required":["id","workspace_id","member_id","title","summarized_text","last_summarized_at_message_index","created_at"]}}}}}}}},"/v1/system_agents/{chat_session_id}/messages":{"get":{"summary":"Get messages for a chat session","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{}}}}}}},"post":{"summary":"Generate agent message","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{},"web_search_enabled":{"type":"boolean"},"enabled_connectors":{"type":"array","items":{"type":"string"}},"model_id":{"type":"string","enum":["claude-haiku-4-5","claude-sonnet-4-6"]},"thinking_enabled":{"type":"boolean"},"effort_level":{"type":"string","enum":["low","medium","high","max"]}}}}}},"responses":{}}},"/v1/system_agents/{chat_session_id}/messages/save":{"post":{"summary":"Save messages without LLM generation","parameters":[{"schema":{"type":"string"},"required":true,"name":"chat_session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/auth/facebook":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"chat_session_id","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"type":"string"}},"required":["redirect_url"]}}}}}}},"/auth/google":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"chat_session_id","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"type":"string"}},"required":["redirect_url"]}}}}}}},"/auth/outlook":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"chat_session_id","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"type":"string"}},"required":["redirect_url"]}}}}}}},"/auth/zalo":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"chat_session_id","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"type":"string","format":"uri"}},"required":["redirect_url"]}}}}}}},"/v1/connected_accounts":{"post":{"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["wininvoice"]},"name":{"type":"string"},"scheme":{"type":"string","enum":["basic"]},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"]}},"required":["provider","scheme","credentials"]},{"type":"object","properties":{"provider":{"type":"string","enum":["payos"]},"name":{"type":"string"},"scheme":{"type":"string","enum":["basic"]},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"]}},"required":["provider","scheme","credentials"]}]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["wininvoice"],"description":"WinInvoice provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"],"description":"WinInvoice API credentials"},"scheme":{"type":"string","enum":["basic"],"description":"Basic authentication scheme"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials","scheme"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["outlook"],"description":"Outlook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Outlook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Outlook"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["gmail"],"description":"Gmail provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Gmail provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Gmail"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["facebook"],"description":"Facebook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Facebook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"id":{"type":"string","description":"Facebook user ID"},"name":{"type":"string","description":"User's display name on Facebook"},"email":{"type":"string","description":"User's email address (if available)"},"picture":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"URL to the profile picture"},"width":{"type":"number","description":"Width of the profile picture in pixels"},"height":{"type":"number","description":"Height of the profile picture in pixels"}},"required":["url","width","height"]}},"required":["data"],"description":"User's profile picture information"}},"required":["id","name"],"description":"User profile data from Facebook"},"resources":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Facebook Page ID"},"name":{"type":"string","description":"Name of the Facebook Page"},"access_token":{"type":"string","description":"Access token for the Facebook Page"},"category":{"type":"string","description":"Primary category of the Facebook Page"},"category_list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Category ID"},"name":{"type":"string","description":"Category name"}},"required":["id","name"]},"description":"List of categories assigned to the Facebook Page"},"tasks":{"type":"array","items":{"type":"string"},"description":"List of tasks/permissions available for this page"}},"required":["id","name","access_token","category","category_list","tasks"]},"description":"Facebook Pages managed by this account"}},"required":["pages"],"description":"Resources (pages) available through this connection"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile","resources"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["zalo"],"description":"Zalo provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Zalo provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"oa_id":{"type":["number","null"],"description":"Zalo Official Account ID"},"name":{"type":"string","description":"Name of the Zalo Official Account"},"description":{"type":"string","description":"Description of the Zalo Official Account"},"oa_alias":{"type":["string","null"],"description":"Alias/username for the Official Account"},"is_verified":{"type":"boolean","description":"Whether the Official Account is verified by Zalo"},"oa_type":{"type":"number","description":"Type code for the Official Account"},"cate_name":{"type":"string","description":"Category name of the Official Account"},"num_follower":{"type":"number","description":"Number of followers"},"avatar":{"type":"string","description":"URL to the account avatar image"},"cover":{"type":"string","description":"URL to the account cover image"},"package_name":{"type":"string","description":"Name of the subscription package"},"package_valid_through_date":{"type":"string","description":"Expiration date of the subscription package"},"package_auto_renew_date":{"type":"string","description":"Auto-renewal date for the subscription"},"linked_zca":{"type":"string","description":"Linked Zalo Cloud Account identifier"}},"required":["oa_id","name","description","is_verified","oa_type","cate_name","num_follower","avatar","cover"],"description":"Official Account profile data from Zalo"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["payos"],"description":"PayOS provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"],"description":"PayOS API credentials"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials"]}]}}}}}},"get":{"parameters":[{"schema":{"type":"array","items":{"type":"string"}},"required":false,"name":"providers","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["wininvoice"],"description":"WinInvoice provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"],"description":"WinInvoice API credentials"},"scheme":{"type":"string","enum":["basic"],"description":"Basic authentication scheme"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials","scheme"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["outlook"],"description":"Outlook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Outlook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Outlook"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["gmail"],"description":"Gmail provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Gmail provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Gmail"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["facebook"],"description":"Facebook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Facebook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"id":{"type":"string","description":"Facebook user ID"},"name":{"type":"string","description":"User's display name on Facebook"},"email":{"type":"string","description":"User's email address (if available)"},"picture":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"URL to the profile picture"},"width":{"type":"number","description":"Width of the profile picture in pixels"},"height":{"type":"number","description":"Height of the profile picture in pixels"}},"required":["url","width","height"]}},"required":["data"],"description":"User's profile picture information"}},"required":["id","name"],"description":"User profile data from Facebook"},"resources":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Facebook Page ID"},"name":{"type":"string","description":"Name of the Facebook Page"},"access_token":{"type":"string","description":"Access token for the Facebook Page"},"category":{"type":"string","description":"Primary category of the Facebook Page"},"category_list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Category ID"},"name":{"type":"string","description":"Category name"}},"required":["id","name"]},"description":"List of categories assigned to the Facebook Page"},"tasks":{"type":"array","items":{"type":"string"},"description":"List of tasks/permissions available for this page"}},"required":["id","name","access_token","category","category_list","tasks"]},"description":"Facebook Pages managed by this account"}},"required":["pages"],"description":"Resources (pages) available through this connection"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile","resources"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["zalo"],"description":"Zalo provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Zalo provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"oa_id":{"type":["number","null"],"description":"Zalo Official Account ID"},"name":{"type":"string","description":"Name of the Zalo Official Account"},"description":{"type":"string","description":"Description of the Zalo Official Account"},"oa_alias":{"type":["string","null"],"description":"Alias/username for the Official Account"},"is_verified":{"type":"boolean","description":"Whether the Official Account is verified by Zalo"},"oa_type":{"type":"number","description":"Type code for the Official Account"},"cate_name":{"type":"string","description":"Category name of the Official Account"},"num_follower":{"type":"number","description":"Number of followers"},"avatar":{"type":"string","description":"URL to the account avatar image"},"cover":{"type":"string","description":"URL to the account cover image"},"package_name":{"type":"string","description":"Name of the subscription package"},"package_valid_through_date":{"type":"string","description":"Expiration date of the subscription package"},"package_auto_renew_date":{"type":"string","description":"Auto-renewal date for the subscription"},"linked_zca":{"type":"string","description":"Linked Zalo Cloud Account identifier"}},"required":["oa_id","name","description","is_verified","oa_type","cate_name","num_follower","avatar","cover"],"description":"Official Account profile data from Zalo"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["payos"],"description":"PayOS provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"],"description":"PayOS API credentials"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials"]}]}}}}}}}},"/v1/connected_accounts/{connected_account_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"connected_account_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"connected_account_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["wininvoice"],"description":"WinInvoice provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"],"description":"WinInvoice API credentials"},"scheme":{"type":"string","enum":["basic"],"description":"Basic authentication scheme"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials","scheme"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["outlook"],"description":"Outlook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Outlook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Outlook"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["gmail"],"description":"Gmail provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Gmail provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Gmail"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["facebook"],"description":"Facebook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Facebook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"id":{"type":"string","description":"Facebook user ID"},"name":{"type":"string","description":"User's display name on Facebook"},"email":{"type":"string","description":"User's email address (if available)"},"picture":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"URL to the profile picture"},"width":{"type":"number","description":"Width of the profile picture in pixels"},"height":{"type":"number","description":"Height of the profile picture in pixels"}},"required":["url","width","height"]}},"required":["data"],"description":"User's profile picture information"}},"required":["id","name"],"description":"User profile data from Facebook"},"resources":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Facebook Page ID"},"name":{"type":"string","description":"Name of the Facebook Page"},"access_token":{"type":"string","description":"Access token for the Facebook Page"},"category":{"type":"string","description":"Primary category of the Facebook Page"},"category_list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Category ID"},"name":{"type":"string","description":"Category name"}},"required":["id","name"]},"description":"List of categories assigned to the Facebook Page"},"tasks":{"type":"array","items":{"type":"string"},"description":"List of tasks/permissions available for this page"}},"required":["id","name","access_token","category","category_list","tasks"]},"description":"Facebook Pages managed by this account"}},"required":["pages"],"description":"Resources (pages) available through this connection"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile","resources"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["zalo"],"description":"Zalo provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Zalo provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"oa_id":{"type":["number","null"],"description":"Zalo Official Account ID"},"name":{"type":"string","description":"Name of the Zalo Official Account"},"description":{"type":"string","description":"Description of the Zalo Official Account"},"oa_alias":{"type":["string","null"],"description":"Alias/username for the Official Account"},"is_verified":{"type":"boolean","description":"Whether the Official Account is verified by Zalo"},"oa_type":{"type":"number","description":"Type code for the Official Account"},"cate_name":{"type":"string","description":"Category name of the Official Account"},"num_follower":{"type":"number","description":"Number of followers"},"avatar":{"type":"string","description":"URL to the account avatar image"},"cover":{"type":"string","description":"URL to the account cover image"},"package_name":{"type":"string","description":"Name of the subscription package"},"package_valid_through_date":{"type":"string","description":"Expiration date of the subscription package"},"package_auto_renew_date":{"type":"string","description":"Auto-renewal date for the subscription"},"linked_zca":{"type":"string","description":"Linked Zalo Cloud Account identifier"}},"required":["oa_id","name","description","is_verified","oa_type","cate_name","num_follower","avatar","cover"],"description":"Official Account profile data from Zalo"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["payos"],"description":"PayOS provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"],"description":"PayOS API credentials"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials"]}]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"connected_account_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"name":{"type":"string"},"provider":{"type":"string","enum":["wininvoice"]},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"]}},"required":["provider","credentials"]},{"type":"object","properties":{"name":{"type":"string"},"provider":{"type":"string","enum":["payos"]},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"]}},"required":["provider","credentials"]}]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["wininvoice"],"description":"WinInvoice provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"WinInvoice client ID"},"client_secret":{"type":"string","description":"WinInvoice client secret"}},"required":["client_id","client_secret"],"description":"WinInvoice API credentials"},"scheme":{"type":"string","enum":["basic"],"description":"Basic authentication scheme"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials","scheme"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["outlook"],"description":"Outlook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Outlook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Outlook"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["gmail"],"description":"Gmail provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Gmail provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"description":"User profile data from Gmail"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["facebook"],"description":"Facebook provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Facebook provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"id":{"type":"string","description":"Facebook user ID"},"name":{"type":"string","description":"User's display name on Facebook"},"email":{"type":"string","description":"User's email address (if available)"},"picture":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","description":"URL to the profile picture"},"width":{"type":"number","description":"Width of the profile picture in pixels"},"height":{"type":"number","description":"Height of the profile picture in pixels"}},"required":["url","width","height"]}},"required":["data"],"description":"User's profile picture information"}},"required":["id","name"],"description":"User profile data from Facebook"},"resources":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Facebook Page ID"},"name":{"type":"string","description":"Name of the Facebook Page"},"access_token":{"type":"string","description":"Access token for the Facebook Page"},"category":{"type":"string","description":"Primary category of the Facebook Page"},"category_list":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Category ID"},"name":{"type":"string","description":"Category name"}},"required":["id","name"]},"description":"List of categories assigned to the Facebook Page"},"tasks":{"type":"array","items":{"type":"string"},"description":"List of tasks/permissions available for this page"}},"required":["id","name","access_token","category","category_list","tasks"]},"description":"Facebook Pages managed by this account"}},"required":["pages"],"description":"Resources (pages) available through this connection"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile","resources"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["zalo"],"description":"Zalo provider identifier"},"provider_user_id":{"type":"string","description":"User ID from the Zalo provider"},"scheme":{"type":"string","enum":["oauth2"],"description":"OAuth 2.0 authentication scheme"},"scopes":{"type":"array","items":{"type":"string"},"description":"OAuth scopes granted for this account"},"profile":{"type":"object","properties":{"oa_id":{"type":["number","null"],"description":"Zalo Official Account ID"},"name":{"type":"string","description":"Name of the Zalo Official Account"},"description":{"type":"string","description":"Description of the Zalo Official Account"},"oa_alias":{"type":["string","null"],"description":"Alias/username for the Official Account"},"is_verified":{"type":"boolean","description":"Whether the Official Account is verified by Zalo"},"oa_type":{"type":"number","description":"Type code for the Official Account"},"cate_name":{"type":"string","description":"Category name of the Official Account"},"num_follower":{"type":"number","description":"Number of followers"},"avatar":{"type":"string","description":"URL to the account avatar image"},"cover":{"type":"string","description":"URL to the account cover image"},"package_name":{"type":"string","description":"Name of the subscription package"},"package_valid_through_date":{"type":"string","description":"Expiration date of the subscription package"},"package_auto_renew_date":{"type":"string","description":"Auto-renewal date for the subscription"},"linked_zca":{"type":"string","description":"Linked Zalo Cloud Account identifier"}},"required":["oa_id","name","description","is_verified","oa_type","cate_name","num_follower","avatar","cover"],"description":"Official Account profile data from Zalo"}},"required":["id","name","member_id","created_at","workspace_id","provider","provider_user_id","scheme","scopes","profile"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the connected account"},"name":{"type":"string","description":"Display name for this connected account"},"member_id":{"type":"string","description":"ID of the member who created this account"},"created_at":{"type":"string","description":"Timestamp when account was connected"},"workspace_id":{"type":"string","description":"ID of the workspace this account belongs to"},"provider":{"type":"string","enum":["payos"],"description":"PayOS provider identifier"},"credentials":{"type":"object","properties":{"client_id":{"type":"string","description":"PayOS client ID"},"api_key":{"type":"string","description":"PayOS API key"},"checksum_key":{"type":"string","description":"PayOS checksum key for signature verification"}},"required":["client_id","api_key","checksum_key"],"description":"PayOS API credentials"}},"required":["id","name","member_id","created_at","workspace_id","provider","credentials"]}]}}}}}}},"/v1/tables/{table_id}/clone":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"include_data":{"type":"boolean"},"include_views":{"type":"boolean"}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}}},"/v1/views/{view_id}/clone":{"post":{"summary":"Clone a view","parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}}},"/v1/tables/{table_id}/draft_records":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["data"]}}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/records/comments":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"record_id":{"type":"string"},"content":{"type":"string"},"file_ids":{"type":"array","items":{"type":"string"}}},"required":["record_id","content"]}}},"required":["comments"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the comment"},"record_id":{"type":"string","description":"ID of the record this comment belongs to"},"table_id":{"type":"string","description":"ID of the table this comment belongs to"},"member_id":{"type":"string","description":"ID of the member who created this comment"},"content":{"type":"string","minLength":0,"maxLength":10000,"description":"Comment text content (0-10,000 characters)"},"files":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]},"description":"Array of files attached to this comment"},"workspace_id":{"type":"string","description":"ID of the workspace this comment belongs to"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when comment was created"}},"required":["id","record_id","table_id","member_id","content","workspace_id","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/record_data_templates":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["name","description","data"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record data template"},"name":{"type":"string","description":"Display name of the record data template"},"description":{"type":"string","description":"Description of the record data template"},"table_id":{"type":"string","description":"ID of the table this record template belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record template. The key is the Field key."}},"required":["id","name","description","table_id","data"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record data template"},"name":{"type":"string","description":"Display name of the record data template"},"description":{"type":"string","description":"Description of the record data template"},"table_id":{"type":"string","description":"ID of the table this record template belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record template. The key is the Field key."}},"required":["id","name","description","table_id","data"]}}}}}}}},"/v1/tables":{"post":{"summary":"Create a new table with fields. Formula, rollup, and lookup fields are computed and read-only in records.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]}},"position":{"type":"integer"}},"required":["name","fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}},"get":{"summary":"List all tables in the workspace with their field schemas.","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}}}},"/v1/tables/{table_id}/fields":{"post":{"summary":"Add a new field to a table. Call get_api_docs({ topics: [\"schema_management\"] }) for field type reference.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"]},"table_id":{"type":"string","description":"Linked table ID"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display from linked table. If omitted, auto-selects the first text field."},"view_id":{"type":["string","null"],"description":"Filter by view"},"sync_both_ways":{"type":"boolean","description":"Enable bidirectional link sync. If the target table has exactly one existing unpaired link field pointing back, pairs with it instead of creating a new field."},"paired_field_display_field_keys":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Display fields for paired link"}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"add_to_views":{"type":"array","items":{"type":"string"},"description":"View IDs where the new field should be visible. Fields are hidden in all views by default."}},"required":["field"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]}}}}}}},"/v1/tables/{table_id}/records":{"post":{"summary":"Create records. Only include writable fields — skip formula, rollup, lookup, and button fields.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{},"description":"Record data keyed by field key."}},"required":["data"]},"maxItems":100}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}}}},"delete":{"summary":"Soft-delete (archive) records by IDs. Can be restored later.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"},"description":"Array of record IDs to soft-delete."}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"deleted":{"type":"boolean"}},"required":["ids","deleted"]}}}}}},"patch":{"summary":"Update records. Send only changed fields — omitted fields are unchanged. Skip computed fields (formula, rollup, lookup).","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{},"description":"Partial record data — only included fields are changed."}},"required":["id","data"]},"maxItems":100},"bypass_locked_fields":{"type":"boolean","description":"Admin-only: bypass locked field protection."}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}}}}},"/v1/tables/{table_id}/views":{"post":{"summary":"Create a saved view with filters, sorting, and field visibility.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"frozen_columns":{"type":"integer"},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]}},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"filters":{},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]}},"position":{"type":"integer"}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}}},"/v1/records/{record_id}/comments/{comment_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"comment_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"comment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":10000},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"file_storage_key":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"}},"required":["id","file_storage_key","filename","mime_type"]}}},"required":["content"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the comment"},"record_id":{"type":"string","description":"ID of the record this comment belongs to"},"table_id":{"type":"string","description":"ID of the table this comment belongs to"},"member_id":{"type":"string","description":"ID of the member who created this comment"},"content":{"type":"string","minLength":0,"maxLength":10000,"description":"Comment text content (0-10,000 characters)"},"files":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]},"description":"Array of files attached to this comment"},"workspace_id":{"type":"string","description":"ID of the workspace this comment belongs to"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when comment was created"}},"required":["id","record_id","table_id","member_id","content","workspace_id","updated_at","created_at"]}}}}}}},"/v1/record_data_templates/{record_data_template_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_data_template_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_data_template_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record data template"},"name":{"type":"string","description":"Display name of the record data template"},"description":{"type":"string","description":"Description of the record data template"},"table_id":{"type":"string","description":"ID of the table this record template belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record template. The key is the Field key."}},"required":["id","name","description","table_id","data"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_data_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"data":{"type":"object","additionalProperties":{}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record data template"},"name":{"type":"string","description":"Display name of the record data template"},"description":{"type":"string","description":"Description of the record data template"},"table_id":{"type":"string","description":"ID of the table this record template belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record template. The key is the Field key."}},"required":["id","name","description","table_id","data"]}}}}}}},"/v1/tables/{table_id}":{"delete":{"summary":"Permanently delete a table and all its records. Cannot be undone.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}}}},"get":{"summary":"Get a table's full schema including field definitions. Call this first to learn field keys and types before reading or writing records.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}},"patch":{"summary":"Update a table's name, fields, or configuration.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]}},"position":{"type":"integer"},"private_filters":{},"field_private_filters":{"type":["object","null"],"additionalProperties":{}},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]}},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}}},"/v1/tables/{table_id}/fields/{field_key}":{"delete":{"summary":"Delete a field. Use force=true to cascade-delete dependent formula/rollup/lookup fields.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"field_key","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"If true, deletes the field even if it has breaking dependencies (formula, rollup, lookup references). Those dependent fields will also be deleted."},"required":false,"description":"If true, deletes the field even if it has breaking dependencies (formula, rollup, lookup references). Those dependent fields will also be deleted.","name":"force","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"field_key":{"type":"string"},"cleaned_up":{"type":"object","properties":{"views":{"type":"number","description":"Number of views updated"},"fields":{"type":"number","description":"Number of dependent fields deleted"},"records":{"type":"number","description":"Number of records with field data cleaned"}},"required":["views","fields","records"],"description":"Cleanup statistics"}},"required":["deleted","field_key"]}}}}}},"patch":{"summary":"Update a field's name, type, or options (e.g. add select options). The field_key param identifies which field.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"field_key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"]},"table_id":{"type":"string","description":"Linked table ID"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display from linked table. If omitted, auto-selects the first text field."},"view_id":{"type":["string","null"],"description":"Filter by view"},"sync_both_ways":{"type":"boolean","description":"Enable bidirectional link sync. If the target table has exactly one existing unpaired link field pointing back, pairs with it instead of creating a new field."},"paired_field_display_field_keys":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Display fields for paired link"}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]}},"required":["field"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]}}}}}}},"/v1/tables/{table_id}/views/{view_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]}},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"default_record_data_template_id":{"type":["string","null"]},"filters":{},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]}},"position":{"type":["integer","null"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}}},"/v1/views/{view_id}":{"delete":{"summary":"Permanently delete a view.","parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"get":{"summary":"Get a view's full configuration.","parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}},"patch":{"summary":"Update a view's name, filters, sorting, or field visibility. Send only changed properties.","parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]}},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"default_record_data_template_id":{"type":["string","null"]},"filters":{},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]}},"position":{"type":["integer","null"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"},"view":{"type":"object","properties":{"type":{"type":"string","enum":["grid"]},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"number"}}}},"frozen_columns":{"type":["integer","null"]},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."}},"required":["type","fields"]}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}}},"/v1/views/{view_id}/export_csv":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":["string","null"]},"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"filename":{"type":"string"}},"required":["file_id","filename"]}}}}}}},"/table/{table_id}/export_excel":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":["string","null"]},"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"field_keys":{"type":"array","items":{"type":"string"},"minItems":1},"export_name":{"type":["string","null"]}},"required":["field_keys"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"}},"required":["url","filename"]}}}}}}},"/v1/views/{view_id}/export_xlsx":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":["string","null"]},"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"}},"required":["url","filename"]}}}}}}},"/v1/tables/{table_id}/records/find_position":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_id":{"type":"string"},"view_id":{"type":"string"},"search":{"type":["string","null"]}},"required":["record_id","view_id"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"position":{"type":["integer","null"],"minimum":0}},"required":["position"]}}}}}}},"/v1/tables/{table_id}/fields/{field_key}/workflow":{"get":{"summary":"Get workflow linked to button field","parameters":[{"schema":{"type":"string","description":"Table containing the button field"},"required":true,"description":"Table containing the button field","name":"table_id","in":"path"},{"schema":{"type":"string","description":"Field key of the button field"},"required":true,"description":"Field key of the button field","name":"field_key","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}}}}}}},"/v1/explorer":{"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":["integer","null"]},"views":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"author_member_id":{"type":"string"}},"required":["id","name","author_member_id"]}},"author_member_id":{"type":"string"}},"required":["id","name","views","author_member_id"]}}}}}}}},"/v1/tables/{table_id}/fields/{field_key}/dependencies":{"get":{"summary":"Get field dependencies","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"field_key","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"field_key":{"type":"string","description":"Key of the field being analyzed"},"field_name":{"type":"string","description":"Name of the field being analyzed"},"table_id":{"type":"string","description":"ID of the table containing the field"},"dependencies":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["view_filter","view_private_filter","view_sort","view_summary","view_field_config","table_colors","formula_reference","rollup_source","lookup_source","lookup_target","link_display","app_component","app_data_source","record_locked_field"],"description":"Type of dependency"},"entity_type":{"type":"string","enum":["view","field","app","record","table"],"description":"Type of entity that has the dependency"},"entity_id":{"type":"string","description":"ID of the dependent entity"},"entity_name":{"type":"string","description":"Name of the dependent entity"},"details":{"type":"string","description":"Additional details about the dependency"}},"required":["type","entity_type","entity_id","entity_name"]},"description":"All dependencies found"},"can_auto_cleanup":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["view_filter","view_private_filter","view_sort","view_summary","view_field_config","table_colors","formula_reference","rollup_source","lookup_source","lookup_target","link_display","app_component","app_data_source","record_locked_field"],"description":"Type of dependency"},"entity_type":{"type":"string","enum":["view","field","app","record","table"],"description":"Type of entity that has the dependency"},"entity_id":{"type":"string","description":"ID of the dependent entity"},"entity_name":{"type":"string","description":"Name of the dependent entity"},"details":{"type":"string","description":"Additional details about the dependency"}},"required":["type","entity_type","entity_id","entity_name"]},"description":"Dependencies that can be automatically cleaned up"},"will_break":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["view_filter","view_private_filter","view_sort","view_summary","view_field_config","table_colors","formula_reference","rollup_source","lookup_source","lookup_target","link_display","app_component","app_data_source","record_locked_field"],"description":"Type of dependency"},"entity_type":{"type":"string","enum":["view","field","app","record","table"],"description":"Type of entity that has the dependency"},"entity_id":{"type":"string","description":"ID of the dependent entity"},"entity_name":{"type":"string","description":"Name of the dependent entity"},"details":{"type":"string","description":"Additional details about the dependency"}},"required":["type","entity_type","entity_id","entity_name"]},"description":"Dependencies that will cause errors after deletion"},"requires_manual_action":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["view_filter","view_private_filter","view_sort","view_summary","view_field_config","table_colors","formula_reference","rollup_source","lookup_source","lookup_target","link_display","app_component","app_data_source","record_locked_field"],"description":"Type of dependency"},"entity_type":{"type":"string","enum":["view","field","app","record","table"],"description":"Type of entity that has the dependency"},"entity_id":{"type":"string","description":"ID of the dependent entity"},"entity_name":{"type":"string","description":"Name of the dependent entity"},"details":{"type":"string","description":"Additional details about the dependency"}},"required":["type","entity_type","entity_id","entity_name"]},"description":"Dependencies that may require user attention"}},"required":["field_key","field_name","table_id","dependencies","can_auto_cleanup","will_break","requires_manual_action"]}}}}}}},"/v1/records/{record_id}/comments":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the comment"},"record_id":{"type":"string","description":"ID of the record this comment belongs to"},"table_id":{"type":"string","description":"ID of the table this comment belongs to"},"member_id":{"type":"string","description":"ID of the member who created this comment"},"content":{"type":"string","minLength":0,"maxLength":10000,"description":"Comment text content (0-10,000 characters)"},"files":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]},"description":"Array of files attached to this comment"},"workspace_id":{"type":"string","description":"ID of the workspace this comment belongs to"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when comment was created"}},"required":["id","record_id","table_id","member_id","content","workspace_id","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/comments":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the comment"},"record_id":{"type":"string","description":"ID of the record this comment belongs to"},"table_id":{"type":"string","description":"ID of the table this comment belongs to"},"member_id":{"type":"string","description":"ID of the member who created this comment"},"content":{"type":"string","minLength":0,"maxLength":10000,"description":"Comment text content (0-10,000 characters)"},"files":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]},"description":"Array of files attached to this comment"},"workspace_id":{"type":"string","description":"ID of the workspace this comment belongs to"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when comment was created"}},"required":["id","record_id","table_id","member_id","content","workspace_id","updated_at","created_at"]}}}}}}}},"/v1/records/{record_id}":{"get":{"summary":"Get a single record by ID.","parameters":[{"schema":{"type":"string"},"required":true,"name":"record_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}},"/v1/records/{record_id}/logs":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"record_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":["string","null"]},"action":{"type":"string","enum":["record.create","record.update","record.delete","record.restore","record.lock","record.unlock","table.create","table.update","table.archive","field.create","field.update","field.delete","view.create","view.update","view.archive","iam.role_binding.assign","iam.role_binding.update","iam.role_binding.remove","iam.authorship.transfer","iam.group.create","iam.group.update","iam.group.delete","app.create","app.update","app.archive","skill.create","skill.update","skill.archive","automation.create","automation.update","automation.archive","document_template.create","document_template.update","document_template.archive","instruction.create","instruction.update","instruction.archive","instruction.restore","knowledge_doc.create","knowledge_doc.update","knowledge_doc.archive","knowledge_doc.restore"]},"actor_type":{"type":"string","enum":["member","api_key","system"]},"actor_id":{"type":"string"},"resource_type":{"type":"string","enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc"]},"resource_id":{"type":"string"},"parent_resource_type":{"type":["string","null"],"enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc",null]},"parent_resource_id":{"type":["string","null"]},"change_origin":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Change originated from a member"},"member_id":{"type":"string","description":"Member ID of the user who modified"},"member_session_id":{"type":"string","description":"Session ID of the member at the time of modification"},"app_id":{"type":"string","description":"ID of the app through which the member acted"}},"required":["type","member_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["chat_agent"],"description":"Change originated from chat agent"},"on_behalf_member_id":{"type":"string","description":"ID of the member on whose behalf the chat agent acted"},"tool_call_id":{"type":"string","description":"ID of the tool call that the chat agent performed"}},"required":["type","on_behalf_member_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["button"],"description":"Change originated from a button click"},"table_id":{"type":"string","description":"ID of the table containing the button"},"record_id":{"type":"string","description":"ID of the record where the button was clicked"},"field_key":{"type":"string","description":"Key of the button field"},"clicked_by":{"type":"string","description":"ID of the member who clicked the button"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","table_id","record_id","field_key","clicked_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["submit_record"],"description":"Change originated from a draft record submission"},"table_id":{"type":"string","description":"ID of the table containing the record"},"record_id":{"type":"string","description":"ID of the record being submitted"},"submitted_by":{"type":"string","description":"ID of the member who submitted"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","table_id","record_id","submitted_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["app_action"],"description":"Change originated from an app action"},"app_id":{"type":"string","description":"ID of the app containing the action"},"action_id":{"type":"string","description":"ID of the action that was triggered"},"triggered_by":{"type":"string","description":"ID of the member who triggered the action"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","app_id","action_id","triggered_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["automation"],"description":"Change originated from an automation (trigger + workflow)"},"trigger_type":{"type":"string","description":"Type of the trigger that initiated this automation"},"trigger_id":{"type":"string","description":"ID of the trigger that initiated this automation"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"},"automation_id":{"type":"string","description":"[Legacy] Use trigger_id instead"},"automation_execution_id":{"type":"string","description":"[Legacy] Use workflow_execution_id instead"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["system"],"description":"Change originated from system (Human system administrator/engineer)"},"author":{"type":"string","description":"Name of the system administrator/engineer"}},"required":["type","author"]},{"type":"object","properties":{"type":{"type":"string","enum":["validation"],"description":"Change originated from a record validation execution"},"table_id":{"type":"string","description":"ID of the table being validated"},"validation_id":{"type":"string","description":"ID of the validation that executed"}},"required":["type","table_id","validation_id"]},{"type":"null"}]},"details":{"type":["object","null"],"additionalProperties":{}},"ip_address":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"request_id":{"type":["string","null"]},"session_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","organization_id","workspace_id","action","actor_type","actor_id","resource_type","resource_id","parent_resource_type","parent_resource_id","change_origin","details","ip_address","user_agent","request_id","session_id","created_at"]}}}}}}}},"/v1/tables/{table_id}/records/by_ids":{"post":{"summary":"Get multiple records by IDs in one request.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"},"description":"Array of record IDs to fetch."},"include_drafts":{"type":"boolean","description":"Include draft records in results."}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}},"required":["records"]}}}}}}},"/v1/tables/{table_id}/views/{view_id}/summary":{"post":{"summary":"Get view summary","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"view_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","additionalProperties":{"type":"object","properties":{"operation":{"type":"string"},"field_key":{"type":"string"}},"required":["operation","field_key"]}},"filters":{},"search":{"type":["string","null"]}},"required":["summary"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"object","additionalProperties":{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"string"}]}},"required":["value"]}}},"required":["results"]}}}}}}},"/v1/tables/{table_id}/records/lock":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/records/{record_id}/buttons/{field_key}/press":{"post":{"parameters":[{"schema":{"type":"string","description":"Table containing the button field"},"required":true,"description":"Table containing the button field","name":"table_id","in":"path"},{"schema":{"type":"string","description":"Record to press the button on"},"required":true,"description":"Record to press the button on","name":"record_id","in":"path"},{"schema":{"type":"string","description":"Field key of the button field"},"required":true,"description":"Field key of the button field","name":"field_key","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"execution_id":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]}},"status":{"type":"string","enum":["success","error"]},"message":{"type":"string"}}}}}}}}},"/v1/tables/{table_id}/draft_records/publish":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/records/query":{"post":{"summary":"Query records with filters, sorting, search, and pagination. Use field_keys to select specific fields. Set limit=0 for count only.","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"search":{"type":["string","null"]},"field_keys":{"type":"array","items":{"type":"string"},"description":"Return only these fields in record data. Omit to return all fields."},"limit":{"type":["number","null"],"minimum":0,"maximum":200,"description":"Max records to return (0-200). Set 0 for count only."},"offset":{"type":["number","null"],"minimum":0,"description":"Number of records to skip for pagination."}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}},"total":{"type":"number"}},"required":["records","total"]}}}}}}},"/v1/tables/reorder":{"post":{"summary":"Reorder tables","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"Ordered array of table IDs defining the new order"}},"required":["table_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the table"},"workspace_id":{"type":"string","description":"ID of the workspace this table belongs to"},"name":{"type":"string","description":"Display name of the table"},"description":{"type":"string","description":"Description of the table's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the table. Lower numbers are shown first. "},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Array of field definitions for this table"},"validations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique validation ID (val_ prefix)"},"name":{"type":"string","description":"Human-readable name"},"description":{"type":"string","description":"Description of what this validation checks"},"enabled":{"type":"boolean","description":"Whether this validation is active"},"steps":{"type":"array","items":{},"description":"Workflow steps (readonly tools only, no waits)"},"created_at":{"type":"string","description":"When the validation was created"},"updated_at":{"type":"string","description":"When the validation was last modified"}},"required":["id","name","description","enabled","steps","created_at","updated_at"]},"description":"Inline validation rules that run before record creates, updates, and submissions"},"private_filters":{"description":"Row-level private filters AND'd to every query as a security boundary (admin bypass)"},"field_private_filters":{"type":["object","null"],"additionalProperties":{},"description":"Field-level private filters: per field key, restricts which records expose that field's value. Fields are nulled out on records that don't pass the filter."},"linked_access_grant_table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of linked tables with auto-grant enabled for sharing"},"colors":{"type":["array","null"],"items":{"type":"object","properties":{"filters":{"description":"The filter conditions that determine when this color rule applies. Null means no filtering."},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"],"description":"The color to apply to records matching the filters."}},"required":["color"]},"description":"Color rules for styling records based on filter conditions"},"created_at":{"type":"string","description":"Timestamp when table was created"}},"required":["id","workspace_id","name","description","fields","created_at"]}}}}}}}},"/v1/tables/{table_id}/views/reorder":{"post":{"summary":"Reorder views","parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_ids":{"type":"array","items":{"type":"string"},"description":"Ordered array of view IDs defining the new order"}},"required":["view_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the view"},"table_id":{"type":"string","description":"ID of the table this view displays"},"workspace_id":{"type":"string","description":"ID of the workspace this view belongs to"},"name":{"type":"string","description":"Display name of the view"},"description":{"type":"string","description":"Description of the view's purpose"},"position":{"type":["integer","null"],"description":"Display ordering index for the view. Lower numbers are shown first. Use incremental values with gaps (100, 200, 300) instead of consecutive numbers (1, 2, 3) to enable efficient reordering without updating multiple records. Example: To insert between 100 and 200, use 150."},"frozen_columns":{"type":["integer","null"],"description":"Number of columns to freeze. Frozen columns are not scrollable."},"summary":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"operation":{"type":"string","description":"Operation to perform on the field"},"field_key":{"type":"string","description":"Field key to display in the summary row"}},"required":["operation","field_key"]},"description":"Map of field keys to summary operations."},"default_record_data_template_id":{"type":["string","null"],"description":"ID of the record template to use as the default record initial data"},"field_config":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Field key"},"visibility":{"type":"string","enum":["visible","hidden"],"description":"Field visibility state: 'visible' = shown to everyone, 'hidden' = not shown by default but members can toggle"},"width":{"type":"number"}},"required":["key","visibility"]},"description":"Ordered array of field config entries. Order = display order, visibility = per-entry. Fields not listed are hidden."},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sorting configuration for records in this view"},"filters":{"description":"Filter conditions applied to records in this view"},"created_at":{"type":"string","description":"Timestamp when view was created"}},"required":["id","table_id","workspace_id","name","description","position","field_config","sort","created_at"]}}}}}}}},"/v1/tables/{table_id}/records/restore":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/tables/{table_id}/draft_records/submit":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}},"status":{"type":"string","enum":["success","error"]},"message":{"type":"string"}},"required":["records"]}}}}}}},"/v1/tables/{table_id}/records/unlock":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/workspace":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"timezone":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"name":{"type":"string","description":"Display name of the workspace"},"default_currency":{"type":"string","description":"Default currency code for the workspace"},"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Asia/Tokyo')"},"organization_id":{"type":"string","description":"Organization ID this workspace belongs to"},"created_at":{"type":"string","description":"Timestamp when workspace was created"}},"required":["id","name","default_currency","timezone","organization_id","created_at"]}}}}}},"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"name":{"type":"string","description":"Display name of the workspace"},"default_currency":{"type":"string","description":"Default currency code for the workspace"},"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Asia/Tokyo')"},"organization_id":{"type":"string","description":"Organization ID this workspace belongs to"},"created_at":{"type":"string","description":"Timestamp when workspace was created"}},"required":["id","name","default_currency","timezone","organization_id","created_at"]}}}}}},"delete":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}}}},"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"default_currency":{"type":"string"},"timezone":{"type":"string"}},"required":["name","default_currency","timezone"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"name":{"type":"string","description":"Display name of the workspace"},"default_currency":{"type":"string","description":"Default currency code for the workspace"},"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Asia/Tokyo')"},"organization_id":{"type":"string","description":"Organization ID this workspace belongs to"},"created_at":{"type":"string","description":"Timestamp when workspace was created"}},"required":["id","name","default_currency","timezone","organization_id","created_at"]}}}}}}},"/v1/workspaces":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"timezone":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"name":{"type":"string","description":"Display name of the workspace"},"default_currency":{"type":"string","description":"Default currency code for the workspace"},"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Asia/Tokyo')"},"organization_id":{"type":"string","description":"Organization ID this workspace belongs to"},"created_at":{"type":"string","description":"Timestamp when workspace was created"}},"required":["id","name","default_currency","timezone","organization_id","created_at"]}}}}}},"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace"},"name":{"type":"string","description":"Display name of the workspace"},"default_currency":{"type":"string","description":"Default currency code for the workspace"},"timezone":{"type":"string","description":"IANA timezone name (e.g., 'America/New_York', 'Asia/Tokyo')"},"organization_id":{"type":"string","description":"Organization ID this workspace belongs to"},"created_at":{"type":"string","description":"Timestamp when workspace was created"}},"required":["id","name","default_currency","timezone","organization_id","created_at"]}}}}}}}},"/v1/workspace/backup":{"post":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/v1/workspace/backups":{"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workspace backup"},"workspace_id":{"type":"string","description":"ID of the workspace that was backed up"},"organization_id":{"type":"string","description":"ID of the organization this backup belongs to"},"status":{"type":"string","enum":["pending","completed","failed"],"description":"Current status of the backup operation"},"type":{"type":"string","enum":["auto","manual"],"description":"Backup type: 'auto' for scheduled backups, 'manual' for user-initiated"},"url":{"type":"string","description":"URL to download the backup file"},"storage_provider":{"type":"string","description":"Storage provider where backup is stored (e.g., 'aws', 'gcs')"},"storage_key":{"type":"string","description":"Storage key/path where backup file is stored"},"metadata":{"type":["object","null"],"additionalProperties":{},"description":"Additional metadata about the backup"},"created_at":{"type":"string","description":"Timestamp when backup was initiated"},"completed_at":{"type":["string","null"],"description":"Timestamp when backup completed (null if still in progress)"}},"required":["id","workspace_id","organization_id","status","type","url","storage_provider","storage_key","metadata","created_at","completed_at"]}}}}}}}},"/v1/workspace/backups/{backup_id}/restore":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"backup_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/v1/notifications":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"level":{"type":"string","enum":["urgent","warning","info","success"]}},"required":["title","body"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"}},"required":["created"]}}}}}},"delete":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}}}},"get":{"parameters":[{"schema":{"type":"boolean"},"required":false,"name":"done","in":"query"},{"schema":{"type":"string","enum":["urgent","warning","info","success"]},"required":false,"name":"level","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["send_notification_tool"],"description":"Notification triggered by automation tool"},"data":{"type":"object","properties":{},"description":"Additional data associated with the notification"}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["approval_request"]},"data":{"type":"object","properties":{"approval_request_id":{"type":"string"},"workflow_name":{"type":"string"},"workflow_execution_id":{"type":"string"},"resolved_status":{"type":"string","enum":["approved","rejected","timed_out"]},"resolved_by":{"type":["string","null"]},"resolved_comment":{"type":["string","null"]}},"required":["approval_request_id","workflow_name","workflow_execution_id"]}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["locked_field_change"]},"data":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"approval_request_id":{"type":"string"},"requested_by_name":{"type":"string"},"resolved_status":{"type":"string","enum":["approved","rejected","timed_out"]},"resolved_by":{"type":["string","null"]},"resolved_comment":{"type":["string","null"]}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","approval_request_id","requested_by_name"]}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]}]}}}}}}}},"/v1/notifications/{notification_id}/done":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"notification_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["send_notification_tool"],"description":"Notification triggered by automation tool"},"data":{"type":"object","properties":{},"description":"Additional data associated with the notification"}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["approval_request"]},"data":{"type":"object","properties":{"approval_request_id":{"type":"string"},"workflow_name":{"type":"string"},"workflow_execution_id":{"type":"string"},"resolved_status":{"type":"string","enum":["approved","rejected","timed_out"]},"resolved_by":{"type":["string","null"]},"resolved_comment":{"type":["string","null"]}},"required":["approval_request_id","workflow_name","workflow_execution_id"]}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the notification"},"title":{"type":"string","description":"Title/heading of the notification"},"body":{"type":"string","description":"The message to display in the notification."},"member_id":{"type":"string","description":"ID of the member who should receive this notification"},"workspace_id":{"type":"string","description":"ID of the workspace this notification belongs to"},"level":{"type":["string","null"],"enum":["urgent","warning","info","success",null],"description":"Notification level"},"created_at":{"type":"string","description":"Timestamp when notification was created"},"done_at":{"type":["string","null"],"description":"Timestamp when notification was marked as done/read"},"type":{"type":"string","enum":["locked_field_change"]},"data":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"approval_request_id":{"type":"string"},"requested_by_name":{"type":"string"},"resolved_status":{"type":"string","enum":["approved","rejected","timed_out"]},"resolved_by":{"type":["string","null"]},"resolved_comment":{"type":["string","null"]}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","approval_request_id","requested_by_name"]}},"required":["id","title","body","member_id","workspace_id","level","created_at","done_at","type","data"]}]}}}}}}},"/v1/files/multipart/abort":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"upload_id":{"type":"string"},"file_storage_key":{"type":"string"}},"required":["upload_id","file_storage_key"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/v1/files/direct/complete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"file_storage_key":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"}},"required":["file_id","file_storage_key","filename","mime_type"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]},"description":"Successfully uploaded files"},"errors":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","description":"Original filename that failed to upload"},"error":{"type":"string","description":"Error message describing the failure reason"}},"required":["filename","error"]},"description":"Files that failed to upload with error details"}},"required":["files","errors"]}}}}}}},"/v1/files/multipart/complete":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"upload_id":{"type":"string"},"file_storage_key":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"part_number":{"type":"number"},"etag":{"type":"string"}},"required":["part_number","etag"]}}},"required":["file_id","upload_id","file_storage_key","filename","mime_type","parts"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]},"description":"Successfully uploaded files"},"errors":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","description":"Original filename that failed to upload"},"error":{"type":"string","description":"Error message describing the failure reason"}},"required":["filename","error"]},"description":"Files that failed to upload with error details"}},"required":["files","errors"]}}}}}}},"/v1/files/{file_id}/download":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"file_id","in":"path"},{"schema":{"type":"string","enum":["original","small"]},"required":false,"name":"size","in":"query"}],"responses":{}}},"/v1/files/download_zip":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_ids":{"type":"array","items":{"type":"string"},"minItems":1},"filename":{"type":"string"},"size":{"type":"string","enum":["original","small"]}},"required":["file_ids"]}}}},"responses":{}}},"/v1/files":{"get":{"parameters":[{"schema":{"type":"array","items":{"type":"string"}},"required":false,"name":"file_ids","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]}}}}}}},"post":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]},"description":"Successfully uploaded files"},"errors":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","description":"Original filename that failed to upload"},"error":{"type":"string","description":"Error message describing the failure reason"}},"required":["filename","error"]},"description":"Files that failed to upload with error details"}},"required":["files","errors"]}}}}}}},"/v1/files/direct/init":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"},"file_size":{"type":"number","exclusiveMinimum":0}},"required":["filename","mime_type","file_size"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"file_storage_key":{"type":"string"},"upload_url":{"type":"string"}},"required":["file_id","file_storage_key","upload_url"]}}}}}}},"/v1/files/multipart/init":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"},"file_size":{"type":"number","exclusiveMinimum":0},"network_effective_type":{"type":"string","enum":["slow-2g","2g","3g","4g"]},"network_rtt_ms":{"type":"number","minimum":0}},"required":["filename","mime_type","file_size"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"file_id":{"type":"string"},"upload_id":{"type":"string"},"file_storage_key":{"type":"string"},"part_size":{"type":"number"},"parts":{"type":"array","items":{"type":"object","properties":{"part_number":{"type":"number"},"url":{"type":"string"}},"required":["part_number","url"]}}},"required":["file_id","upload_id","file_storage_key","part_size","parts"]}}}}}}},"/v1/files/profile_image":{"post":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]},"small_variant_url":{"type":"string"}},"required":["file","small_variant_url"]}}}}}}},"/v1/workflows/{workflow_id}":{"get":{"summary":"Get workflow by ID","parameters":[{"schema":{"type":"string"},"required":true,"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}}}}}},"patch":{"summary":"Update workflow","parameters":[{"schema":{"type":"string"},"required":true,"name":"workflow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Updated name of the workflow"},"description":{"type":"string","description":"Updated description of the workflow"},"steps":{"description":"Updated workflow steps (array of WorkflowStep) as JSON"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}}}}}}},"/v1/workflows":{"get":{"summary":"List workflows","parameters":[{"schema":{"type":"array","items":{"type":"string"},"description":"Filter by workflow IDs"},"required":false,"description":"Filter by workflow IDs","name":"ids","in":"query"},{"schema":{"type":"array","items":{"type":"string"},"description":"Filter by table IDs referenced in workflows"},"required":false,"description":"Filter by table IDs referenced in workflows","name":"table_ids","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}}}}}}}},"/v1/workflows/rescan":{"post":{"summary":"Rescan all workflows","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"updated":{"type":"number"}},"required":["total","updated"]}}}}}}},"/v1/document_templates":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string"},"format":{"type":"string","default":"A4"},"orientation":{"type":"string","enum":["portrait","landscape"],"default":"portrait"},"variables":{"type":"object","additionalProperties":{}}},"required":["name","type"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}},"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}}},"/v1/document_templates/{document_template_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"template":{"type":"string"},"format":{"type":"string"},"orientation":{"type":"string","enum":["portrait","landscape"]},"variables":{"type":"object","additionalProperties":{}},"expected_version":{"type":"integer"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/find_text":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1}},"required":["query"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"occurrences":{"type":"array","items":{"type":"object","properties":{"occurrence_index":{"type":"number"},"element_index":{"type":"number"},"context_before":{"type":"string"},"matched_text":{"type":"string"},"context_after":{"type":"string"}},"required":["occurrence_index","element_index","context_before","matched_text","context_after"]}}},"required":["occurrences"]}}}}}}},"/v1/document_templates/{document_template_id}/mark_conditional_region":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variable_name":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},"region":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["table_rows"]},"element_index":{"type":"integer","minimum":0},"start_row":{"type":"integer","minimum":0},"end_row":{"type":"integer","minimum":0}},"required":["type","element_index","start_row","end_row"]},{"type":"object","properties":{"type":{"type":"string","enum":["paragraphs"]},"start_index":{"type":"integer","minimum":0},"end_index":{"type":"integer","minimum":0}},"required":["type","start_index","end_index"]}]},"expected_version":{"type":"integer"}},"required":["variable_name","region"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/mark_loop_region":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variable_name":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},"loop_variable":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},"region":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["table_rows"]},"element_index":{"type":"integer","minimum":0},"start_row":{"type":"integer","minimum":0},"end_row":{"type":"integer","minimum":0}},"required":["type","element_index","start_row","end_row"]},{"type":"object","properties":{"type":{"type":"string","enum":["paragraphs"]},"start_index":{"type":"integer","minimum":0},"end_index":{"type":"integer","minimum":0}},"required":["type","start_index","end_index"]}]},"fields":{"type":"object","additionalProperties":{"type":"string"}},"expected_version":{"type":"integer"}},"required":["variable_name","loop_variable","region"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/mark_variable":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_text":{"type":"string","minLength":1},"variable_name":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},"variable_type":{"type":"string","enum":["string","array","image"],"default":"string"},"occurrence_index":{"type":"integer","minimum":0},"expected_version":{"type":"integer"}},"required":["selected_text","variable_name","occurrence_index"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/unmark_conditional_region":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variable_name":{"type":"string","minLength":1},"expected_version":{"type":"integer"}},"required":["variable_name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/unmark_loop_region":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variable_name":{"type":"string","minLength":1},"expected_version":{"type":"integer"}},"required":["variable_name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/document_templates/{document_template_id}/unmark_variable":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"document_template_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"variable_name":{"type":"string","minLength":1},"expected_version":{"type":"integer"}},"required":["variable_name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document template"},"workspace_id":{"type":"string","description":"ID of the workspace this template belongs to"},"name":{"type":"string","description":"Display name of the template"},"type":{"type":"string","enum":["html","pdf-form","excel","word","email"],"description":"Template type: 'html' for HTML templates, 'pdf-form' for fillable PDF forms, 'excel' for Excel templates, 'word' for Word templates, 'email' for email HTML templates"},"template":{"type":"string","description":"Template content with variable placeholders (e.g., {{customer_name}})"},"format":{"type":"string","description":"Supported document formats."},"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation for PDF generation"},"variables":{"type":"object","additionalProperties":{},"description":"Data to pass to the template."},"current_version":{"type":"number","description":"Current version number of the template"},"created_at":{"type":"string","description":"Timestamp when template was created"},"template_url":{"type":["string","null"],"description":"Signed URL to download the template file (pdf-form/excel only)"}},"required":["id","workspace_id","name","type","template","variables","current_version","created_at","template_url"]}}}}}}},"/v1/apps":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}]},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]}},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]}},"theme":{"type":["object","null"],"additionalProperties":{}}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the app"},"name":{"type":"string","description":"Display name of the app"},"description":{"type":["string","null"],"description":"Optional description of the app's purpose"},"icon":{"type":["string","null"],"description":"Icon name for the app (e.g., 'home', 'chart-bar')"},"workspace_id":{"type":"string","description":"ID of the workspace this app belongs to"},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}],"description":"UI structure (form/dashboard/3d/map)"},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]},"description":"Named filter inputs for interactive filtering. Filter values are accessible in data source expressions as filters.<key>"},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]},"description":"Named data sources for expressions. Each key is accessible in component expressions as data.<key>.records."},"theme":{"type":["object","null"],"properties":{"color":{"type":["string","null"],"enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone",null],"description":"Theme color for the app"}},"description":"Theme settings for the app"},"created_at":{"type":"string","description":"Timestamp when app was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","workspace_id","created_at","updated_at"]}}}}}},"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the app"},"name":{"type":"string","description":"Display name of the app"},"description":{"type":["string","null"],"description":"Optional description of the app's purpose"},"icon":{"type":["string","null"],"description":"Icon name for the app (e.g., 'home', 'chart-bar')"},"workspace_id":{"type":"string","description":"ID of the workspace this app belongs to"},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}],"description":"UI structure (form/dashboard/3d/map)"},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]},"description":"Named filter inputs for interactive filtering. Filter values are accessible in data source expressions as filters.<key>"},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]},"description":"Named data sources for expressions. Each key is accessible in component expressions as data.<key>.records."},"theme":{"type":["object","null"],"properties":{"color":{"type":["string","null"],"enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone",null],"description":"Theme color for the app"}},"description":"Theme settings for the app"},"created_at":{"type":"string","description":"Timestamp when app was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","workspace_id","created_at","updated_at"]}}}}}}}},"/v1/apps/{app_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the app"},"name":{"type":"string","description":"Display name of the app"},"description":{"type":["string","null"],"description":"Optional description of the app's purpose"},"icon":{"type":["string","null"],"description":"Icon name for the app (e.g., 'home', 'chart-bar')"},"workspace_id":{"type":"string","description":"ID of the workspace this app belongs to"},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}],"description":"UI structure (form/dashboard/3d/map)"},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]},"description":"Named filter inputs for interactive filtering. Filter values are accessible in data source expressions as filters.<key>"},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]},"description":"Named data sources for expressions. Each key is accessible in component expressions as data.<key>.records."},"theme":{"type":["object","null"],"properties":{"color":{"type":["string","null"],"enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone",null],"description":"Theme color for the app"}},"description":"Theme settings for the app"},"created_at":{"type":"string","description":"Timestamp when app was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","workspace_id","created_at","updated_at"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}]},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]}},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]}},"theme":{"type":["object","null"],"additionalProperties":{}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the app"},"name":{"type":"string","description":"Display name of the app"},"description":{"type":["string","null"],"description":"Optional description of the app's purpose"},"icon":{"type":["string","null"],"description":"Icon name for the app (e.g., 'home', 'chart-bar')"},"workspace_id":{"type":"string","description":"ID of the workspace this app belongs to"},"ui":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["3d"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["map"]},"layers":{"type":"array","items":{"type":"object","properties":{"data_source":{"type":"string","description":"Key in app.data"},"latitude_field_key":{"type":"string","description":"Field key for latitude (number)"},"longitude_field_key":{"type":"string","description":"Field key for longitude (number)"},"label_field_key":{"type":"string","description":"Field key for marker label (text)"}},"required":["data_source","latitude_field_key","longitude_field_key"]},"minItems":1,"description":"Map layers — one per data source"}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["form"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_text"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"placeholder":{"type":"string","description":"Placeholder text"},"required":{"type":"boolean","description":"Whether the input is required"},"default_value":{"type":"string","description":"Default value or expression ({{...}})"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_number"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"min":{"type":"number","description":"Minimum allowed value"},"max":{"type":"number","description":"Maximum allowed value"},"default_value":{"type":"number","description":"Default value"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"multi":{"type":"boolean","description":"Whether multiple options can be selected"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Default selected value(s)"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_radio"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"value":{"type":"string","description":"Value of the option"}},"required":["label","value"]},"description":"Available options for the radio group"}},"required":["id","type","label","options"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_date"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"],"description":"Date format type"},"default_value":{"type":"string","description":"Default value in ISO format or expression"}},"required":["id","type","label","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_select_record"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether the input is required"},"table_id":{"type":"string","description":"ID of the table to select records from"},"view_id":{"type":"string","description":"Optional view ID for filtering/display"},"display_field_keys":{"type":"array","items":{"type":"string"},"description":"Field keys to display in the picker"},"multi":{"type":"boolean","description":"Whether multiple records can be selected"}},"required":["id","type","label","table_id"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_switch"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"default_value":{"type":"boolean","description":"Default checked state"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_files"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one file is required"},"content_types":{"type":"array","items":{"type":"string"},"description":"Allowed MIME types (e.g., 'image/*', 'application/pdf')"}},"required":["id","type","label"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_object_list"]},"label":{"type":"string","description":"Display label for the input"},"description":{"type":"string","description":"Help text shown below the input"},"required":{"type":"boolean","description":"Whether at least one item is required"},"min_items":{"type":"number","description":"Minimum number of items"},"max_items":{"type":"number","description":"Maximum number of items"},"item_label":{"type":"string","description":"Label for each row (e.g., 'Member', 'Entry')"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for this field"},"label":{"type":"string","description":"Display label for the field"},"required":{"type":"boolean","description":"Whether this field is required in each item"},"placeholder":{"type":"string","description":"Placeholder text"}},"required":["key","label"]},"minItems":1,"description":"Fields for each item"},"default_value":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","null"]}},"description":"Default items"}},"required":["id","type","label","fields"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["input_calendar_select"]},"label":{"type":"string","description":"Display label"},"description":{"type":"string"},"required":{"type":"boolean"},"table_id":{"type":"string","description":"Table to select records from"},"view_id":{"type":"string","description":"View for filtering available records"},"start_field_key":{"type":"string","description":"Date/datetime field key for slot start"},"end_field_key":{"type":"string","description":"Date/datetime field key for slot end"},"title_field_key":{"type":"string","description":"Text field key for slot label"},"color_field_key":{"type":"string","description":"Select field key for chip colors"},"multi":{"type":"boolean"}},"required":["id","type","label","table_id","start_field_key","title_field_key"]}]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the action"},"label":{"type":"string","description":"Label of the action"},"color":{"type":"string","enum":["primary","default"]},"icon":{"type":"string","description":"Icon of the action"},"restrictions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["geofencing"],"description":"Geofencing restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"radius":{"type":"number","description":"Radius in meters"},"coordinates":{"type":"array","items":{"type":"number"},"description":"Coordinates of the center of the geofence"}},"required":["type","radius","coordinates"]},{"type":"object","properties":{"type":{"type":"string","enum":["ip_address"],"description":"IP address restriction"},"effect":{"type":"string","enum":["allow","deny"],"description":"Whether to allow or deny the submission"},"ip_addresses":{"type":"array","items":{"type":"string"},"description":"Array of IP addresses"}},"required":["type","ip_addresses"]}]},"description":"Restrictions that must be satisfied before the action can be executed (e.g., geofencing, IP address)"},"on_success":{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Show a success message after action"},"message":{"type":"string","description":"Message to display when action completes successfully"}},"required":["type","message"],"description":"What to do when action succeeds. If set, replaces the app view with a success message and reset button."},"type":{"type":"string","enum":["workflow"],"description":"Execute a workflow"},"fallback_success_message":{"type":"string","description":"Message to show if the workflow completes successfully but doesn't return a message"}},"required":["id","label","icon","type"]},"minItems":1}},"required":["type","components","actions"]},{"type":"object","properties":{"type":{"type":"string","enum":["dashboard"]},"components":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pivot_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"row_field_key":{"type":"string","description":"Field key for rows (typically a select field)"},"column_field_key":{"type":"string","description":"Field key for columns (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","row_field_key","column_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["summary_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (typically a select field)"},"value_field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (must match field type)"}},"required":["id","type","data_source","group_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["record_table"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"columns":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to display"},"label":{"type":"string","description":"Column header (defaults to field name)"}},"required":["field_key"]},"minItems":1,"description":"Columns to display"},"limit":{"type":"number","description":"Max rows to show"}},"required":["id","type","data_source","columns"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["metric"]},"data_source":{"type":"string","description":"Name of data source from interface.data to aggregate from"},"field_key":{"type":"string","description":"Field key to aggregate"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"format":{"type":"string","enum":["none","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR. Only used if format is 'currency'."},"compare":{"type":"string","enum":["previous_period"],"description":"Compare current value to a previous time period. Derives comparison window from the app's date_range filter. Gracefully skipped if no date_range filter exists."}},"required":["id","type","data_source","field_key","operation","format"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["progress_bar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"field_key":{"type":"string","description":"Field key to aggregate. If omitted, counts records."},"operation":{"type":"string","description":"Aggregation operation (count, sum, etc.)"},"max_value":{"type":"number","description":"Target/maximum value representing 100% completion"},"format":{"type":"string","enum":["percentage","fraction"],"description":"Display format: percentage (75%) or fraction (6/8). Defaults to percentage."}},"required":["id","type","data_source","operation","max_value"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["line_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"date_field_key":{"type":"string","description":"Date field key for x-axis"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"group_by":{"type":"string","enum":["day","week","month","quarter","year"]}},"required":["id","type","data_source","date_field_key","value_field_key","operation","group_by"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["bar_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"group_field_key":{"type":"string","description":"Field key to group by (categories on x-axis)"},"value_field_key":{"type":"string","description":"Field key to aggregate for y-axis"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"orientation":{"type":"string","enum":["vertical","horizontal"]},"limit":{"type":"number","description":"Max number of categories to show"}},"required":["id","type","data_source","group_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["pie_chart"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"segment_field_key":{"type":"string","description":"Field key for pie segments"},"value_field_key":{"type":"string","description":"Field key to aggregate for segment size"},"operation":{"type":"string","description":"Aggregation operation (must match field type)"},"limit":{"type":"number","description":"Max segments (others grouped into 'Other')"}},"required":["id","type","data_source","segment_field_key","value_field_key","operation"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["text"]},"align":{"type":"string","enum":["left","center","right"]},"size":{"type":"string","enum":["sm","md","lg"]},"weight":{"type":"string","enum":["400","500","600"]},"color":{"type":"string","enum":["default","muted"]},"content":{"type":"string","description":"Text content with optional {{expression}} placeholders. Access interface data via data.<name>.records array."}},"required":["id","type","content"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the component"},"title":{"type":"string","description":"Title of the component"},"visible":{"type":"string","description":"Expression that evaluates to boolean. Component is hidden when false. Supports {{expression}} syntax with access to data sources."},"col_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid columns (1-12). Default varies by component type."},"row_span":{"type":"number","minimum":1,"maximum":12,"description":"Grid row units (1-12). Default varies by component type."},"type":{"type":"string","enum":["calendar"]},"data_source":{"type":"string","description":"Name of data source from interface.data"},"start_field_key":{"type":"string","description":"Date/datetime field key for event start"},"end_field_key":{"type":"string","description":"Date/datetime field key for event end"},"title_field_key":{"type":"string","description":"Text field key for event title"},"color_field_key":{"type":"string","description":"Select field key for event colors"},"default_view":{"type":"string","enum":["week","month"]}},"required":["id","type","data_source","start_field_key","title_field_key"]}]}}},"required":["type","components"]},{"type":"null"}],"description":"UI structure (form/dashboard/3d/map)"},"filters":{"type":["object","null"],"additionalProperties":{"oneOf":[{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["date_range"]},"include_time":{"type":"boolean","description":"When true, shows time pickers alongside date selection. Useful for datetime filtering."},"default_value":{"type":"object","properties":{"start":{"type":"string","description":"Start date. ISO format (2025-01-01), relative (-7d, -24h, -1w, -1m), or preset (today, this_week_start, this_month_start)"},"end":{"type":"string","description":"End date. ISO format (2025-01-31), relative (+1d, now), or preset (today, this_week_end, this_month_end)"}},"required":["start","end"],"description":"Default date range. Supports ISO dates, relative offsets (-7d, -24h), and presets (today, this_week_start/end, this_month_start/end)"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"multi":{"type":"boolean","description":"Allow multiple selections"},"default_value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["label","type","options"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["member"]},"multi":{"type":"boolean","description":"Allow multiple member selections"}},"required":["label","type"]},{"type":"object","properties":{"label":{"type":"string","description":"Display label for the filter"},"type":{"type":"string","enum":["text"]},"placeholder":{"type":"string"},"default_value":{"type":"string"}},"required":["label","type"]}]},"description":"Named filter inputs for interactive filtering. Filter values are accessible in data source expressions as filters.<key>"},"data":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["query_records"]},"table_id":{"type":"string","description":"Table ID to query records from"},"filter":{"description":"Filter conditions"},"sort":{"type":"array","items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]},"description":"Sort order"},"limit":{"type":"number","description":"Max records to return"}},"required":["type","table_id"]},"description":"Named data sources for expressions. Each key is accessible in component expressions as data.<key>.records."},"theme":{"type":["object","null"],"properties":{"color":{"type":["string","null"],"enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone",null],"description":"Theme color for the app"}},"description":"Theme settings for the app"},"created_at":{"type":"string","description":"Timestamp when app was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","workspace_id","created_at","updated_at"]}}}}}}},"/v1/apps/{app_id}/actions/{action_id}":{"post":{"summary":"Execute app action","parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"action_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{},"description":"Input values from app input components"}},"required":["inputs"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["success","error"],"description":"Status of the workflow execution"},"message":{"type":"string","description":"Message returned from the workflow or fallback message"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the processed file"},"filename":{"type":"string","description":"Original filename of the uploaded file"},"mime_type":{"type":"string","description":"MIME type of the file (e.g., 'image/png', 'application/pdf')"},"url":{"type":"string","description":"Deprecated: use /v1/files/{id}/download instead"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"},"provider":{"type":"string","description":"Storage provider name (e.g., 'aws', 'gcs')"},"file_storage_key":{"type":"string","description":"Storage key/path where the file is stored"},"workspace_id":{"type":"string","description":"ID of the workspace this file belongs to"},"created_at":{"type":"string","description":"Timestamp when file was uploaded"},"metadata":{"description":"Additional metadata about the file"},"data":{"description":"File-type-specific data (e.g., {width, height, orientation} for images)"}},"required":["id","filename","mime_type","provider","file_storage_key","workspace_id","created_at"]},"description":"Files generated by the workflow"}},"required":["status"]}}}}}}},"/v1/apps/{app_id}/resolve_data":{"post":{"summary":"Resolve app data","parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filter_values":{"type":"object","additionalProperties":{}},"inputs":{"type":"object","additionalProperties":{}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"object","additionalProperties":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]},"description":"Query result records"},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["number"]},"format":{"type":"string","enum":["number","currency","percentage"]},"currency":{"type":"string","description":"ISO 4217 code"}},"required":["key","name","description","type","format"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["text"]},"unique":{"type":"boolean","description":"Unique values required"},"format":{"type":"string","enum":["text","link","rich_text"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["date"]},"format":{"type":"string","enum":["date","datetime","date_range","datetime_range"]},"timezone":{"type":"string","description":"IANA timezone"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["boolean"]}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","enum":["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone"]}},"required":["key","name","color"]}},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type","options"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_member"]},"multi":{"type":"boolean","description":"Allow multiple selections"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["select_record_link"],"description":"Field type for linking to records in another table"},"table_id":{"type":"string","description":"ID of the target table that records can be linked to"},"view_id":{"type":["string","null"],"description":"ID of the view to use for records. By default, it will show all records from the table."},"display_field_keys":{"type":"array","items":{"type":"string"},"default":[],"description":"Field keys of the linked table to display in the preview."},"paired_field_key":{"type":"string","description":"Key of the paired link field in the linked table. If set to a string, this indicates a bidirectional link where both tables can reference each other and data synchronizes in both directions. Both fields have paired_field_key pointing to each other. If set to null, explicitly disconnects the bidirectional link (clears paired_field_key on both sides). If undefined, no change is made to the existing paired_field_key."}},"required":["key","name","description","type","table_id"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["rollup"],"description":"Field type for aggregating values from linked records (sum, avg, filled, earliest, etc.)"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to rollup from"},"aggregate_option":{"anyOf":[{"type":"object","properties":{"operation":{"type":"string","enum":["count"]},"field_key":{"type":"string"}},"required":["operation"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["checked","unchecked","percent_checked","percent_unchecked"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]},{"type":"object","properties":{"operation":{"type":"string","enum":["empty","filled","percent_empty","percent_filled","unique","percent_unique","sum","avg","median","min","max","range","earliest","latest","date_range"]},"field_key":{"type":"string"}},"required":["operation","field_key"]}],"description":"The field aggregation function to apply (e.g., sum, avg, filled, earliest)"},"filter":{"description":"Optional filter to apply to linked records before aggregation. Only records matching the filter conditions will be included in the rollup calculation."},"aggregate_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the aggregated target field (e.g. 'number', 'formula', 'date'). Resolved from the linked table's field definition at creation time."},"aggregate_field_format":{"type":"string","description":"The format of the aggregated target field (e.g. 'currency', 'percentage'). Resolved from the linked table's field definition at creation time."},"aggregate_field_currency":{"type":"string","description":"The currency code of the aggregated target field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at creation time."}},"required":["key","name","description","type","source_field_key","aggregate_option"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["lookup"],"description":"Field type for displaying values from fields in linked records"},"source_field_key":{"type":"string","description":"The field key of the select_record_link field to lookup from"},"lookup_field_key":{"type":"string","description":"The field key from the linked records to display"},"lookup_field_type":{"type":"string","enum":["text","number","date","boolean","select","select_member","select_record_link","files","formula","rollup","lookup","button"],"description":"The type of the target lookup field (e.g. 'text', 'number', 'date'). Resolved from the linked table's field definition at read time."},"lookup_field_format":{"type":"string","description":"The format of the target lookup field (e.g. 'currency', 'percentage', 'datetime'). Resolved from the linked table's field definition at read time."},"lookup_field_currency":{"type":"string","description":"The currency code of the target lookup field (e.g. 'USD', 'VND'). Resolved from the linked table's field definition at read time."},"lookup_field_options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["key","name"]},"description":"Options for select-type lookup fields. Synced from the source select field's options."}},"required":["key","name","description","type","source_field_key","lookup_field_key"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["files"],"description":"Field type for file attachments (images, PDFs, documents)"}},"required":["key","name","description","type"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["formula"],"description":"Field type for calculated values based on expressions"},"formula":{"type":"object","properties":{"expression":{"type":"string","description":"JavaScript expression. Uses {Field Name} for field references."},"format":{"type":"string","enum":["number","currency","percentage"],"description":"Display format for numeric results: 'number', 'currency', or 'percentage'. Optional."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. USD, VND, EUR"},"output_type":{"type":"string","enum":["number","text","date","boolean"],"description":"Inferred output type of the formula expression. Set automatically by the backend."},"volatile":{"type":"boolean"}},"required":["expression"],"description":"Formula configuration and expression"}},"required":["key","name","description","type","formula"]},{"type":"object","properties":{"key":{"type":"string","description":"Unique field key"},"name":{"type":"string","description":"Display name"},"description":{"type":"string","description":"Field description"},"confirm_before_update":{"type":"boolean","description":"Show confirmation before AI updates"},"type":{"type":"string","enum":["button"],"description":"Field type for action buttons"},"text":{"type":"string","description":"Button label text displayed to users"}},"required":["key","name","description","type","text"]}]},"description":"Table fields for the data source"},"record_count":{"type":"number","default":0,"description":"Total record count for this data source"}},"required":["records","fields"]},"description":"Resolved data per data source name"},"markers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Record ID"},"latitude":{"type":"number","description":"Marker latitude"},"longitude":{"type":"number","description":"Marker longitude"},"label":{"type":"string","description":"Marker label text"}},"required":["id","latitude","longitude","label"]},"description":"Pre-computed map markers (map apps only)"},"component_data":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["scalar"]},"value":{"anyOf":[{"type":"number"},{"type":"string"}]},"previous_value":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"Value from the previous comparison period (when metric has compare enabled)"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["grouped"]},"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"},"color":{"type":"string"}},"required":["key","label","value"]}}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","enum":["pivoted"]},"cells":{"type":"array","items":{"type":"object","properties":{"row_key":{"type":"string"},"row_label":{"type":"string"},"column_key":{"type":"string"},"column_label":{"type":"string"},"value":{"type":"number"}},"required":["row_key","row_label","column_key","column_label","value"]}}},"required":["type","cells"]},{"type":"object","properties":{"type":{"type":"string","enum":["time_series"]},"points":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"value":{"type":"number"}},"required":["period","value"]}}},"required":["type","points"]},{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"content":{"type":"string"}},"required":["type","content"]}]},"description":"Pre-computed aggregation data keyed by component ID"},"component_visibility":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Evaluated visibility for components with visible expressions"},"warnings":{"type":"array","items":{"type":"string"},"description":"Validation and resolution warnings"},"resolved_at":{"type":"string","description":"ISO timestamp when data was resolved"}},"required":["sources","resolved_at"]}}}}}}},"/v1/apps/{app_id}/tables/{table_id}/draft_records":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["data"]}}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}}}}}}},"/v1/apps/{app_id}/tables/{table_id}/records":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["data"]}}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"deleted":{"type":"boolean"}},"required":["ids","deleted"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["id","data"]}}},"required":["records"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}}}}},"/v1/apps/{app_id}/tables/{table_id}/records/by_ids":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}}},"required":["records"]}}}}}}},"/v1/apps/{app_id}/tables/{table_id}/records/query":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_id":{"type":["string","null"]},"filters":{},"sort":{"type":["array","null"],"items":{"type":"object","properties":{"field_key":{"type":"string","description":"Field key to sort by"},"order":{"type":["string","null"],"enum":["asc","desc",null],"description":"Sort order: 'asc' for ascending, 'desc' for descending"},"blank_position":{"type":"string","enum":["top","bottom"],"description":"Blank position: 'top' for top, 'bottom' for bottom"}},"required":["field_key","order"]}},"search":{"type":["string","null"]},"limit":{"type":"number","minimum":1},"offset":{"type":["number","null"],"minimum":0}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}},"total":{"type":"number"}},"required":["records","total"]}}}}}}},"/v1/apps/{app_id}/tables/{table_id}/draft_records/submit":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"app_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"table_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string"}}},"required":["record_ids"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the record"},"table_id":{"type":"string","description":"ID of the table this record belongs to"},"workspace_id":{"type":"string","description":"ID of the workspace this record belongs to"},"data":{"type":"object","additionalProperties":{},"description":"The data of the record. The key is the Field key."},"locked":{"type":"boolean","description":"Whether the entire record is locked from editing"},"updated_at":{"type":"string","description":"Timestamp of last update"},"created_at":{"type":"string","description":"Timestamp when record was created"}},"required":["id","table_id","workspace_id","data","updated_at","created_at"]}},"status":{"type":"string","enum":["success","error"]},"message":{"type":"string"}},"required":["records"]}}}}}}},"/v1/automations":{"post":{"summary":"Create an automation (trigger + workflow pair)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Automation name."},"description":{"type":"string","description":"What this automation does."},"type":{"type":"string","enum":["record_updated","recurring_schedule","receive_webhook"],"description":"Trigger type."},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"'steps' for deterministic step sequences, 'agent' for AI-driven execution."},"enabled":{"type":"boolean","description":"Whether the automation is active. Defaults to true."},"steps":{"type":"array","items":{},"description":"Workflow steps (required for steps mode)."},"instructions":{"type":"string","description":"Agent instructions (required for agent mode)."},"tool_names":{"type":"array","items":{"type":"string"},"description":"Tools the agent can use (agent mode only)."},"model_id":{"type":"string","description":"AI model ID (agent mode only)."},"table_id":{"type":"string","description":"Table to monitor (required for record_change type)."},"condition":{"type":"string","description":"JS expression filter for record_change triggers."},"cron_expression":{"type":"string","description":"Cron schedule (required for schedule type)."},"secret":{"type":"string","description":"HMAC secret for webhook signature verification."}},"required":["name","description","type","execution_mode"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"automation_id":{"type":"string","description":"The trigger ID."},"workflow_id":{"type":"string","description":"The associated workflow ID."},"type":{"type":"string","description":"The trigger type."},"webhook_url":{"type":"string","description":"Public webhook URL (webhook type only)."}},"required":["automation_id","workflow_id","type"]}}}}}},"get":{"summary":"Query automations","parameters":[{"schema":{"type":"array","items":{"type":"string"},"description":"Filter by automation (trigger) IDs"},"required":false,"description":"Filter by automation (trigger) IDs","name":"ids","in":"query"},{"schema":{"type":"array","items":{"type":"string"},"description":"Filter by table IDs referenced in the automation's workflow"},"required":false,"description":"Filter by table IDs referenced in the automation's workflow","name":"table_ids","in":"query"},{"schema":{"type":["boolean","null"],"description":"Filter by enabled/disabled status"},"required":false,"description":"Filter by enabled/disabled status","name":"enabled","in":"query"},{"schema":{"type":"string","description":"Filter by trigger type (e.g. record_updated, recurring_schedule)"},"required":false,"description":"Filter by trigger type (e.g. record_updated, recurring_schedule)","name":"trigger_type","in":"query"},{"schema":{"type":"string","enum":["steps","agent"],"description":"Filter by workflow execution mode"},"required":false,"description":"Filter by workflow execution mode","name":"execution_mode","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"trigger":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["recurring_schedule"],"description":"Trigger type: runs on a recurring schedule"},"config":{"type":"object","properties":{"cron_expression":{"type":"string","description":"The cron expression defining the schedule."}},"required":["cron_expression"],"description":"Schedule configuration with cron expression"},"data":{"type":["object","null"],"properties":{"job_scheduler_id":{"type":"string","description":"ID of the scheduled job in the job queue system"}},"required":["job_scheduler_id"],"description":"Job scheduler data for managing the recurring schedule"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["record_updated"],"description":"Trigger type: fires when a record is updated"},"config":{"type":"object","properties":{"table_id":{"type":"string","description":"ID of the table to monitor for updates"},"if":{"type":["string","null"],"description":"JS expression evaluated against the changelog. The trigger matches only if it evaluates to true. Available context is in the `TableRecordUpdateChangelog`."}},"required":["table_id"],"description":"Configuration for the record update trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_outlook_email"],"description":"Trigger type: receive Outlook email"},"config":{"type":"object","properties":{"filter":{"type":"object","properties":{"from":{"type":"array","items":{"type":"string","format":"email"},"description":"Email addresses to monitor (sender filter)"},"subject_containing":{"type":"string","minLength":3,"maxLength":100,"description":"Text that must appear in the email subject"}},"required":["from","subject_containing"],"description":"Filtering criteria for incoming emails"},"monitored_events":{"type":"array","items":{"type":"string","enum":["created","updated","deleted"]},"description":"The types of changes to monitor"},"connected_account_id":{"type":"string","description":"ID of the connected Outlook account to monitor"}},"required":["filter","monitored_events","connected_account_id"],"description":"Configuration for the receive Outlook email"},"data":{"type":["object","null"],"properties":{"email":{"type":"string","description":"Email address being monitored"},"subscription":{"type":"object","properties":{"id":{"type":"string","description":"Subscription identifier"},"subscriptionId":{"type":"string","description":"Microsoft Graph subscription ID"},"expirationDateTime":{"type":"string","description":"ISO 8601 date when subscription expires"},"clientState":{"type":"string","description":"Client state value for webhook validation"},"notificationUrl":{"type":"string","description":"URL for webhook notifications"},"resource":{"type":"string","description":"Microsoft Graph resource path being monitored"},"changeType":{"type":"string","description":"Types of changes being monitored (created, updated, deleted)"},"creatorId":{"type":"string","description":"ID of the user who created the subscription"}},"required":["id","expirationDateTime","clientState","notificationUrl","resource","changeType"],"description":"Microsoft Graph subscription details"},"last_checked_at":{"type":["string","null"],"format":"date-time","description":"Timestamp of last check for new emails"},"job_id":{"type":"string","description":"ID of the background job handling this trigger"}},"required":["email","subscription","last_checked_at","job_id"],"description":"Data for the receive Outlook email"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_gmail_email"],"description":"Trigger type: receive Gmail email"},"config":{"type":"object","properties":{"filter":{"type":"object","properties":{"from":{"type":"array","items":{"type":"string","format":"email"},"description":"Email addresses to monitor (sender filter)"},"subject_containing":{"type":"string","minLength":3,"maxLength":100,"description":"Text that must appear in the email subject"},"label_ids":{"type":"array","items":{"type":"string"},"description":"Gmail label IDs to monitor (e.g., 'INBOX', 'SENT')"}},"required":["from","subject_containing","label_ids"],"description":"Filtering criteria for incoming emails"},"connected_account_id":{"type":"string","description":"ID of the connected Gmail account to monitor"}},"required":["filter","connected_account_id"],"description":"Configuration for the receive Gmail email"},"data":{"type":["object","null"],"properties":{"history_id":{"type":"string","description":"Gmail history ID for tracking changes since last check"},"expiration":{"type":"string","description":"ISO 8601 date when Gmail push notification expires"},"job_id":{"type":"string","description":"ID of the background job handling this trigger"},"email":{"type":"string","description":"Email address being monitored"}},"required":["history_id","expiration","job_id","email"],"description":"Data for the receive Gmail email"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_webhook"],"description":"Trigger type: fires on incoming webhook"},"config":{"type":"object","properties":{"secret":{"type":"string","description":"HMAC-SHA256 secret for signature verification"}},"description":"Configuration for the webhook trigger"},"data":{"type":["object","null"],"properties":{"webhook_path":{"type":"string","description":"Cryptographically random path for the webhook endpoint"}},"required":["webhook_path"],"description":"Webhook endpoint data including the random path"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["button_click"],"description":"Trigger type: fires when a button field is clicked"},"config":{"type":"object","properties":{"table_id":{"type":"string","description":"ID of the table containing the button field"},"field_key":{"type":"string","description":"Key of the button field"}},"required":["table_id","field_key"],"description":"Configuration for the button click trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["app_action"],"description":"Trigger type: fires when an app action is executed"},"config":{"type":"object","properties":{"app_id":{"type":"string","description":"ID of the app containing the action"},"action_id":{"type":"string","description":"ID of the action within the app"}},"required":["app_id","action_id"],"description":"Configuration for the app action trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]}]},"workflow":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}},"required":["trigger","workflow"]}}}}}}}},"/v1/automations/{trigger_id}":{"delete":{"summary":"Delete automation","parameters":[{"schema":{"type":"string"},"required":true,"name":"trigger_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"trigger_id":{"type":"string"},"workflow_id":{"type":["string","null"]},"deleted":{"type":"boolean","enum":[true]}},"required":["trigger_id","deleted"]}}}}}},"patch":{"summary":"Update automation","parameters":[{"schema":{"type":"string"},"required":true,"name":"trigger_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable or disable the automation"},"config":{"type":"object","additionalProperties":{},"description":"Trigger config (type-specific)"},"steps":{"type":"array","items":{},"description":"Workflow steps (replaces all existing steps)"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"trigger":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["recurring_schedule"],"description":"Trigger type: runs on a recurring schedule"},"config":{"type":"object","properties":{"cron_expression":{"type":"string","description":"The cron expression defining the schedule."}},"required":["cron_expression"],"description":"Schedule configuration with cron expression"},"data":{"type":["object","null"],"properties":{"job_scheduler_id":{"type":"string","description":"ID of the scheduled job in the job queue system"}},"required":["job_scheduler_id"],"description":"Job scheduler data for managing the recurring schedule"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["record_updated"],"description":"Trigger type: fires when a record is updated"},"config":{"type":"object","properties":{"table_id":{"type":"string","description":"ID of the table to monitor for updates"},"if":{"type":["string","null"],"description":"JS expression evaluated against the changelog. The trigger matches only if it evaluates to true. Available context is in the `TableRecordUpdateChangelog`."}},"required":["table_id"],"description":"Configuration for the record update trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_outlook_email"],"description":"Trigger type: receive Outlook email"},"config":{"type":"object","properties":{"filter":{"type":"object","properties":{"from":{"type":"array","items":{"type":"string","format":"email"},"description":"Email addresses to monitor (sender filter)"},"subject_containing":{"type":"string","minLength":3,"maxLength":100,"description":"Text that must appear in the email subject"}},"required":["from","subject_containing"],"description":"Filtering criteria for incoming emails"},"monitored_events":{"type":"array","items":{"type":"string","enum":["created","updated","deleted"]},"description":"The types of changes to monitor"},"connected_account_id":{"type":"string","description":"ID of the connected Outlook account to monitor"}},"required":["filter","monitored_events","connected_account_id"],"description":"Configuration for the receive Outlook email"},"data":{"type":["object","null"],"properties":{"email":{"type":"string","description":"Email address being monitored"},"subscription":{"type":"object","properties":{"id":{"type":"string","description":"Subscription identifier"},"subscriptionId":{"type":"string","description":"Microsoft Graph subscription ID"},"expirationDateTime":{"type":"string","description":"ISO 8601 date when subscription expires"},"clientState":{"type":"string","description":"Client state value for webhook validation"},"notificationUrl":{"type":"string","description":"URL for webhook notifications"},"resource":{"type":"string","description":"Microsoft Graph resource path being monitored"},"changeType":{"type":"string","description":"Types of changes being monitored (created, updated, deleted)"},"creatorId":{"type":"string","description":"ID of the user who created the subscription"}},"required":["id","expirationDateTime","clientState","notificationUrl","resource","changeType"],"description":"Microsoft Graph subscription details"},"last_checked_at":{"type":["string","null"],"format":"date-time","description":"Timestamp of last check for new emails"},"job_id":{"type":"string","description":"ID of the background job handling this trigger"}},"required":["email","subscription","last_checked_at","job_id"],"description":"Data for the receive Outlook email"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_gmail_email"],"description":"Trigger type: receive Gmail email"},"config":{"type":"object","properties":{"filter":{"type":"object","properties":{"from":{"type":"array","items":{"type":"string","format":"email"},"description":"Email addresses to monitor (sender filter)"},"subject_containing":{"type":"string","minLength":3,"maxLength":100,"description":"Text that must appear in the email subject"},"label_ids":{"type":"array","items":{"type":"string"},"description":"Gmail label IDs to monitor (e.g., 'INBOX', 'SENT')"}},"required":["from","subject_containing","label_ids"],"description":"Filtering criteria for incoming emails"},"connected_account_id":{"type":"string","description":"ID of the connected Gmail account to monitor"}},"required":["filter","connected_account_id"],"description":"Configuration for the receive Gmail email"},"data":{"type":["object","null"],"properties":{"history_id":{"type":"string","description":"Gmail history ID for tracking changes since last check"},"expiration":{"type":"string","description":"ISO 8601 date when Gmail push notification expires"},"job_id":{"type":"string","description":"ID of the background job handling this trigger"},"email":{"type":"string","description":"Email address being monitored"}},"required":["history_id","expiration","job_id","email"],"description":"Data for the receive Gmail email"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["receive_webhook"],"description":"Trigger type: fires on incoming webhook"},"config":{"type":"object","properties":{"secret":{"type":"string","description":"HMAC-SHA256 secret for signature verification"}},"description":"Configuration for the webhook trigger"},"data":{"type":["object","null"],"properties":{"webhook_path":{"type":"string","description":"Cryptographically random path for the webhook endpoint"}},"required":["webhook_path"],"description":"Webhook endpoint data including the random path"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["button_click"],"description":"Trigger type: fires when a button field is clicked"},"config":{"type":"object","properties":{"table_id":{"type":"string","description":"ID of the table containing the button field"},"field_key":{"type":"string","description":"Key of the button field"}},"required":["table_id","field_key"],"description":"Configuration for the button click trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the trigger"},"enabled":{"type":"boolean","description":"Whether the trigger is enabled"},"workflow_id":{"type":["string","null"],"description":"ID of the workflow this trigger dispatches to"},"workspace_id":{"type":"string","description":"ID of the workspace this trigger belongs to"},"created_at":{"type":"string","description":"Timestamp when trigger was created"},"updated_at":{"type":"string","description":"Timestamp of last update"},"type":{"type":"string","enum":["app_action"],"description":"Trigger type: fires when an app action is executed"},"config":{"type":"object","properties":{"app_id":{"type":"string","description":"ID of the app containing the action"},"action_id":{"type":"string","description":"ID of the action within the app"}},"required":["app_id","action_id"],"description":"Configuration for the app action trigger"},"data":{"type":"null","description":"No subscription data needed for this trigger"}},"required":["id","enabled","workspace_id","created_at","updated_at","type","config","data"]}]},"workflow":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the workflow"},"name":{"type":"string","description":"Display name of the workflow"},"description":{"type":"string","description":"Human-readable description of what this workflow does"},"steps":{"description":"Array of workflow steps (tool calls, conditionals, loops)"},"metadata":{"type":["object","null"],"properties":{"table_ids":{"type":"array","items":{"type":"string"},"description":"IDs of the tables this workflow affects"}},"required":["table_ids"],"description":"Metadata for the workflow"},"current_version":{"type":"integer","description":"Current version number"},"execution_mode":{"type":"string","enum":["steps","agent"],"description":"Execution mode: 'steps' (deterministic) or 'agent' (AI reasoning)"},"instructions":{"type":["string","null"],"description":"Agent instructions (null for steps mode)"},"tool_names":{"type":["array","null"],"items":{"type":"string"},"description":"Tool names available in agent mode (null for steps mode)"},"model_id":{"type":["string","null"],"description":"AI model ID for agent mode (null for steps mode)"},"enabled":{"type":"boolean","description":"Whether this workflow is active"},"workspace_id":{"type":"string","description":"ID of the workspace this workflow belongs to"},"created_at":{"type":"string","description":"Timestamp when workflow was created"},"updated_at":{"type":"string","description":"Timestamp of last update"}},"required":["id","name","description","current_version","execution_mode","instructions","tool_names","model_id","enabled","workspace_id","created_at","updated_at"]}},"required":["trigger","workflow"]}}}}}}},"/v1/skills":{"post":{"summary":"Create skill","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Name of the skill"},"description":{"type":"string","description":"Brief description of what the skill does"},"content":{"type":"string","description":"Detailed instructions/content of the skill"},"disable_agent_invocation":{"type":"boolean","description":"When true, agent cannot auto-invoke this skill. Useful for prompt templates with $ARGUMENTS."},"user_invocable":{"type":"boolean","description":"When false, skill is hidden from the composer picker. Useful for background knowledge."},"source":{"type":"string","enum":["chat","browser_extension"],"description":"Which agent surface this skill belongs to. Defaults to 'chat'."}},"required":["name","description","content"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"member_id":{"type":"string"},"disable_agent_invocation":{"type":"boolean"},"user_invocable":{"type":"boolean"},"active_by_default":{"type":"boolean"},"current_version":{"type":"integer"},"source":{"type":"string"},"workspace_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","content","member_id","disable_agent_invocation","user_invocable","active_by_default","current_version","source","workspace_id","created_at","updated_at"]}}}}}},"get":{"summary":"List skills","parameters":[{"schema":{"type":"boolean"},"required":false,"name":"user_invocable","in":"query"},{"schema":{"type":"string"},"required":false,"name":"source","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"member_id":{"type":"string"},"disable_agent_invocation":{"type":"boolean"},"user_invocable":{"type":"boolean"},"active_by_default":{"type":"boolean"},"current_version":{"type":"integer"},"source":{"type":"string"},"workspace_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","content","member_id","disable_agent_invocation","user_invocable","active_by_default","current_version","source","workspace_id","created_at","updated_at"]}}}}}}}},"/v1/skills/{skill_id}":{"delete":{"summary":"Delete skill","parameters":[{"schema":{"type":"string"},"required":true,"name":"skill_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"get":{"summary":"Get skill by ID","parameters":[{"schema":{"type":"string"},"required":true,"name":"skill_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"member_id":{"type":"string"},"disable_agent_invocation":{"type":"boolean"},"user_invocable":{"type":"boolean"},"active_by_default":{"type":"boolean"},"current_version":{"type":"integer"},"source":{"type":"string"},"workspace_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","content","member_id","disable_agent_invocation","user_invocable","active_by_default","current_version","source","workspace_id","created_at","updated_at"]}}}}}},"patch":{"summary":"Update skill","parameters":[{"schema":{"type":"string"},"required":true,"name":"skill_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Updated name"},"description":{"type":"string","description":"Updated description"},"content":{"type":"string","description":"Updated content"},"disable_agent_invocation":{"type":"boolean","description":"Updated agent invocation flag"},"user_invocable":{"type":"boolean","description":"Updated user invocable flag"},"active_by_default":{"type":"boolean","description":"When true, skill is active for all members by default. Admin only."},"source":{"type":"string","enum":["chat","browser_extension"],"description":"Which agent surface this skill belongs to."},"expected_version":{"type":"integer","description":"Expected current version for optimistic concurrency control"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"member_id":{"type":"string"},"disable_agent_invocation":{"type":"boolean"},"user_invocable":{"type":"boolean"},"active_by_default":{"type":"boolean"},"current_version":{"type":"integer"},"source":{"type":"string"},"workspace_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","content","member_id","disable_agent_invocation","user_invocable","active_by_default","current_version","source","workspace_id","created_at","updated_at"]}}}}}}},"/v1/instructions":{"post":{"summary":"Create instruction","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Name of the instruction"},"description":{"type":"string","description":"Brief description of when this instruction applies"},"content":{"type":"string","description":"The instruction content the agent must follow"},"scope":{"type":"string","enum":["workspace"],"description":"Instruction scope"},"table_id":{"type":"string","description":"Table to scope this instruction to"}},"required":["name","description","content","scope"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"table_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","table_id","current_version","created_at","updated_at"]}}}}}},"get":{"summary":"List instructions","parameters":[{"schema":{"type":"string","enum":["workspace","member"]},"required":false,"name":"scope","in":"query"},{"schema":{"type":"boolean"},"required":false,"name":"include_table_scoped","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"table_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","table_id","current_version","created_at","updated_at"]}}}}}}}},"/v1/instructions/{instruction_id}":{"delete":{"summary":"Delete instruction","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"get":{"summary":"Get instruction","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"table_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","table_id","current_version","created_at","updated_at"]}}}}}},"patch":{"summary":"Update instruction","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"content":{"type":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"table_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","table_id","current_version","created_at","updated_at"]}}}}}}},"/v1/instructions/{instruction_id}/versions":{"get":{"summary":"List instruction versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"instruction_id":{"type":"string"},"version":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"created_by":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","instruction_id","version","name","description","content","created_by","created_at"]}}}}}}}},"/v1/instructions/{instruction_id}/restore":{"post":{"summary":"Restore instruction version","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"description":"Version number to restore"}},"required":["version"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"table_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","table_id","current_version","created_at","updated_at"]}}}}}}},"/v1/member_instructions":{"post":{"summary":"Create personal instruction","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Name of the instruction"},"description":{"type":"string","description":"Brief description of when this instruction applies"},"content":{"type":"string","description":"The instruction content the agent must follow"}},"required":["name","description","content"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","current_version","created_at","updated_at"]}}}}}},"get":{"summary":"List personal instructions","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","current_version","created_at","updated_at"]}}}}}}}},"/v1/member_instructions/{instruction_id}":{"delete":{"summary":"Delete personal instruction","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"patch":{"summary":"Update personal instruction","parameters":[{"schema":{"type":"string"},"required":true,"name":"instruction_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"content":{"type":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"scope":{"type":"string","enum":["workspace","member"]},"member_id":{"type":["string","null"]},"current_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","scope","member_id","current_version","created_at","updated_at"]}}}}}}},"/v1/knowledge_docs":{"post":{"summary":"Create knowledge doc","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Name of the knowledge doc"},"description":{"type":"string","description":"Brief description of what this document covers"},"content":{"type":"string","description":"The knowledge doc content"},"files":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":{}}]}}},"required":["name","description","content"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"current_version":{"type":"integer"},"active_by_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","files","current_version","active_by_default","created_at","updated_at"]}}}}}},"get":{"summary":"List knowledge docs","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"current_version":{"type":"integer"},"active_by_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","files","current_version","active_by_default","created_at","updated_at"]}}}}}}}},"/v1/knowledge_docs/{knowledge_doc_id}":{"delete":{"summary":"Delete knowledge doc","parameters":[{"schema":{"type":"string"},"required":true,"name":"knowledge_doc_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"get":{"summary":"Get knowledge doc","parameters":[{"schema":{"type":"string"},"required":true,"name":"knowledge_doc_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"current_version":{"type":"integer"},"active_by_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","files","current_version","active_by_default","created_at","updated_at"]}}}}}},"patch":{"summary":"Update knowledge doc","parameters":[{"schema":{"type":"string"},"required":true,"name":"knowledge_doc_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"content":{"type":"string"},"active_by_default":{"type":"boolean"},"files":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":{}}]}},"expected_version":{"type":"integer"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"current_version":{"type":"integer"},"active_by_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","files","current_version","active_by_default","created_at","updated_at"]}}}}}}},"/v1/knowledge_docs/{knowledge_doc_id}/versions":{"get":{"summary":"List knowledge doc versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"knowledge_doc_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"knowledge_doc_id":{"type":"string"},"version":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"created_by":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","knowledge_doc_id","version","name","description","content","files","created_by","created_at"]}}}}}}}},"/v1/knowledge_docs/{knowledge_doc_id}/restore":{"post":{"summary":"Restore knowledge doc version","parameters":[{"schema":{"type":"string"},"required":true,"name":"knowledge_doc_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"description":"Version number to restore"}},"required":["version"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the file"},"file_storage_key":{"type":"string","description":"Storage key for the file"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type of the file"},"url":{"type":"string","description":"Public URL for the file, resolved at serving time"},"thumbnail_url":{"type":"string","description":"Thumbnail URL for image files, resolved at serving time"},"preview_url":{"type":"string","description":"Preview URL for legacy Excel files, resolved at serving time"}},"required":["id","file_storage_key","filename","mime_type"]}},"current_version":{"type":"integer"},"active_by_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workspace_id","name","description","content","files","current_version","active_by_default","created_at","updated_at"]}}}}}}},"/v1/memories":{"post":{"summary":"Create memory","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z][a-z0-9_]*$"},"description":{"type":"string","maxLength":500},"content":{"type":"string"}},"required":["key","description","content"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"workspace_id":{"type":"string"},"member_id":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","workspace_id","member_id","description","content","type","created_at","updated_at"]}}}}}},"get":{"summary":"List memories","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"workspace_id":{"type":"string"},"member_id":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","workspace_id","member_id","description","content","type","created_at","updated_at"]}}}}}}}},"/v1/memories/{memory_id}":{"delete":{"summary":"Delete memory","parameters":[{"schema":{"type":"string"},"required":true,"name":"memory_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"patch":{"summary":"Update memory","parameters":[{"schema":{"type":"string"},"required":true,"name":"memory_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":500},"content":{"type":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"workspace_id":{"type":"string"},"member_id":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","workspace_id","member_id","description","content","type","created_at","updated_at"]}}}}}}},"/v1/search":{"get":{"summary":"Global search","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query string"},"required":true,"description":"Search query string","name":"q","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["table"]},"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number"}},"required":["type","id","name","score"]},{"type":"object","properties":{"type":{"type":"string","enum":["view"]},"id":{"type":"string"},"name":{"type":"string"},"table_id":{"type":"string"},"table_name":{"type":"string"},"score":{"type":"number"}},"required":["type","id","name","table_id","table_name","score"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"id":{"type":"string"},"table_id":{"type":"string"},"table_name":{"type":"string"},"display_text":{"type":"string"},"view_id":{"type":"string"},"view_name":{"type":"string"},"score":{"type":"number"}},"required":["type","id","table_id","table_name","display_text","view_id","view_name","score"]}]}}},"required":["results"]}}}}}}},"/v1/api_keys":{"post":{"summary":"Create API key","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Display name for the API key"}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"plaintext_key":{"type":"string","description":"The plaintext API key value. Returned once and never retrievable again."},"api_key":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the API key"},"organization_id":{"type":"string","description":"Organization ID this API key belongs to"},"name":{"type":"string","description":"Display name for this API key"},"key_prefix":{"type":"string","description":"Non-secret prefix used to identify the key"},"enabled":{"type":"boolean","description":"Whether this API key is active"},"last_used_at":{"type":["string","null"],"description":"Timestamp when this key was last used"},"created_at":{"type":"string","description":"Timestamp when this API key was created"},"updated_at":{"type":"string","description":"Timestamp when this API key was last updated"}},"required":["id","organization_id","name","key_prefix","enabled","last_used_at","created_at","updated_at"],"description":"Persisted metadata for the created API key"}},"required":["plaintext_key","api_key"]}}}}}},"get":{"summary":"List API keys","responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the API key"},"organization_id":{"type":"string","description":"Organization ID this API key belongs to"},"name":{"type":"string","description":"Display name for this API key"},"key_prefix":{"type":"string","description":"Non-secret prefix used to identify the key"},"enabled":{"type":"boolean","description":"Whether this API key is active"},"last_used_at":{"type":["string","null"],"description":"Timestamp when this key was last used"},"created_at":{"type":"string","description":"Timestamp when this API key was created"},"updated_at":{"type":"string","description":"Timestamp when this API key was last updated"}},"required":["id","organization_id","name","key_prefix","enabled","last_used_at","created_at","updated_at"]}}}}}}}},"/v1/api_keys/{api_key_id}":{"patch":{"summary":"Update API key","parameters":[{"schema":{"type":"string"},"required":true,"name":"api_key_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Updated display name"},"enabled":{"type":"boolean","description":"Enable or disable this API key"}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the API key"},"organization_id":{"type":"string","description":"Organization ID this API key belongs to"},"name":{"type":"string","description":"Display name for this API key"},"key_prefix":{"type":"string","description":"Non-secret prefix used to identify the key"},"enabled":{"type":"boolean","description":"Whether this API key is active"},"last_used_at":{"type":["string","null"],"description":"Timestamp when this key was last used"},"created_at":{"type":"string","description":"Timestamp when this API key was created"},"updated_at":{"type":"string","description":"Timestamp when this API key was last updated"}},"required":["id","organization_id","name","key_prefix","enabled","last_used_at","created_at","updated_at"]}}}}}}},"/v1/approval_requests/locked_field_change":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"table_id":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":10000}},"required":["table_id","record_id","field_key","new_value","reason"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["workflow_step"]},"payload":{"type":"object","properties":{"workflow_execution_id":{"type":"string"},"execution_step_id":{"type":"string"},"waiting_step_id":{"type":"string"},"workflow_name":{"type":"string"}},"required":["workflow_execution_id","execution_step_id","waiting_step_id","workflow_name"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]},{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["locked_field_change"]},"payload":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"requested_by_member_id":{"type":"string"}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","requested_by_member_id"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]}]}}}}}}},"/v1/approval_requests/{approval_request_id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"approval_request_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["workflow_step"]},"payload":{"type":"object","properties":{"workflow_execution_id":{"type":"string"},"execution_step_id":{"type":"string"},"waiting_step_id":{"type":"string"},"workflow_name":{"type":"string"}},"required":["workflow_execution_id","execution_step_id","waiting_step_id","workflow_name"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]},{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["locked_field_change"]},"payload":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"requested_by_member_id":{"type":"string"}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","requested_by_member_id"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]}]}}}}}}},"/v1/approval_requests":{"get":{"parameters":[{"schema":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["workflow_step"]},"payload":{"type":"object","properties":{"workflow_execution_id":{"type":"string"},"execution_step_id":{"type":"string"},"waiting_step_id":{"type":"string"},"workflow_name":{"type":"string"}},"required":["workflow_execution_id","execution_step_id","waiting_step_id","workflow_name"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]},{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["locked_field_change"]},"payload":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"requested_by_member_id":{"type":"string"}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","requested_by_member_id"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]}]}}}}}}}},"/v1/approval_requests/{approval_request_id}/respond":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"approval_request_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approved","rejected"]},"comment":{"type":"string","maxLength":10000}},"required":["decision"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["workflow_step"]},"payload":{"type":"object","properties":{"workflow_execution_id":{"type":"string"},"execution_step_id":{"type":"string"},"waiting_step_id":{"type":"string"},"workflow_name":{"type":"string"}},"required":["workflow_execution_id","execution_step_id","waiting_step_id","workflow_name"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]},{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"organization_id":{"type":"string"},"approvers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Principal type: individual member"},"id":{"type":"string","description":"Member ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization_group"],"description":"Principal type: group of members"},"id":{"type":"string","description":"Organization group ID"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["organization"],"description":"Principal type: all members in organization"},"id":{"type":"string","description":"Organization ID"}},"required":["type","id"]}]}},"target_member_ids":{"type":"array","items":{"type":"string"}},"prompt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","timed_out"]},"decided_by":{"type":["string","null"]},"decided_at":{"type":["string","null"]},"decision_comment":{"type":["string","null"]},"timeout_in_minutes":{"type":["number","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","enum":["locked_field_change"]},"payload":{"type":"object","properties":{"table_id":{"type":"string"},"table_name":{"type":"string"},"record_id":{"type":"string"},"field_key":{"type":"string"},"field_name":{"type":"string"},"old_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"new_value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reason":{"type":"string"},"requested_by_member_id":{"type":"string"}},"required":["table_id","table_name","record_id","field_key","field_name","old_value","new_value","reason","requested_by_member_id"]}},"required":["id","workspace_id","organization_id","approvers","target_member_ids","prompt","status","decided_by","decided_at","decision_comment","timeout_in_minutes","created_at","updated_at","type","payload"]}]}}}}}}},"/v1/audit_logs":{"get":{"summary":"List audit logs","parameters":[{"schema":{"type":"string","enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc"]},"required":false,"name":"resource_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resource_id","in":"query"},{"schema":{"type":"string","enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc"]},"required":false,"name":"parent_resource_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"parent_resource_id","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"action","in":"query"},{"schema":{"type":"string"},"required":false,"name":"actor_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_before","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":["number","null"]},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":["string","null"]},"action":{"type":"string","enum":["record.create","record.update","record.delete","record.restore","record.lock","record.unlock","table.create","table.update","table.archive","field.create","field.update","field.delete","view.create","view.update","view.archive","iam.role_binding.assign","iam.role_binding.update","iam.role_binding.remove","iam.authorship.transfer","iam.group.create","iam.group.update","iam.group.delete","app.create","app.update","app.archive","skill.create","skill.update","skill.archive","automation.create","automation.update","automation.archive","document_template.create","document_template.update","document_template.archive","instruction.create","instruction.update","instruction.archive","instruction.restore","knowledge_doc.create","knowledge_doc.update","knowledge_doc.archive","knowledge_doc.restore"]},"actor_type":{"type":"string","enum":["member","api_key","system"]},"actor_id":{"type":"string"},"resource_type":{"type":"string","enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc"]},"resource_id":{"type":"string"},"parent_resource_type":{"type":["string","null"],"enum":["record","table","field","view","role_binding","group","app","skill","automation","document_template","instruction","knowledge_doc",null]},"parent_resource_id":{"type":["string","null"]},"change_origin":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["member"],"description":"Change originated from a member"},"member_id":{"type":"string","description":"Member ID of the user who modified"},"member_session_id":{"type":"string","description":"Session ID of the member at the time of modification"},"app_id":{"type":"string","description":"ID of the app through which the member acted"}},"required":["type","member_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["chat_agent"],"description":"Change originated from chat agent"},"on_behalf_member_id":{"type":"string","description":"ID of the member on whose behalf the chat agent acted"},"tool_call_id":{"type":"string","description":"ID of the tool call that the chat agent performed"}},"required":["type","on_behalf_member_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["button"],"description":"Change originated from a button click"},"table_id":{"type":"string","description":"ID of the table containing the button"},"record_id":{"type":"string","description":"ID of the record where the button was clicked"},"field_key":{"type":"string","description":"Key of the button field"},"clicked_by":{"type":"string","description":"ID of the member who clicked the button"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","table_id","record_id","field_key","clicked_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["submit_record"],"description":"Change originated from a draft record submission"},"table_id":{"type":"string","description":"ID of the table containing the record"},"record_id":{"type":"string","description":"ID of the record being submitted"},"submitted_by":{"type":"string","description":"ID of the member who submitted"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","table_id","record_id","submitted_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["app_action"],"description":"Change originated from an app action"},"app_id":{"type":"string","description":"ID of the app containing the action"},"action_id":{"type":"string","description":"ID of the action that was triggered"},"triggered_by":{"type":"string","description":"ID of the member who triggered the action"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"}},"required":["type","app_id","action_id","triggered_by"]},{"type":"object","properties":{"type":{"type":"string","enum":["automation"],"description":"Change originated from an automation (trigger + workflow)"},"trigger_type":{"type":"string","description":"Type of the trigger that initiated this automation"},"trigger_id":{"type":"string","description":"ID of the trigger that initiated this automation"},"workflow_id":{"type":"string","description":"ID of the workflow that executed"},"workflow_execution_id":{"type":"string","description":"ID of the workflow execution instance"},"automation_id":{"type":"string","description":"[Legacy] Use trigger_id instead"},"automation_execution_id":{"type":"string","description":"[Legacy] Use workflow_execution_id instead"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["system"],"description":"Change originated from system (Human system administrator/engineer)"},"author":{"type":"string","description":"Name of the system administrator/engineer"}},"required":["type","author"]},{"type":"object","properties":{"type":{"type":"string","enum":["validation"],"description":"Change originated from a record validation execution"},"table_id":{"type":"string","description":"ID of the table being validated"},"validation_id":{"type":"string","description":"ID of the validation that executed"}},"required":["type","table_id","validation_id"]},{"type":"null"}]},"details":{"type":["object","null"],"additionalProperties":{}},"ip_address":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"request_id":{"type":["string","null"]},"session_id":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","organization_id","workspace_id","action","actor_type","actor_id","resource_type","resource_id","parent_resource_type","parent_resource_id","change_origin","details","ip_address","user_agent","request_id","session_id","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["logs","next_cursor"]}}}}}}},"/v1/agent_context_activations":{"get":{"summary":"List agent context activations","parameters":[{"schema":{"type":"string","enum":["knowledge_doc","skill"]},"required":true,"name":"resource_type","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string"},"resource_type":{"type":"string","enum":["knowledge_doc","skill"]},"resource_id":{"type":"string"},"enabled":{"type":"boolean"}},"required":["member_id","resource_type","resource_id","enabled"]}}}}}}}},"/v1/agent_context_activations/{resource_type}/{resource_id}":{"put":{"summary":"Set agent context activation","parameters":[{"schema":{"type":"string","enum":["knowledge_doc","skill"]},"required":true,"name":"resource_type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"resource_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string"},"resource_type":{"type":"string","enum":["knowledge_doc","skill"]},"resource_id":{"type":"string"},"enabled":{"type":"boolean"}},"required":["member_id","resource_type","resource_id","enabled"]}}}}}}},"/v1/voice_sessions/{session_id}/complete":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chunk_count":{"type":"integer"},"duration_seconds":{"type":"integer"}},"required":["duration_seconds"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"status":{"type":"string"}},"required":["session_id","status"]}}}}}}},"/v1/voice_sessions/{session_id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"status":{"type":"string"},"duration_seconds":{"type":["number","null"]},"audio_url":{"type":["string","null"]},"transcript_text":{"type":["string","null"]},"speaker_count":{"type":["number","null"]},"error":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["session_id","status","duration_seconds","audio_url","transcript_text","speaker_count","error","created_at"]}}}}}}},"/v1/voice_sessions/{session_id}/urls":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"next_index":{"type":"number"}},"required":["next_index"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"presigned_urls":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":"string"}},"required":["index","url"]}}},"required":["presigned_urls"]}}}}}}},"/v1/voice_sessions/pending":{"get":{"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string"},"status":{"type":"string"},"duration_seconds":{"type":["number","null"]},"audio_url":{"type":["string","null"]},"transcript_text":{"type":["string","null"]},"speaker_count":{"type":["number","null"]},"error":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["session_id","status","duration_seconds","audio_url","transcript_text","speaker_count","error","created_at"]}}}}}}}},"/v1/voice_sessions/init":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mime_type":{"type":"string","enum":["audio/webm","audio/mp4"]},"language":{"type":["string","null"]}},"required":["mime_type"]}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"presigned_urls":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":"string"}},"required":["index","url"]}}},"required":["session_id","presigned_urls"]}}}}}}},"/v1/voice_sessions/{session_id}/retry":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"status":{"type":"string"}},"required":["session_id","status"]}}}}}}},"/v1/usage/events":{"get":{"summary":"Get paginated usage event log","parameters":[{"schema":{"type":["integer","null"],"maximum":0},"required":false,"name":"cycle_offset","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"service":{"type":"string"},"event_type":{"type":"string"},"model_id":{"type":["string","null"]},"member_id":{"type":["string","null"]},"input_tokens":{"type":["number","null"]},"output_tokens":{"type":["number","null"]},"audio_duration_seconds":{"type":["string","null"]},"price_usd":{"type":"string"},"created_at":{"type":"string"}},"required":["id","service","event_type","model_id","member_id","input_tokens","output_tokens","audio_duration_seconds","price_usd","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["events","next_cursor"]}}}}}}},"/v1/usage/member_detail":{"get":{"summary":"Get usage breakdown for a specific member","parameters":[{"schema":{"type":"string"},"required":true,"name":"member_id","in":"query"},{"schema":{"type":["integer","null"],"maximum":0},"required":false,"name":"cycle_offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"by_model":{"type":"array","items":{"type":"object","properties":{"model_id":{"type":"string"},"input_tokens":{"type":"number"},"output_tokens":{"type":"number"},"cost_usd":{"type":"string"}},"required":["model_id","input_tokens","output_tokens","cost_usd"]}},"transcription":{"type":"object","properties":{"duration_seconds":{"type":"number"},"cost_usd":{"type":"string"}},"required":["duration_seconds","cost_usd"]}},"required":["by_model","transcription"]}}}}}}},"/v1/usage/model_detail":{"get":{"summary":"Get daily usage breakdown for a specific model","parameters":[{"schema":{"type":"string"},"required":true,"name":"model_id","in":"query"},{"schema":{"type":["integer","null"],"maximum":0},"required":false,"name":"cycle_offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"input_tokens":{"type":"number"},"output_tokens":{"type":"number"},"cost_usd":{"type":"string"}},"required":["date","input_tokens","output_tokens","cost_usd"]}}},"required":["daily"]}}}}}}},"/v1/usage/summary":{"get":{"summary":"Get usage summary for a billing period","parameters":[{"schema":{"type":["integer","null"],"maximum":0},"required":false,"name":"cycle_offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"period_start":{"type":"string"},"period_end":{"type":"string"},"quota":{"type":["object","null"],"properties":{"ai_token_quota":{"type":["number","null"]},"transcription_quota_seconds":{"type":["number","null"]}},"required":["ai_token_quota","transcription_quota_seconds"]},"ai":{"type":"object","properties":{"total_input_tokens":{"type":"number"},"total_output_tokens":{"type":"number"},"total_cost_usd":{"type":"string"},"by_model":{"type":"array","items":{"type":"object","properties":{"model_id":{"type":"string"},"input_tokens":{"type":"number"},"output_tokens":{"type":"number"},"cost_usd":{"type":"string"}},"required":["model_id","input_tokens","output_tokens","cost_usd"]}}},"required":["total_input_tokens","total_output_tokens","total_cost_usd","by_model"]},"transcription":{"type":"object","properties":{"total_duration_seconds":{"type":"number"},"total_cost_usd":{"type":"string"}},"required":["total_duration_seconds","total_cost_usd"]},"by_member":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string"},"ai_input_tokens":{"type":"number"},"ai_output_tokens":{"type":"number"},"transcription_duration_seconds":{"type":"number"},"total_cost_usd":{"type":"string"}},"required":["member_id","ai_input_tokens","ai_output_tokens","transcription_duration_seconds","total_cost_usd"]}}},"required":["period_start","period_end","quota","ai","transcription","by_member"]}}}}}}},"/v1/workflow_executions/{execution_id}":{"get":{"summary":"Get workflow execution with steps","parameters":[{"schema":{"type":"string"},"required":true,"name":"execution_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workflow_id":{"type":"string"},"workspace_id":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","waiting","cancelled","returned"]},"error_message":{"type":["string","null"]},"return_status":{"type":["string","null"],"enum":["success","error",null]},"return_message":{"type":["string","null"]},"started_at":{"type":"string"},"completed_at":{"type":["string","null"]},"triggered_by_member_id":{"type":["string","null"]},"return_data":{"type":["object","null"],"additionalProperties":{}},"workflow_version":{"type":["number","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_id":{"type":"string"},"step_type":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","waiting","skipped"]},"input":{"type":["object","null"],"additionalProperties":{}},"output":{"type":["object","null"],"additionalProperties":{}},"error_message":{"type":["string","null"]},"started_at":{"type":"string"},"completed_at":{"type":["string","null"]}},"required":["id","step_id","step_type","status","input","output","error_message","started_at","completed_at"]}}},"required":["id","workflow_id","workspace_id","status","error_message","return_status","return_message","started_at","completed_at","triggered_by_member_id","return_data","workflow_version","steps"]}}}}}}},"/v1/workflow_executions":{"get":{"summary":"Query workflow executions","parameters":[{"schema":{"type":"string","description":"Filter by workflow ID"},"required":true,"description":"Filter by workflow ID","name":"workflow_id","in":"query"},{"schema":{"type":"string","enum":["running","completed","failed","waiting","cancelled","returned"],"description":"Filter by execution status"},"required":false,"description":"Filter by execution status","name":"status","in":"query"},{"schema":{"type":["number","null"],"description":"Max results (default 20, max 100)"},"required":false,"description":"Max results (default 20, max 100)","name":"limit","in":"query"},{"schema":{"type":["number","null"],"description":"Pagination offset"},"required":false,"description":"Pagination offset","name":"offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflow_id":{"type":"string"},"workspace_id":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","waiting","cancelled","returned"]},"error_message":{"type":["string","null"]},"return_status":{"type":["string","null"],"enum":["success","error",null]},"return_message":{"type":["string","null"]},"started_at":{"type":"string"},"completed_at":{"type":["string","null"]},"triggered_by_member_id":{"type":["string","null"]}},"required":["id","workflow_id","workspace_id","status","error_message","return_status","return_message","started_at","completed_at","triggered_by_member_id"]}}}}}}}},"/v1/browser_agent/sessions/{session_id}/archive":{"post":{"summary":"Archive browser agent session","parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}}},"/v1/browser_agent/{session_id}/messages":{"get":{"summary":"Get browser agent messages","parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{}}}}}}},"post":{"summary":"Send browser agent message","parameters":[{"schema":{"type":"string"},"required":true,"name":"session_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{}}}}}},"responses":{}}},"/v1/browser_agent/sessions":{"get":{"summary":"List browser agent sessions","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","created_at","updated_at"]}}}}}}}}},"webhooks":{}}