Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.textql.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The v2 API is a REST-native interface to the TextQL platform. It replaces the Connect-RPC protocol used by v1 with standard HTTP methods, path parameters, and JSON request/response bodies. What’s different from v1:
  • Standard HTTP methods (GET, POST, PATCH, DELETE) instead of all-POST
  • Resource IDs in URL paths (/v2/playbooks/{id}) instead of request bodies
  • Query parameters for filtering and pagination
  • Plain JSON errors ({"error": {"code": "...", "message": "..."}})
  • SSE streaming via text/event-stream instead of Connect-RPC server streaming
  • No Connect-Protocol-Version header required

Base URL

https://app.textql.com/v2

Authentication

All requests require a Bearer token in the Authorization header:
curl "https://app.textql.com/v2/connectors" \
  -H "Authorization: Bearer YOUR_API_KEY"
Get your API key at app.textql.com/settings → Configuration → API Keys.

Quick Examples

Create a chat

curl -X POST "https://app.textql.com/v2/chats" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "What are the top 10 customers by revenue?", "connector_ids": [1]}'

Stream a chat

curl -X POST "https://app.textql.com/v2/chats/stream" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Summarize last quarter sales"}' \
  --no-buffer

List chats

curl "https://app.textql.com/v2/chats?limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

List playbooks

curl "https://app.textql.com/v2/playbooks?limit=10&status_filter=deployed" \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Handling

All errors return a consistent JSON envelope:
{
  "error": {
    "code": "not_found",
    "message": "playbook not found"
  }
}
HTTP StatusError CodeDescription
400invalid_requestMalformed request or missing required fields
401unauthenticatedMissing or invalid Bearer token
403permission_deniedInsufficient permissions for the requested resource
404not_foundResource does not exist
429rate_limit_exceededToo many requests
500internalUnexpected server error
504timeoutRequest timed out

Rate Limiting

All v2 endpoints are rate-limited per organization. When the limit is exceeded, the API returns a 429 status with the rate_limit_exceeded error code.