Database endpoints
Execute Cypher
Run an openCypher query and receive matching rows or write counts.
POST /v1/tenants/{tenant}/cypher
- Prepare the patternSupply Cypher and named parameter values.
- Execute the queryMatch graph patterns or apply the requested writes.
- Read the result kindDistinguish returned rows from write counts.
Before you start
Use your database bearer token.
For this example, register and populate demo.people. default_schema resolves node patterns that do not name a label.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | 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
- default_schema (namespace.table) is used for node patterns without a label.
- params supplies $name values as scalars (string, number, bool or null).
- explain=true (default false) returns the plan a read would run without executing it, and is refused with 400 for a query that writes.
| Field | Type | Required |
|---|---|---|
cypher | string | Required |
default_schema | string | Optional |
explain | boolean | Optional |
params | object | Optional |
Read the result
Check kind to distinguish returned rows from a write result. params supplies named values such as $name. explain: true previews a read plan and cannot be used to explain a write on this endpoint.
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. |
| 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. |
| 499 | The client cancelled the request. |
| 500 | Check the outcome before retrying a write. |
| 501 | Check deployment support for this operation. |
| 502 | Check service availability and the write outcome. |
| 503 | Honor Retry-After when present; check write outcomes. |