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

# Update Code Evaluation Criteria

> 
Update criteria-level metadata. Does not create a new version.



## OpenAPI

````yaml https://app.freeplay.ai/openapi.json patch /api/v2/projects/{project_id}/evaluation-criteria/code/{criteria_id}
openapi: 3.1.0
info:
  title: Freeplay API
  version: 0.1.0
servers: []
security:
  - BearerAuth: []
paths:
  /api/v2/projects/{project_id}/evaluation-criteria/code/{criteria_id}:
    patch:
      tags:
        - Evaluation Criteria
      summary: Update Code Evaluation Criteria
      description: |-

        Update criteria-level metadata. Does not create a new version.
      operationId: patch_patch_code_eval_criteria
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
        - name: criteria_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  default: null
                  title: Name
                  type:
                    - string
                    - 'null'
                description:
                  default: null
                  title: Description
                  type:
                    - string
                    - 'null'
                sample_rate:
                  default: null
                  title: Sample Rate
                  type:
                    - number
                    - 'null'
                generate_insights:
                  default: null
                  title: Generate Insights
                  type:
                    - boolean
                    - 'null'
              title: PatchCodeEvalRequest
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  id:
                    format: uuid
                    title: Id
                    type: string
                  name:
                    title: Name
                    type: string
                  description:
                    title: Description
                    type:
                      - string
                      - 'null'
                  target_type:
                    $ref: '#/components/schemas/TargetType'
                  target_id:
                    format: uuid
                    title: Target Id
                    type: string
                  criteria_type:
                    $ref: '#/components/schemas/AutoEvalCriteriaType'
                  sample_rate:
                    title: Sample Rate
                    type:
                      - number
                      - 'null'
                  is_enabled:
                    title: Is Enabled
                    type: boolean
                  generate_insights:
                    title: Generate Insights
                    type: boolean
                  deployed_version:
                    $ref: '#/components/schemas/CodeEvalVersionSummary'
                  latest_version:
                    $ref: '#/components/schemas/CodeEvalVersionSummary'
                required:
                  - id
                  - name
                  - description
                  - target_type
                  - target_id
                  - criteria_type
                  - sample_rate
                  - is_enabled
                  - generate_insights
                  - deployed_version
                  - latest_version
                title: CreateCodeEvalResponse
                type: object
          description: >-
            CreateCodeEvalResponse(id: uuid.UUID, name: str, description:
            Optional[str], target_type: shared.common.TargetType, target_id:
            uuid.UUID, criteria_type:
            shared.sqlalchemy.models.AutoEvalCriteriaType, sample_rate:
            Optional[float], is_enabled: bool, generate_insights: bool,
            deployed_version:
            server.api_routes.code_eval_criteria_api_v2.CodeEvalVersionSummary,
            latest_version:
            server.api_routes.code_eval_criteria_api_v2.CodeEvalVersionSummary)
components:
  schemas:
    TargetType:
      enum:
        - prompt
        - agent
      title: TargetType
      type: string
    AutoEvalCriteriaType:
      enum:
        - 1-5
        - 1-3
        - 1-100
        - yes-no
        - multi-select
        - text
        - auto-categorization
        - code-bool
        - code-float
      title: AutoEvalCriteriaType
      type: string
    CodeEvalVersionSummary:
      properties:
        id:
          format: uuid
          title: Id
          type: string
        version_number:
          title: Version Number
          type: integer
        eval_code:
          title: Eval Code
          type:
            - string
            - 'null'
        is_deployed:
          title: Is Deployed
          type: boolean
        created_at:
          title: Created At
          type: string
      required:
        - id
        - version_number
        - eval_code
        - is_deployed
        - created_at
      title: CodeEvalVersionSummary
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````