Eden REST API

Query execution API

Source
ProtocolREST / JSON
Base path/api/v1
AuthenticationBearer token

Endpoint data requests use a typed operation inside request. The endpoint resource selects the backend kind. Operation types, parameter encodings and responses differ by protocol; fetch the live OpenAPI and consult the endpoint guide for your image.

Method and routePurpose
POST /api/v1/endpoints/{endpoint}/readPermitted read operation using the resolved data credential tier
POST /api/v1/endpoints/{endpoint}/writePermitted write operation
POST /api/v1/endpoints/{endpoint}/transactionEndpoint-specific transaction input; atomicity depends on the adapter

PostgreSQL read

With a configured PostgreSQL endpoint named mydb:

bash
curl --fail --silent --show-error \
  -H "Authorization: Bearer $EDEN_TOKEN" -H 'Content-Type: application/json' \
  --data '{"request":{"type":"SimpleQueryReadOnly","query":"SELECT 1 AS connected"}}' \
  "$EDEN_ORIGIN/api/v1/endpoints/mydb/read"

Parameterized query

PostgreSQL parameters are typed enum values, rather than an untyped JSON scalar array. For example, Text and Int4 select the Rust input variants:

json
{
  "request": {
    "type": "QueryReadOnly",
    "query": "SELECT $1::text AS label, $2::int AS quantity",
    "params": [{"Text": "sample"}, {"Int4": 10}]
  }
}

POST this body to /api/v1/endpoints/mydb/read. Use the appropriate SqlParam variant for each parameter (Null, Bool, integer/float types, Text, Bytes or Json). Explicit SQL casts can be necessary when the server cannot infer a parameter type.

PostgreSQL write

The Execute operation is a write and returns an affected-row result. Use a private disposable table when testing:

json
{
  "request": {
    "type": "Execute",
    "query": "INSERT INTO example_items (id, label) VALUES ($1, $2)",
    "params": [{"Int4": 1}, {"Text": "sample"}]
  }
}

POST it to /api/v1/endpoints/mydb/write. Table creation/schema management and write privileges must already be configured. An uncertain response does not prove the INSERT was rolled back; inspect the result before retrying.

Redis reads and writes

bash
curl --fail --silent --show-error \
  -H "Authorization: Bearer $EDEN_TOKEN" -H 'Content-Type: application/json' \
  --data '{"request":{"type":"Set","key":"eden:example","value":"hello"}}' \
  "$EDEN_ORIGIN/api/v1/endpoints/cache/write"

curl --fail --silent --show-error \
  -H "Authorization: Bearer $EDEN_TOKEN" -H 'Content-Type: application/json' \
  --data '{"request":{"type":"Get","key":"eden:example"}}' \
  "$EDEN_ORIGIN/api/v1/endpoints/cache/read"

See the command catalog and session/migration restrictions. RAW_COMMAND and RAW_COMMAND_READ_ONLY are Eden API input operations, not literal native Redis commands and not a bypass of policy or session safety.

Responses and cancellation

There is no universal status/data success wrapper. Protocol outputs can be rows, scalar results or encoded wire data; cardinality also affects PostgreSQL row output. Parse the specific schema and preserve errors. A SQL row result is not a Redis response schema.

Set client deadlines and bounded concurrency. Cancellation/disconnect after sending an effectful operation can leave its outcome unknown. Use only the endpoint's documented cancellation mechanism; a client timeout is not a durable rollback acknowledgement. Reliable API clients covers safe retries, HA acceptance, idempotency and pagination.

For transaction shapes and actual adapter guarantees, use Transaction APIs; do not infer cross-database atomicity from the existence of an endpoint transaction route.

Help improve Eden Docs

Find something unclear or incomplete? Review the source and propose an update.

View on GitLab Updated November 4, 2026