HTTP API

Torque provides a Typesense v30.1 compatible REST API for collections, documents, search, and all management operations.

Base URL: http://localhost:8108 (configurable via --api-addr). All endpoints require the X-TYPESENSE-API-KEY header unless noted otherwise.

Health & Status

GET /health

Returns server status including version, license info, and available updates. No authentication required.

GET /health/ready

Readiness probe. Returns the number of collections ready vs. total. No authentication required.

GET /metrics

Prometheus-format metrics for monitoring. No authentication required.

GET /admin/stats

Memory breakdown per collection, including per-field index sizes (inverted, string filter, numeric filter, sort, geo, vector). Also available at /stats.json.

GET /debug

Debug information about the server (version, build, uptime).

GET /debug/malloc

Jemalloc memory allocator statistics (Linux only - returns zeros on Windows MSVC builds).

Collections

POST /collections

Create a new collection. See Collections for schema options.

GET /collections

List all collections with schemas and document counts.

GET /collections/{name}

Get a single collection’s schema and metadata.

PATCH /collections/{name}

Update a collection schema (add or drop fields). See Collections - Update Schema.

DELETE /collections/{name}

Delete a collection and all its data.

Documents

GET /collections/{name}/documents/search

Search documents. See Search for all parameters.

POST /collections/{name}/documents/import

Import documents in JSONL format. Supports ?action=create|upsert|update|emplace and return_doc=true. See Documents.

POST /collections/{name}/documents/import-binary

Import documents from a TQBF binary file. Send the file as the request body with Content-Type: application/octet-stream. Fastest bulk import method - a single HTTP POST imports the entire dataset with no per-document JSON parsing overhead. See Documents - Import Binary File.

GET /collections/{name}/documents/export

Export all documents as JSONL.

POST /collections/{name}/documents

Create a single document.

GET /collections/{name}/documents/{id}

Retrieve a single document by ID.

PATCH /collections/{name}/documents/{id}

Partially update a document (merge fields).

PATCH /collections/{name}/documents

Bulk update: merge the request body into every document matching ?filter_by=. The patch is schema-validated before anything is written.

DELETE /collections/{name}/documents/{id}

Delete a single document.

DELETE /collections/{name}/documents

Bulk delete documents matching a filter_by query parameter. Returns the count of deleted documents. filter_by is required; pass truncate=true to delete all documents.

POST /collections/{name}/documents/compact

Trigger index compaction for the collection.

POST /collections/{name}/suspend

Suspend realtime ingestion for a collection.

POST /collections/{name}/resume

Resume realtime ingestion for a collection.

Multi-Search

POST /multi_search

Execute multiple search queries in a single request.

POST /multi_search
Content-Type: application/json
X-TYPESENSE-API-KEY: YOUR_API_KEY

{
  "searches": [
    {"collection": "products", "q": "shoes", "query_by": "title"},
    {"collection": "articles", "q": "shoes", "query_by": "body"}
  ]
}

Pass "union": true to merge all searches into one ranked result set. Query-string parameters act as per-search defaults. See Search - Multi-Search.

Aliases

GET /aliases

List all collection aliases.

PUT /aliases/{name}

Create or update an alias.

{"collection_name": "products_v2"}

GET /aliases/{name}

Get a specific alias.

DELETE /aliases/{name}

Delete an alias.

Synonym Sets

GET /synonym_sets

List all synonym sets.

PUT /synonym_sets/{name}

Create or update a synonym set.

GET /synonym_sets/{name}

Get a synonym set.

DELETE /synonym_sets/{name}

Delete a synonym set.

GET /synonym_sets/{name}/items

List items in a synonym set.

PUT /synonym_sets/{name}/items/{id}

Create or update a synonym item.

GET /synonym_sets/{name}/items/{id}

Get a synonym item.

DELETE /synonym_sets/{name}/items/{id}

Delete a synonym item.

Presets

GET /presets

List all presets.

PUT /presets/{id}

Create or update a preset.

GET /presets/{id}

Get a preset.

DELETE /presets/{id}

Delete a preset.

Stopwords

GET /stopwords

List all stopword sets.

PUT /stopwords/{id}

Create or update a stopword set.

GET /stopwords/{id}

Get a stopword set.

DELETE /stopwords/{id}

Delete a stopword set.

Stemming Dictionaries

POST /stemming/dictionaries/import?id={id}

Import a custom stemming dictionary as JSONL {"word": "...", "root": "..."} pairs. Reference it from schema fields via stem_dictionary.

GET /stemming/dictionaries

List dictionary IDs.

GET /stemming/dictionaries/{id}

Get a dictionary's word/root pairs.

Curation Sets

Pin, hide, filter, and re-rank results for specific queries. Full CRUD at /curation_sets and /curation_sets/{name}/items/{id}. See Curation.

Analytics

Query analytics rules, event ingestion, and aggregation at /analytics/rules, /analytics/events, /analytics/flush, and /analytics/status. See Analytics.

Conversations & NL Search Models

LLM model registrations for conversational search (/conversations/models) and natural-language query translation (/nl_search_models). See AI & LLM Search.

Operations

POST /operations/snapshot

Persist all collections to disk; optionally copy a point-in-time snapshot to ?snapshot_path=.

POST /operations/db/compact

Compact all realtime collections.

POST /operations/cache/clear

Clear the search result cache.

GET /operations/schema_changes

List in-progress schema changes.

GET /metrics.json

Server metrics as JSON (Typesense-compatible shape).

POST /config

Update runtime configuration (currently the slow-query threshold: {"log-slow-requests-time-ms": 100}).

API Keys

POST /keys

Create a new API key. See API Keys.

GET /keys

List all API keys (metadata only, no full key values).

GET /keys/{id}

Get a specific API key’s metadata.

DELETE /keys/{id}

Delete an API key.

Studio

GET /api/studio/queries

List saved search queries.

POST /api/studio/queries

Save a search query.

DELETE /api/studio/queries/{id}

Delete a saved query.

License

POST /api/license/activate

Activate a license key. No authentication required.

POST /api/license/devices

List devices on the current license. No authentication required.

DELETE /api/license/devices/{id}

Remove a device from the license.

POST /api/license/deactivate

Deactivate the current license.

Error Responses

All error responses use a consistent format:

{"message": "error description"}
StatusMeaning
200Success
201Created
400Invalid input or malformed request
401Missing or invalid API key
403API key lacks permission for this action (e.g., write with a search-only key)
404Collection, document, or resource not found
409Conflict (collection already exists)
500Internal server error

CORS

The HTTP server allows cross-origin requests. Configure allowed origins with --cors-origins (default: *).

Request Limits

LimitDefaultConfiguration
HTTP body sizeUnlimited--max-http-body-bytes
Query text length4,096 charsHardcoded
Filter expression length4,096 charsHardcoded
Sort expression length2,048 charsHardcoded
Facet expression length2,048 charsHardcoded
Query timeout10,000 ms--query-timeout-ms