---
title: "Replace new document in a table"
method: POST
path: "/replace"
tags: ["Index"]
---

# Replace new document in a table

`POST /replace`

Replace an existing document. Input has same format as `insert` operation.
Responds with an object in format:

  ```
  {'table':'products','id':1,'created':false,'result':'updated','status':200}
  ```

## Request body

- InsertDocumentRequest — Object containing data for inserting a new document into the table
  - `table` string, required — Name of the table to insert the document into
  - `cluster` string — Name of the cluster to insert the document into
  - `id` integer
  - `doc` object, required — Object containing document data

## Response `200`

OK

- SuccessResponse — Response object indicating the success of an operation, such as inserting or updating a document
  - `table` string — Name of the document table
  - `id` integer
  - `created` boolean — Indicates whether the document was created as a result of the operation
  - `result` string — Result of the operation, typically 'created', 'updated', or 'deleted'
  - `found` boolean — Indicates whether the document was found in the table
  - `status` integer — HTTP status code representing the result of the operation

## Other responses

- `default` — error

## Changes

- **2026-08-04** `eb39c8083035` — 3 breaking, 1 info
  - added `#/components/schemas/documentId` to the `id` request property `allOf` list
  - the `id` request property type/format changed from `integer`/`uint64` to ``/``
  - the `id` response's property type/format changed from `integer`/`uint64` to ``/`` for status `200`
  - added `#/components/schemas/documentId` to the `id` response property `allOf` list for the response status `200`
- **2025-06-30** `1911b776f18a` — 2 breaking
  - the `id` request property type/format changed from `integer`/`int64` to `integer`/`uint64`
  - the `id` response's property type/format changed from `integer`/`int64` to `integer`/`uint64` for status `200`
- **2025-04-01** `0e6cccea382d` — 1 warning, 1 info
  - removed the optional property `_id` from the response with the `200` status
  - added the optional property `id` to the response with the `200` status
- **2025-02-13** `8f90aac993c7` — 1 breaking, 3 warning, 1 info
  - added the new required request property `table`
  - removed the request property `index`
  - removed the optional property `_index` from the response with the `200` status
  - removed the optional property `error/oneOf[#/components/schemas/responseErrorDetails]/index` from the response with the `default` status
  - …1 more
- …earlier changes not shown

[Full history](https://skmtc.dev/manticoresoftware/apis/manticore-search-client/changes/replace/post.md)

---

[API](https://skmtc.dev/manticoresoftware/apis/manticore-search-client.md) · [All operations](https://skmtc.dev/manticoresoftware/apis/manticore-search-client/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/manticoresoftware/manticore-search-client/revisions/eb39c8083035/schema)
