Skip to main content

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

Authentication

All requests require a Bearer token in the Authorization header:
Get your API key at app.textql.com/settings → Configuration → API Keys. Keys can also be minted programmatically with Create API Key: scope a key to specific roles, give it an expiry, and attach clientId metadata that TQL row-level security reads per request — the pattern for embedding and multi-tenant API access (see the embedding guide). Revoke keys with Revoke API Key.

Quick Examples

Create a chat

Stream a chat

List chats

List playbooks

Error Handling

All errors return a consistent JSON envelope:

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.