Database endpoints
Write a row
Insert a row or replace the row with the same primary key.
POST /v1/tenants/{tenant}/rows/{schema}
- Prepare the row fieldsMatch the registered table's columns and primary key.
- Write the rowIts key determines insertion or replacement.
- Check the write resultRead ok before continuing with dependent work.
Before you start
Use your database bearer token.
Register the destination table first. The example writes one row to demo.people.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
schema | string | Required |
Query parameters
| Field | Type | Required |
|---|---|---|
expect | string | Optional |
chunk | integer | Optional |
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
- One row keyed by column name;
- the table's manifest defines the columns.
- With ?expect=insert an existing primary key is rejected with 409.
- Honors Idempotency-Key.
| Field | Type | Required | Description |
|---|---|---|---|
Fields | object | Optional | One row keyed by column name; the table's manifest defines the columns. With ?expect=insert an existing primary key is rejected with 409. Honors Idempotency-Key. |
Read the result
ok: true confirms the write request. The primary key decides which row is inserted or replaced. Use expect=insert if an existing key should fail rather than be replaced.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 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. |
| 404 | Check the resource ID and API route. |
| 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. |
| 501 | Check deployment support for this operation. |
| 503 | Honor Retry-After when present; check write outcomes. |