REST API Reference

API Documentation

Rindexa is a sub-millisecond, multi-tenant search engine built in Rust. Integrate it into your SaaS with a simple REST API. All requests use Content-Type: application/json.

Base URL

https://api.rindexa.com
Bearer token auth for protected routes
No auth for public endpoints
POST /signup No Auth

Create Tenant

Create a new tenant account and receive an initial API key. This is your entry point to use Rindexa.

Request Body

Field Type Required Description
tenant_id string Yes Unique identifier (max 100 chars, alphanumeric, -, _)
email string Yes A valid email address
password string Yes Secure password (min 8 characters)
marketing_consent boolean No Opt-in for marketing emails (default: false)

Responses

201 Created — Returns tenant info and API key
400 Validation errors (invalid tenant_id, email, or short password)
409 User or tenant already exists
429 Global signup rate limit exceeded
500 Internal database error

Response Example

201 Created
{
  "tenant_id": "myapp",
  "email": "me@example.com",
  "plan": "free",
  "api_key": "rx_live_xxx",
  "prefix": "rx_live_xxx"
}

cURL Example

terminal
curl -X POST https://api.rindexa.com/signup \
  -H "Content-Type: application/json" \
  -d '{
    "tenant_id": "myapp",
    "email": "me@example.com",
    "password": "securepassword123",
    "marketing_consent": false
  }'
POST /auth/login No Auth

Dashboard Login

Authenticate with email and password to receive a JWT token for accessing dashboard endpoints.

Request Body

Field Type Required Description
email string Yes Your registered email address
password string Yes Your account password

Responses

200 OK — Returns JWT token for dashboard access
401 Invalid credentials
500 Server error

Response Example

200 OK
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

cURL Example

terminal
curl -X POST https://api.rindexa.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "me@example.com",
    "password": "securepassword123"
  }'
GET /tenants/me JWT

Get Tenant Stats

Retrieve detailed statistics for your tenant, including document count, search count, plan limits, and usage. Requires JWT authentication via Authorization: Bearer <jwt_token> header.

Responses

200 OK — Returns tenant statistics
401 Missing or invalid JWT token
500 Server error

Response Example

200 OK
{
  "tenant_id": "myapp",
  "plan": "free",
  "document_count": 127,
  "search_count": 3542,
  "total_document_count": 342,
  "document_limit": 1000,
  "search_limit": 100000,
  "created_at": "2026-01-15T10:30:00Z"
}

cURL Example

terminal
curl https://api.rindexa.com/tenants/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
POST /documents Bearer

Add Document

Add a new document to the tenant's search index. If a document with the same id exists, it will be overwritten. Strict validation is applied — unknown fields result in a 400 error.

Request Body

Field Type Required Description
title string Yes* Document title. Required if body is empty.
body string Yes* Document body text. Required if title is empty.
id string No Unique ID. Auto-generated as UUID v4 if omitted.
doc_type string No Category (defaults to "generic"). Cannot be empty.
search_text string No Additional text indexed for search.
tags string[] No Array of tags for filtering.
facets object No Key-value string pairs for facet filtering.
numeric object No String keys with f64 float values for range filtering.
flags string[] No Boolean-like flags for the document.
dates object No Date strings for chronological filtering.
payload object No Arbitrary JSON payload returned as-is with search results.

Responses

201 Created — Returns indexed document data
400 Missing both title and body, unknown fields, or empty doc_type
401 Missing or invalid API key
429 Rate limit exceeded
500 Server error during indexing

Response Example

201 Created
{
  "id": "doc1",
  "tenant_id": "myapp",
  "doc_type": "post",
  "title": "Hello World",
  "body": "This is my first post about Rust"
}

cURL Example

terminal
curl -X POST https://api.rindexa.com/documents \
  -H "Authorization: Bearer rx_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "doc1",
    "doc_type": "post",
    "title": "Hello World",
    "body": "This is my first post about Rust",
    "tags": ["rust", "tutorial"],
    "numeric": {"views": 0.0},
    "payload": {"author_id": 42}
  }'
POST /documents/bulk Bearer

Bulk Index Documents

Index multiple documents in a single request. Maximum 1,000 documents per batch. Each document follows the same schema as the single document endpoint. Validation occurs before any indexing to maintain consistency.

Request Body

Field Type Required Description
documents array Yes Array of document objects (max 1,000). Each follows the Add Document schema.

Responses

201 Created — Returns count of indexed documents
400 Batch size exceeds 1,000 or validation failed
401 Missing or invalid API key
429 Rate limit exceeded
500 Server error during bulk indexing

Response Example

201 Created
{
  "indexed": 3,
  "tenant_id": "myapp"
}

cURL Example

terminal
curl -X POST https://api.rindexa.com/documents/bulk \
  -H "Authorization: Bearer rx_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {
        "title": "First Document",
        "body": "Content of first doc",
        "tags": ["intro"]
      },
      {
        "title": "Second Document",
        "body": "Content of second doc",
        "tags": ["tutorial"]
      },
      {
        "title": "Third Document",
        "body": "Content of third doc",
        "tags": ["advanced"]
      }
    ]
  }'
DELETE /documents/:id Bearer

Delete Document

Delete an existing document from the search index using its unique identifier.

Path Parameters

Parameter Type Description
:id string The unique document ID to delete

Responses

204 No Content — Document deleted successfully
401 Missing or invalid API key
429 Rate limit exceeded
500 Internal error executing deletion

cURL Example

terminal
curl -X DELETE https://api.rindexa.com/documents/doc1 \
  -H "Authorization: Bearer rx_live_xxx"
POST /keys/rotate JWT

Rotate API Key

Rotate the API key for your tenant. The old key is invalidated immediately. Requires JWT authentication obtained from /auth/login. The tenant is automatically identified from the JWT token.

ℹ️ No Request Body Required

This endpoint doesn't require a request body. The tenant is automatically identified from the JWT token in the Authorization header.

Responses

200 OK — Returns new API key and prefix
401 Missing or invalid JWT token
500 Key rotation failed

Response Example

200 OK
{
  "tenant_id": "myapp",
  "api_key": "rx_live_newkey...",
  "prefix": "rx_live_newkey"
}

cURL Example

terminal
curl -X POST https://api.rindexa.com/keys/rotate \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"
GET /health No Auth

Health Check

Quick health check endpoint to monitor application uptime.

Responses

200 OK — Returns ok

cURL Example

terminal
curl https://api.rindexa.com/health