Skip to navigation

Import From Algolia

Copy an Algolia index into this index: send an export of it, or read access to it. Importing into an index that already has records deletes all of them and adds the Algolia records in their place. Read access answers 202 with an import job that builds the index when it ends. An export answers 200 with what was mapped; send build: true to start the build too. Importing into a new index takes a write key for every index. Algolia keys are never stored.

Authentication

AuthorizationBearer

A write key, issued by Captain. Server side only. Sent as Authorization: Bearer <key>.

Path parameters

indexstringRequiredformat: "^[a-z0-9][a-z0-9_-]{0,47}$"
index name

Headers

Idempotency-KeystringOptional<=255 characters

Replays within 24 hours return the stored response (header Idempotent-Replayed: true). The same key on a different request answers 422. A concurrent duplicate answers 409. Failed requests do not keep the key.

Request

This endpoint expects an object.
exportobjectRequired
OR
pullobjectRequired

Response headers

X-Captain-Applied-Seqinteger

the last update seq search had applied when this request started; the answer reflects at least that much (GET …/updates applied_seq). Not on 401 or 403, nor for an index this server does not have

X-Captain-Index-IncarnationstringOptional

the index’s incarnation, an opaque string: it changes only when the index is deleted and created again (whose seqs start again at 1), or restored from a backup (whose seqs continue from the backup’s). Sent with X-Captain-Applied-Seq

Response

An export: the records were added, with what was mapped. The build starts only with build: true (build_job).

schemaobjectOptional

flexible schema: one entry per (dotted) field

facetslist of stringsOptional
reportobjectOptional
countsobjectOptional

per section {mapped, approximated, not_mapped}, and records

fieldsmap from strings to objectsOptional
noteslist of stringsOptional

what could not be read (for example no settings ACL)

sourcestringOptional
recordsintegerOptional
build_jobstring or nullOptional
build_notestringOptional
dry_runbooleanOptional

true: a preview. Nothing was stored; records counts the records that would be added

settingsobjectOptional

with object_search: the settings the Algolia settings mapped to

effectiveobjectOptional

object_search: the field table the next build uses