OriginChainDB
Database endpoints

Weighted shortest path

Returns the lowest total weight of a path between two nodes, using caller-supplied edge weights.

GET /v1/tenants/{tenant}/graph/{schema}/dijkstra

Calculate the least total travel costThis endpoint returns a cost, not the ordered route.
  1. Supply endpoints and weightsChoose the relation and caller-provided edge costs.
  2. Minimize the combined costEvaluate weighted routes between the selected nodes.
  3. Read the lowest costUse a path-returning endpoint if you need the route.

Before you start

Use your database bearer token.

Connection setup

Register the schema and relation, then add their rows. The examples use demo.people, its bidirectional follows relation, and linked rows u1, u2 and u3.

Path parameters

FieldTypeRequired
tenantstringRequired
schemastringRequired

Query parameters

FieldTypeRequired
relstringRequired
srcstringRequired
dststringRequired
weights_jsonstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Read the result

cost is the lowest total weight found between the selected nodes. This endpoint reports the cost, not an ordered node path. Use a path-returning endpoint when you need the route itself.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
408Reduce query work or adjust the timeout.
429Honor Retry-After when present; back off.
499The client cancelled the request.
500Check the outcome before retrying a write.
503Honor Retry-After when present; check write outcomes.
ยฉ 2026 Silicoyn Technologies Pvt Ltd