Store a batch of documents
curl --request POST \ --url https://api.grepvine.ai/v1/organizations/example/indexes/example/objects:batch \ --header 'Content-Type: application/x-ndjson' \ --header 'Idempotency-Key: example' \ --cookie __Host-grepvine-session=<__Host-grepvine-session> \ --data '"example"'Stores up to 2,048 documents. Each document is stored on its own: a document whose precondition
fails is not stored, the others are, and the result of each document says which happened. Retrying
with the same Idempotency-Key returns the same results and stores any document an interrupted
attempt did not reach. Batch content is text carried as JSON strings, so every document stored this
way is searchable. Store binary content, or a document over 16 MiB, with the
single-document endpoint. The body may be sent with Content-Encoding: gzip; the service decodes it
before applying the limits below, and answers any other content encoding with 415
unsupported_content_encoding.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”An account or organization name. Accounts and organizations share one namespace. A name keeps the case it was created with, and any spelling that differs only in case refers to it; no other account or organization can take such a spelling.
An index name, unique in its organization. A name keeps the case it was created with, and any spelling that differs only in case refers to it; no other index in the organization can take such a spelling.
Header Parameters
Section titled “Header Parameters”Required for a state change that uses cookie authentication.
Request Bodyrequired
Section titled “Request Bodyrequired”One PutObjectRecord JSON value per line; at most 2,048 records and 16 MiB of combined object content.
Example generated
exampleResponses
Section titled “Responses”The batch was applied. Each result reports one document, in request order.
object
The outcome of one document. A stored or deleted document has a revision; a document a batch did not change has an error instead.
object
object
Example generated
{ "results": [ { "key": "example", "revision": "example", "error": { "code": "example", "reason": "example", "error": "example" } } ]}The request conflicts with current state.
object
Example generated
{ "code": "example", "reason": "example", "error": "example"}Headers
Section titled “Headers”The request identifier used for support and audit correlation.
default
Section titled “default”The request failed. A 429 carries Retry-After; the index is busy absorbing recent writes or is out of request capacity, and clients must slow down and retry after the interval. A 403 with code organization_suspended refuses every operation on a suspended organization’s members, indexes, documents and searches; reading the organization itself still answers and reports suspended, and the client should contact support.
object
Example generated
{ "code": "example", "reason": "example", "error": "example"}Headers
Section titled “Headers”The request identifier used for support and audit correlation.
Seconds to wait before retrying. Sent with every 429 so a client slows down instead of failing.