Skip to content
grepvine.aiJoin preview

Store one document

PUT
/organizations/{organization}/indexes/{index}/objects
Code sample: Shell / cURL
curl --request PUT \
--url https://api.grepvine.ai/v1/organizations/example/indexes/example/objects \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: example' \
--header 'If-None-Match: *' \
--cookie __Host-grepvine-session=<__Host-grepvine-session> \
--form key=example \
--form metadata=example \
--form content=@file

Stores one document of at most 1 GiB. Content that is valid UTF-8 and at most 100 MiB is searchable. Any other content, such as an image or a larger file, is stored, listed, and served by the document endpoints but is never matched by a search. The searchable field of a listing reports which applies.

organization
required

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.

string
/^[A-Za-z][A-Za-z0-9-]{2,62}$/
index
required

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.

string
/^[A-Za-z][A-Za-z0-9-]{0,62}$/
Idempotency-Key
required
string
>= 16 characters <= 128 characters
If-Match
string
<= 256 characters
If-None-Match
string
Allowed value: *
X-Csrf-Token
string
>= 16 characters <= 256 characters

Required for a state change that uses cookie authentication.

Media typemultipart/form-data
object
key
required
string
<= 1024 characters
metadata

A Metadata JSON object.

string
content
required

The document bytes, at most 1 GiB. Valid UTF-8 of at most 100 MiB is searchable; other content is stored without being searchable.

string format: binary

The document was stored.

Media typeapplication/json

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
key
required
string
revision
string
error
object
code
required
string
reason
required
string
error
required
string

Example generated

{
"key": "example",
"revision": "example",
"error": {
"code": "example",
"reason": "example",
"error": "example"
}
}

The request conflicts with current state.

Media typeapplication/json
object
code
required
string
reason
required
string
error
required
string

Example generated

{
"code": "example",
"reason": "example",
"error": "example"
}
X-Request-Id
string

The request identifier used for support and audit correlation.

A revision precondition failed.

Media typeapplication/json
object
code
required
string
reason
required
string
error
required
string

Example generated

{
"code": "example",
"reason": "example",
"error": "example"
}
X-Request-Id
string

The request identifier used for support and audit correlation.

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.

Media typeapplication/json
object
code
required
string
reason
required
string
error
required
string

Example generated

{
"code": "example",
"reason": "example",
"error": "example"
}
X-Request-Id
string

The request identifier used for support and audit correlation.

Retry-After
integer

Seconds to wait before retrying. Sent with every 429 so a client slows down instead of failing.