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. 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).

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.

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"}
  ]
}

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.

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
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 size128 MB--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