curl -X GET https://api.trellis.sh/v1/queries \ -H "Authorization: Bearer YOUR_TOKEN"
{ "queries": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "organization_id": "org_abc123", "title": "Monthly Revenue", "description": "Total revenue grouped by month for a given year", "prompt": "Show me total revenue by month for {{year}}", "sql": "SELECT DATE_TRUNC('month', created_at) AS month, SUM(amount) AS revenue FROM orders WHERE EXTRACT(year FROM created_at) = {{year}} GROUP BY 1 ORDER BY 1", "keywords": ["revenue", "monthly", "sales"], "parameters": ["year"], "last_updated_by": "member_xyz789", "last_updated_by_name": "John Doe", "created_at": "2025-11-01T10:00:00Z", "updated_at": "2025-12-01T15:30:00Z" } ]}
Use this file to discover all available pages before exploring further.
Saved queries allow your organization to store reusable, parameterized SQL queries paired with a natural language prompt. They can be invoked directly in chat messages to execute deterministic SQL without going through the AI agent.
Optional list of keywords used for automatic semantic matching. When a chat message’s content matches these terms, this query may be surfaced automatically.
Names of all {{param_name}} placeholders found in sql, auto-extracted by the server. Supply values for these when invoking the query via the Send Message endpoint.
ISO 8601 timestamp when the query was last modified.
curl -X GET https://api.trellis.sh/v1/queries \ -H "Authorization: Bearer YOUR_TOKEN"
{ "queries": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "organization_id": "org_abc123", "title": "Monthly Revenue", "description": "Total revenue grouped by month for a given year", "prompt": "Show me total revenue by month for {{year}}", "sql": "SELECT DATE_TRUNC('month', created_at) AS month, SUM(amount) AS revenue FROM orders WHERE EXTRACT(year FROM created_at) = {{year}} GROUP BY 1 ORDER BY 1", "keywords": ["revenue", "monthly", "sales"], "parameters": ["year"], "last_updated_by": "member_xyz789", "last_updated_by_name": "John Doe", "created_at": "2025-11-01T10:00:00Z", "updated_at": "2025-12-01T15:30:00Z" } ]}