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

# Get environment module graph

> Returns the module dependency graph for an environment: module instance nodes, producer to consumer edges with the outputs each edge consumes, and version-mismatch messages.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /environments/{id}/module-graph
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /environments/{id}/module-graph:
    get:
      tags:
        - Environments
      summary: Get environment module graph
      description: >-
        Returns the module dependency graph for an environment: module instance
        nodes, producer to consumer edges with the outputs each edge consumes,
        and version-mismatch messages.
      operationId: GetModuleGraph
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/ModuleGraph'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    ModuleGraph:
      additionalProperties: false
      description: The module dependency graph for an environment.
      properties:
        edges:
          description: Producer to consumer dependency edges.
          items:
            $ref: '#/components/schemas/ModuleGraphEdge'
          type: array
        nodes:
          description: >-
            Module instance nodes, plus external nodes for cross-environment
            producers.
          items:
            $ref: '#/components/schemas/ModuleGraphNode'
          type: array
      required:
        - nodes
        - edges
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    ModuleGraphEdge:
      additionalProperties: false
      description: >-
        A producer to consumer dependency edge, including the producer stack
        outputs the consumer reads.
      properties:
        consumedFields:
          description: Producer stack output keys this edge consumes.
          items:
            type: string
          type: array
        crossEnv:
          description: >-
            True when the producer lives in a different environment than the
            consumer.
          type: boolean
        id:
          description: Stable edge id.
          type: string
        messages:
          description: >-
            Messages attached to this edge (dropped outputs, producer not yet
            applied).
          items:
            $ref: '#/components/schemas/ModuleGraphMessage'
          type: array
        refInputId:
          description: The consumer reference input id that created this edge.
          type: string
        source:
          description: Producer module instance id (the dependency).
          type: string
        target:
          description: Consumer module instance id (the dependent).
          type: string
      required:
        - id
        - source
        - target
        - refInputId
        - consumedFields
        - crossEnv
        - messages
      type: object
    ModuleGraphNode:
      additionalProperties: false
      description: >-
        A module instance in the dependency graph, or an external
        cross-environment producer.
      properties:
        givenId:
          description: >-
            User-assigned instance identifier, unique within the environment
            (e.g. vpc, api, web).
          type: string
        id:
          description: Module instance id.
          type: string
        kind:
          description: >-
            Node kind: module for an instance in this environment, or external
            for a producer in another environment.
          type: string
        messages:
          description: >-
            Messages attached to this node (dangling references, new version
            available).
          items:
            $ref: '#/components/schemas/ModuleGraphMessage'
          type: array
        moduleType:
          description: Module type (the module definition type).
          type: string
        moduleVersionId:
          description: Selected module version id.
          type: string
        name:
          description: Module instance name.
          type: string
        version:
          description: Selected module version label.
          type: string
      required:
        - id
        - name
        - givenId
        - moduleType
        - version
        - moduleVersionId
        - kind
        - messages
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    ModuleGraphMessage:
      additionalProperties: false
      description: >-
        A structured module graph message. The user-facing copy is rendered
        client-side from these fields so wording can change without an API
        deploy.
      properties:
        category:
          allOf:
            - $ref: '#/components/schemas/ModuleGraph.MessageCategory'
          description: The kind of message.
        field:
          description: The producer output key this message concerns, when applicable.
          type: string
        level:
          allOf:
            - $ref: '#/components/schemas/ModuleGraph.MessageLevel'
          description: The level of the message.
        producerInstanceId:
          description: >-
            The producer module instance id this message concerns, when
            applicable.
          type: string
        refInputId:
          description: >-
            The consumer reference input id this message concerns, when
            applicable.
          type: string
      required:
        - category
        - level
      type: object
    ModuleGraph.MessageCategory:
      description: >-
        The kind of module graph message. DANGLING_REF: a reference points at a
        module that no longer exists. OUTPUT_DROPPED: a required producer output
        the consumer reads is not provided by the producer's latest apply (the
        consumer's deploy will fail). PRODUCER_NOT_APPLIED: a dependency has not
        deployed yet. NEW_VERSION_AVAILABLE: a newer module version is
        available.
      enum:
        - DANGLING_REF
        - OUTPUT_DROPPED
        - PRODUCER_NOT_APPLIED
        - NEW_VERSION_AVAILABLE
      type: string
    ModuleGraph.MessageLevel:
      description: >-
        The level of a module graph message: error blocks a successful deploy,
        warning is a non-blocking concern, info is advisory.
      enum:
        - error
        - warning
        - info
      type: string
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````