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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Read an experiment's setup

> The experiment's datasets, targets and evaluators, with the version to send back when you save. Ask for `fields=version` to check for changes without transferring the setup.



## OpenAPI

````yaml GET /api/experiments/{slug}/workbench-state
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/experiments/{slug}/workbench-state:
    get:
      tags:
        - Experiments
      summary: Read an experiment's setup
      description: >-
        The experiment's datasets, targets and evaluators, with the version to
        send back when you save. Ask for `fields=version` to check for changes
        without transferring the setup.
      operationId: getApiExperimentsBySlugWorkbenchState
      parameters:
        - in: query
          name: fields
          required: false
          schema:
            type: string
            enum:
              - version
          description: Set to `version` to answer with the version and timestamp only
        - schema:
            type: string
          in: path
          name: slug
          required: true
      responses:
        '200':
          description: The experiment's setup, or its version alone
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                      slug:
                        type: string
                      name:
                        type:
                          - string
                          - 'null'
                      state:
                        type:
                          - object
                          - 'null'
                        additionalProperties: {}
                        description: >-
                          The experiment setup: datasets, targets and
                          evaluators. Read it, change it, send it back whole.
                      version:
                        type: integer
                        description: Send this back as expectedVersion to save safely
                      updatedAt:
                        type: string
                        description: ISO 8601 timestamp of the last save
                    required:
                      - id
                      - slug
                      - name
                      - state
                      - version
                      - updatedAt
                  - type: object
                    properties:
                      id:
                        type: string
                      slug:
                        type: string
                      version:
                        type: integer
                      updatedAt:
                        type: string
                        description: ISO 8601 timestamp of the last save
                    required:
                      - id
                      - slug
                      - version
                      - updatedAt
        '400':
          description: >-
            The experiment is not an evaluations workbench
            (experiment_type_mismatch)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Stable failure code; branch on this
                  message:
                    type: string
                  fault:
                    type: string
                    description: >-
                      Who the failure is attributable to: customer, platform,
                      provider
                  tips:
                    type: array
                    items:
                      type: string
                  docsUrl:
                    type: string
                required:
                  - error
                additionalProperties: true
        '401':
          description: Missing or invalid API key, or the key lacks the permission
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Stable failure code; branch on this
                  message:
                    type: string
                  fault:
                    type: string
                    description: >-
                      Who the failure is attributable to: customer, platform,
                      provider
                  tips:
                    type: array
                    items:
                      type: string
                  docsUrl:
                    type: string
                required:
                  - error
                additionalProperties: true
        '404':
          description: No such experiment or run in this project
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Stable failure code; branch on this
                  message:
                    type: string
                  fault:
                    type: string
                    description: >-
                      Who the failure is attributable to: customer, platform,
                      provider
                  tips:
                    type: array
                    items:
                      type: string
                  docsUrl:
                    type: string
                required:
                  - error
                additionalProperties: true
      security:
        - project_api_key: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````