> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riftmap.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the dependency graph (full org or subgraph anchored at a repo).

> Return the dependency graph for a connected org.

Without ``root``: full graph for the org.

With ``root=<repo_id>``: subgraph anchored at that repo, including up to
``depth`` hops in both directions (upstream + downstream). Designed for AI
coding agents that want a focused neighbourhood instead of the whole org.

Nodes are repositories; edges are resolved dependencies from the most
recent completed scan. Format is G6-compatible.



## OpenAPI

````yaml /openapi.json get /api/v1/connected-orgs/{connected_org_id}/graph
openapi: 3.1.0
info:
  description: Change Impact Engine for multi-repo systems
  title: Riftmap
  version: 1.12.3
servers: []
security: []
paths:
  /api/v1/connected-orgs/{connected_org_id}/graph:
    get:
      tags:
        - graph
      summary: Get the dependency graph (full org or subgraph anchored at a repo).
      description: >-
        Return the dependency graph for a connected org.


        Without ``root``: full graph for the org.


        With ``root=<repo_id>``: subgraph anchored at that repo, including up to

        ``depth`` hops in both directions (upstream + downstream). Designed for
        AI

        coding agents that want a focused neighbourhood instead of the whole
        org.


        Nodes are repositories; edges are resolved dependencies from the most

        recent completed scan. Format is G6-compatible.
      operationId: get_graph_api_v1_connected_orgs__connected_org_id__graph_get
      parameters:
        - in: path
          name: connected_org_id
          required: true
          schema:
            format: uuid
            title: Connected Org Id
            type: string
        - description: >-
            Optional repository ID to anchor a subgraph view. When set, the
            response is limited to the root plus its upstream and downstream
            neighbours within ``depth`` hops. Omit for the full org graph.
          in: query
          name: root
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: >-
              Optional repository ID to anchor a subgraph view. When set, the
              response is limited to the root plus its upstream and downstream
              neighbours within ``depth`` hops. Omit for the full org graph.
            title: Root
        - description: >-
            BFS depth from ``root`` in each direction. Ignored when ``root`` is
            omitted.
          in: query
          name: depth
          required: false
          schema:
            default: 2
            description: >-
              BFS depth from ``root`` in each direction. Ignored when ``root``
              is omitted.
            maximum: 10
            minimum: 1
            title: Depth
            type: integer
        - description: >-
            Minimum edge confidence to traverse during subgraph BFS. Ignored
            when ``root`` is omitted.
          in: query
          name: min_confidence
          required: false
          schema:
            default: 0.8
            description: >-
              Minimum edge confidence to traverse during subgraph BFS. Ignored
              when ``root`` is omitted.
            maximum: 1
            minimum: 0
            title: Min Confidence
            type: number
        - in: header
          name: X-Workspace-Id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Workspace-Id
        - in: cookie
          name: riftmap_access
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Riftmap Access
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    GraphResponse:
      description: Full dependency graph for an organization (G6 compatible).
      properties:
        edges:
          items:
            $ref: '#/components/schemas/GraphEdge'
          title: Edges
          type: array
        nodes:
          items:
            $ref: '#/components/schemas/GraphNode'
          title: Nodes
          type: array
      required:
        - nodes
        - edges
      title: GraphResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    GraphEdge:
      description: A directed dependency edge between two repos.
      properties:
        confidence:
          title: Confidence
          type: number
        dependency_type:
          title: Dependency Type
          type: string
        id:
          title: Id
          type: string
        source:
          title: Source
          type: string
        target:
          title: Target
          type: string
        version_constraint:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Constraint
      required:
        - id
        - source
        - target
        - dependency_type
        - version_constraint
        - confidence
      title: GraphEdge
      type: object
    GraphNode:
      description: A repository node in the dependency graph.
      properties:
        id:
          title: Id
          type: string
        label:
          title: Label
          type: string
        metadata:
          additionalProperties: true
          default: {}
          title: Metadata
          type: object
        type:
          default: repository
          title: Type
          type: string
      required:
        - id
        - label
      title: GraphNode
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-Key
      type: apiKey
    HTTPBearer:
      description: API key as Bearer token (rfm_live_... prefix)
      scheme: bearer
      type: http

````