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

# Preview Experiment Backend

> Check whether a UCP protocol can be run on the PyBaMM backend.

The frontend uses this to gate the simulation backend selector — when
the protocol is not PyBaMM-compatible, users are forced onto the UCP
backend.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /optimize/preview-experiment-backend
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /optimize/preview-experiment-backend:
    post:
      tags:
        - optimization
      summary: Preview Experiment Backend
      description: |-
        Check whether a UCP protocol can be run on the PyBaMM backend.

        The frontend uses this to gate the simulation backend selector — when
        the protocol is not PyBaMM-compatible, users are forced onto the UCP
        backend.
      operationId: preview_experiment_backend_optimize_preview_experiment_backend_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentBackendPreviewRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentBackendPreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExperimentBackendPreviewRequest:
      properties:
        experiment:
          type: string
          title: Experiment
          description: UCP protocol YAML string
      type: object
      required:
        - experiment
      title: ExperimentBackendPreviewRequest
      description: Request body for previewing simulation backend compatibility.
    ExperimentBackendPreviewResponse:
      properties:
        pybamm_compatible:
          type: boolean
          title: Pybamm Compatible
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - pybamm_compatible
      title: ExperimentBackendPreviewResponse
      description: >-
        Compatibility report for a UCP protocol against the PyBaMM backend.


        The PyBaMM backend converts UCP protocols to ``pybamm.Experiment``
        objects.

        Some UCP features (loops, conditionals, EIS, expression-driven values)
        are

        not representable in a PyBaMM experiment, in which case the user must
        run

        on the UCP backend instead.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````