# Bring the semantic search index up to date: embed the notes changed since the last run (the

`POST /datanotes/operations/sync_semantic_index/` (operation `sync_semantic_index`)

Bring the semantic search index up to date: embed the notes changed since the last run (the
engine also does it on its own about ten seconds after edits). `rebuild: true` re-embeds
everything: slow, and costs money with a paid provider — ask first.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Datanotes-Actor` | header | `string` | no | JSON: on whose behalf the write is made, recorded in the journal (`harness`, `model`, `session`). |

## Request body

`application/json`

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `rebuild` | `boolean` | no | `false` | Re-embed every note, not only the changed ones. |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Done. | `SemanticSyncResult` (application/json) |
| 400 | Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type. | `Error` (application/json) |
| 401 | Missing or wrong bearer token. | `Error` (application/json) |
| 403 | A named token beyond its permissions (the engine's administration, tables outside its `write` patterns, schema changes without `ddl`). | `Error` (application/json) |
| 500 | Unexpected error. | `Error` (application/json) |

The schemas named here are in [openapi.json](https://datanotes.dev/openapi.json) (`components.schemas`).
