Database endpoints
Index JSON fields
Index the string values in a JSON document, optionally restricting which paths are searchable.
POST /v1/tenants/{tenant}/fts/{table}/{field}/json
- Supply the JSON documentKeep its source document ID.
- Choose searchable pathsOptionally restrict indexing with dotted paths.
- Index the selected stringsAn empty 201 response confirms the write.
Before you start
Use your database bearer token.
Choose the table, text field and JSON paths to index. The example uses demo_docs/body.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
table | string | Required |
field | string | Required |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
application/json
Limits and accepted values
- `paths` are dotted paths into `json`;
- empty or absent indexes every string leaf.
- Success is 201 with an empty body.
| Field | Type | Required |
|---|---|---|
doc_id | string | Required |
json | any JSON | Required |
paths | string[] | Optional |
Fields in paths
| Field | Type | Required |
|---|---|---|
paths | string | Optional |
Read the result
Success is 201 with an empty body. Only string leaves in the selected dotted paths are indexed; omitting paths indexes every string leaf in the supplied JSON.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 201 | Created |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 502 | Check service availability and the write outcome. |
| 503 | Honor Retry-After when present; check write outcomes. |