Skip to content

Index Admin API

Observability and maintenance for the search engine (Meilisearch). These endpoints power the Admin → Index page and are intended for troubleshooting indexing. All routes require manage:all (Super Administrator) permission, and the API key of the search engine is never returned.

Get Overview

Returns instance-level information (host, version, health, database size), metadata for the emails index (document count, primary key, indexing state, field distribution), and per-ingestion-source document counts taken directly from the search index's facet distribution — not the database.

Search engine overview

GET
/v1/index-admin/overview

Returns Meilisearch instance info (host, version, health, database size) and the emails index metadata (document count, primary key, indexing state, field distribution). Read-only. Requires manage:all (Super Admin) permission.

Authorizations

bearerAuth

JWT obtained from POST /v1/auth/login. Pass as Authorization: Bearer <token>.

Type
HTTP (bearer)
or
apiKeyAuth

API key generated via POST /v1/api-keys. Pass as X-API-KEY: <key>.

Type
API Key (header: X-API-KEY)

Responses

Search engine overview.

Playground

Authorization

Samples

Powered by VitePress OpenAPI

Get Tasks

Returns a cursor-paginated list of Meilisearch tasks for the emails index (e.g. documentAdditionOrUpdate), including status, received/indexed document counts, duration, timestamps, and any error. Filter with statuses and types, and page with limit + from (use the next cursor from the previous response).

Search engine task list

GET
/v1/index-admin/tasks

Returns a cursor-paginated list of Meilisearch tasks for the emails index, optionally filtered by status/type. Read-only. Requires manage:all (Super Admin) permission.

Authorizations

bearerAuth

JWT obtained from POST /v1/auth/login. Pass as Authorization: Bearer <token>.

Type
HTTP (bearer)
or
apiKeyAuth

API key generated via POST /v1/api-keys. Pass as X-API-KEY: <key>.

Type
API Key (header: X-API-KEY)

Parameters

Query Parameters

limit
Type
integer
Default
20
from

Cursor (task uid) to page from.

Type
integer
statuses

Comma-separated statuses (enqueued,processing,succeeded,failed,canceled).

Type
string
types

Comma-separated task types.

Type
string

Responses

Paginated task list.

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Clean Up Orphaned Documents

Queues a background sweep that removes documents from the emails index whose archived email no longer exists in the database.

These entries are left behind when a deletion removes the database row but its search index counterpart never completes — for example if the search engine was unavailable at the time. They appear to users as search results that cannot be opened. The sweep clears whole blocks first, for ingestion sources that were deleted, then compares the remaining document ids against the database one page at a time.

No emails, attachments or stored files are touched: the database and the stored .eml files are the archive's source of truth, and the index is rebuilt from them by a reindex. The response reports the surplus of index documents over archived emails as estimatedOrphans, which is a floor rather than an exact figure — emails archived but not yet indexed offset orphans one for one. The exact number removed is written to the worker log and the job's result on Admin → Jobs.

Only one sweep runs at a time. A request made while one is already queued or running joins it instead of starting a second, and says so via alreadyRunning in the response. Once a sweep has finished, the action can be triggered again — including after a failed run.

Remove orphaned search index documents

POST
/v1/index-admin/orphans/cleanup

Queues a background sweep that deletes documents from the emails index whose archived email no longer exists in the database. These are left behind when a deletion removes the database row but its search index counterpart never completes, and they surface as search results that cannot be opened. No emails, attachments or stored files are touched. Requires manage:all (Super Admin) permission.

Authorizations

bearerAuth

JWT obtained from POST /v1/auth/login. Pass as Authorization: Bearer <token>.

Type
HTTP (bearer)
or
apiKeyAuth

API key generated via POST /v1/api-keys. Pass as X-API-KEY: <key>.

Type
API Key (header: X-API-KEY)

Responses

Cleanup job accepted and queued.

application/json
JSON
{
  
"message": "string",
  
"estimatedOrphans": 0,
  
"workerAlive": true,
  
"alreadyRunning": true
}

Playground

Authorization

Samples

Powered by VitePress OpenAPI