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

# Validate state without starting an environment



## OpenAPI

````yaml /api-reference/openapi.json post /api/environments/{environmentId}/state/validate
openapi: 3.1.0
info:
  title: Archal API
  version: 1.0.0
  summary: >-
    Stateful testing environments with separate lifecycle and provider-scoped
    credentials
  description: >-
    Use a workspace credential for lifecycle operations. Each created
    environment returns a short-lived provider-shaped credential for its
    isolated data plane; the workspace credential is never forwarded to or
    accepted by provider-compatible endpoints.
servers:
  - url: https://api.archal.ai
security: []
paths:
  /api/environments/{environmentId}/state/validate:
    post:
      summary: Validate state without starting an environment
      operationId: validateEnvironmentState
      parameters:
        - name: environmentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 80
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
          text/sql:
            schema:
              type: string
              minLength: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema:
                    type: string
                    const: archal.environment-state-validation
                  version:
                    type: number
                    const: 1
                  environmentId:
                    type: string
                    minLength: 1
                    maxLength: 80
                  format:
                    type: string
                    enum:
                      - json
                      - sql
                  valid:
                    type: boolean
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                          minLength: 1
                        code:
                          type: string
                          minLength: 1
                      required:
                        - path
                        - message
                      additionalProperties: {}
                  contract:
                    anyOf:
                      - type: object
                        properties:
                          schema:
                            type: string
                            minLength: 1
                          version:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                        required:
                          - schema
                          - version
                        additionalProperties: false
                      - type: 'null'
                required:
                  - schema
                  - version
                  - environmentId
                  - format
                  - valid
                  - issues
                  - contract
                additionalProperties: false
        '400':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '401':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '403':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '404':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '409':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '413':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '415':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '429':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '500':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '502':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
        '503':
          description: The request was rejected
          headers:
            X-Request-Id:
              description: Request correlation identifier
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying when present
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  error:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                      additionalProperties: true
                additionalProperties: true
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Archal workspace API key
      description: Used by lifecycle, catalog, and state endpoints

````