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

# Validate model YAML

> Validate a YAML string against a model's config without persisting. Performs multi-layer validation including YAML syntax, structure, business logic, and simulation readiness.



## OpenAPI

````yaml POST /models/{model_id}/yaml_validate
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /models/{model_id}/yaml_validate:
    post:
      summary: Validate model YAML
      description: >-
        Validate a YAML string against a model's config without persisting.
        Performs multi-layer validation including YAML syntax, structure,
        business logic, and simulation readiness.
      operationId: validate-model-yaml
      parameters:
        - name: model_id
          in: path
          description: Model friendly ID (e.g., mdl_abc123def456)
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - yaml
              properties:
                yaml:
                  type: string
                  description: YAML content to validate
            examples:
              Result:
                value:
                  yaml: |
                    nexus:
                      - name: Net Carbon Removal
                        formula: input_1 - input_2
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Valid:
                  value:
                    valid: true
                    errors: []
                    warnings: []
                Invalid:
                  value:
                    valid: false
                    errors:
                      - type: syntax_error
                        message: Invalid YAML syntax at line 3
                        line: 3
                        column: 5
                    warnings:
                      - type: best_practice
                        message: Consider adding a description to the node
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        message:
                          type: string
                        line:
                          type: integer
                          nullable: true
                        column:
                          type: integer
                          nullable: true
                  warnings:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        message:
                          type: string
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````