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

# Update Test Expectation

> Update a specific workflow test expectation by its ID.



## OpenAPI

````yaml patch /apps/{app_id}/workflows/{workflow_id}/tests/expectations/{expectation_id}
openapi: 3.0.0
info:
  version: 1.0.0
  title: API
servers: []
security: []
paths:
  /apps/{app_id}/workflows/{workflow_id}/tests/expectations/{expectation_id}:
    patch:
      summary: Update Test Expectation
      description: Update a specific workflow test expectation by its ID.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the app
          name: app_id
          in: path
        - schema:
            type: string
          required: true
          description: The ID of the workflow
          name: workflow_id
          in: path
        - schema:
            type: string
          required: true
          description: The ID of the expectation
          name: expectation_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkflowExpectationSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateWorkflowExpectationSchema'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowExpectationSchema'
components:
  schemas:
    UpdateWorkflowExpectationSchema:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
          description: Name of the expectation (max 256 characters)
        script:
          type: string
          maxLength: 10240
          description: >-
            JavaScript code that results in a boolean value determining if the
            expectation passed or failed
      description: Detailed information about an expectation within a workflow
    WorkflowExpectationSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the expectation
        name:
          type: string
          minLength: 1
          maxLength: 256
          description: Name of the expectation (max 256 characters)
        script:
          type: string
          maxLength: 10240
          description: >-
            JavaScript code that results in a boolean value determining if the
            expectation passed or failed
        created_at:
          type: string
          nullable: true
          description: Creation date of the expectation
          format: date
        updated_at:
          type: string
          nullable: true
          description: Last update date of the expectation
          format: date
      required:
        - id
        - name
        - script
        - created_at
        - updated_at
      description: Detailed information about an expectation within a workflow

````