---
title: "GET /api/graphchain/shortestpath"
method: GET
path: "/api/graphchain/shortestpath"
tags: ["Graph Chain APIs"]
---

# GET /api/graphchain/shortestpath

`GET /api/graphchain/shortestpath`

<b>Allowed user roles:</b><br/><ul><li>sdzAdmin</li><li>sdzReadOnly</li><li>sdzUser</li></ul><br/><br/>Finds the shortest path (0..1) or shortest paths (0..*) between SDO IDs (v1 chain/id
and v2 chain/id).

User must specify a case-insensitive direction (IN, OUT, INOUT, OMNI).

Depth parameters are also required.

The optimizedShortestPath must be a minDepth of 0.  Also, for optimizedShortestPath
the ALL direction is not supported.  When optimizedShortestPath is specified than (0..1)
paths are returned; when not requested, then (0..*) paths are returned.

An optional graph traversal WHILE statement is available.

## Query parameters

- `v1Chain` string, required
- `v1SdoId` string, uuid, required
- `v2Chain` string, required
- `v2SdoId` string, uuid, required
- `direction` string, required
- `minDepth` integer, required
- `maxDepth` integer, required
- `whileStmt` string
- `optimizedShortestPath` boolean

## Response `200`

OK

---

[API](https://skmtc.net/burstiq/apis/lifegraph-apis.md) · [All operations](https://skmtc.net/burstiq/apis/lifegraph-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/burstiq/lifegraph-apis/revisions/381306ef1fcd/schema)
