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

# Create Eval

> Create an eval for an agent.

Evals are the criteria used to grade calls after analysis. `scoring_type` is
either `PASS_FAIL` for a boolean check or `SCORE_1_5` for a rating, and
`rule_logic` describes what to evaluate.

An agent needs at least one `PASS_FAIL` eval before it can run simulations.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json post /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/evals
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/evals:
    post:
      tags:
        - agent-settings
      summary: Create Eval
      description: >-
        Create an eval for an agent.


        Evals are the criteria used to grade calls after analysis.
        `scoring_type` is

        either `PASS_FAIL` for a boolean check or `SCORE_1_5` for a rating, and

        `rule_logic` describes what to evaluate.


        An agent needs at least one `PASS_FAIL` eval before it can run
        simulations.
      operationId: >-
        create_eval_api_v1_workspaces__workspace_id__agents__agent_id__settings_evals_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvalInput'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvalResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent not found.
          content:
            application/json:
              example:
                detail: Agent with ID 17 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: An eval with this name already exists for the agent.
          content:
            application/json:
              example:
                detail: >-
                  Eval with name 'Verified caller identity' already exists for
                  this agent
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    EvalInput:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        scoring_type:
          type: string
          pattern: ^(PASS_FAIL|SCORE_1_5)$
          title: Scoring Type
          description: >-
            `PASS_FAIL` for a yes/no check, `SCORE_1_5` for a 1–5 rating.
            Simulations require at least one `PASS_FAIL` eval.
        rule_logic:
          type: string
          minLength: 1
          title: Rule Logic
          description: >-
            Instruction the AI applies to each call. For `PASS_FAIL`, phrase it
            so that passing is unambiguous.
        order:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Order
        inputs_used:
          items:
            type: string
          type: array
          title: Inputs Used
      type: object
      required:
        - name
        - scoring_type
        - rule_logic
      title: EvalInput
      description: Input schema for creating/updating an eval.
    EvalResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier for the eval.
          examples:
            - 12
        name:
          type: string
          title: Name
          description: Name of the eval.
          examples:
            - Verified caller identity
        scoring_type:
          type: string
          enum:
            - PASS_FAIL
            - SCORE_1_5
          title: Scoring Type
          description: >-
            `PASS_FAIL` for a yes/no check, `SCORE_1_5` for a 1–5 rating.
            Simulations require at least one `PASS_FAIL` eval.
          examples:
            - PASS_FAIL
        rule_logic:
          type: string
          title: Rule Logic
          description: >-
            Instruction the AI applies to each call. For `PASS_FAIL`, phrasing
            is written so that passing is unambiguous.
          examples:
            - The agent confirmed the caller's name and date of birth.
        is_system_added:
          type: boolean
          title: Is System Added
          description: >-
            Whether this eval was added automatically as a system default rather
            than created by a user.
          examples:
            - false
        is_removable:
          type: boolean
          title: Is Removable
          description: >-
            Whether this eval can be deleted. System defaults may be marked
            non-removable; attempting to delete a non-removable eval returns a
            403.
          examples:
            - true
        order:
          type: integer
          title: Order
          description: Display order relative to other evals for the agent.
          examples:
            - 0
        inputs_used:
          items:
            type: string
          type: array
          title: Inputs Used
          description: >-
            The inputs the AI considers when evaluating this eval, e.g.
            "system_prompt", "tools", "allowed_capabilities", "workflow", or
            "metadata.<key>" for a specific metadata field.
          examples:
            - - system_prompt
              - tools
      type: object
      required:
        - id
        - name
        - scoring_type
        - rule_logic
        - is_system_added
        - is_removable
        - order
        - inputs_used
      title: EvalResponse
      description: Response schema for an eval.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    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
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````