POST /v2/indices/{index public key}/documents/

Create a new document to the index.

By default, the Documents API endpoint creates a random id for each new document. If you want to define the id for the document or generate the id using the URL field, use the Update Document endpoint.


The request body should be a JSON object describing the document contents.

  "custom_fields": {
    "title": "Example product",
    "description": "Description for example product",
    "price_cents": 599,
    "average_customer_rating": 4.5,
    "release_date": 1589200255
Standard fieldAny of the standard fields described here except the URL.Depends on the fieldEach field should be a separate key-value pair.
custom_fieldsTop levelA map of custom fields key value pairsSupported data-types: text, integer, and double.

Document fields

  • Standard fields: You can find more information on standards fields here.
  • Custom fields: A map of key value pairs for custom fields. Multiple datatypes are supported. See “Custom field data types” below.
 "id": "123",
 "url": "",
 "language": "en",
 "title": "An example article title",
 "main_content": "The text content of the article. The automatic highlight in search results will only be generated from the content of this field.",
 "custom_fields": {
   "image_url": "",
   "article_categories": ["Block post", "Article"]

Custom field data types

Data types for custom fields are automatically collected from the fields content/value. Supported data types are:

  • text
  • integer
  • double

Dates should be defined as UNIX timestamps with integer values.

Please note that once you have defined a specific data type for the custom field, the data type cannot be changed.

Indexing unsupported values will fail. If you have defined an unsupported data type, create a new custom field with a different name.


A request to create a new document adds the document to a queue. On success, the endpoint will return a response HTTP 201 Created, with a URL pointing to the created document in the response header “Location”. It might take a few seconds for the document to become available.

Was this helpful?

Need more help?

We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.