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

# (dev only) Fabricate failing eval runs and fire the real eval.failed emitter

> Fabricate failing eval runs for an agent and run the REAL ENG-604 emitter.

Exercises the full classification/escalation/digest/dedupe-key path that plain
``test-send`` bypasses: builds the ``eval.failed`` payload exactly as the eval
orchestrator would, then enqueues ``dispatch`` (the notify Celery task) — so a
background worker is required for the message to actually deliver.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/evals/synthesize-failure
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/evals/synthesize-failure:
    post:
      tags:
        - evals
        - evals
      summary: >-
        (dev only) Fabricate failing eval runs and fire the real eval.failed
        emitter
      description: >-
        Fabricate failing eval runs for an agent and run the REAL ENG-604
        emitter.


        Exercises the full classification/escalation/digest/dedupe-key path that
        plain

        ``test-send`` bypasses: builds the ``eval.failed`` payload exactly as
        the eval

        orchestrator would, then enqueues ``dispatch`` (the notify Celery task)
        — so a

        background worker is required for the message to actually deliver.
      operationId: synthesizeEvalFailure
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SynthesizeEvalFailureRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SynthesizeEvalFailureResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SynthesizeEvalFailureRequest:
      properties:
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        n_failures:
          type: integer
          maximum: 10
          minimum: 1
          title: N Failures
          default: 1
        failure_kind:
          type: string
          enum:
            - quality
            - error
          title: Failure Kind
          default: quality
        score:
          type: number
          maximum: 1
          minimum: 0
          title: Score
          default: 0.62
        threshold:
          type: number
          maximum: 1
          minimum: 0
          title: Threshold
          default: 0.8
      additionalProperties: false
      type: object
      required:
        - agent_id
      title: SynthesizeEvalFailureRequest
      description: >-
        Fabricate failing eval runs for one agent and fire the REAL
        ``eval.failed`` emitter.


        Dev-only (the route 404s in production). ``n_failures==1`` produces the
        single

        payload shape; ``>1`` produces the digest shape.
        ``failure_kind='quality'`` writes

        ``COMPLETED`` runs with a failing score (these feed the
        sustained-failure window

        that escalates to ``critical``); ``'error'`` writes ``ERRORED`` runs
        with no score

        (these never increment the sustained window).
    SynthesizeEvalFailureResponse:
      properties:
        session_id:
          type: string
          format: uuid
          title: Session Id
        eval_run_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Eval Run Ids
        payload:
          additionalProperties: true
          type: object
          title: Payload
        severity:
          anyOf:
            - type: string
            - type: 'null'
          title: Severity
        sustained_count:
          type: integer
          title: Sustained Count
        dispatched:
          type: boolean
          title: Dispatched
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
      type: object
      required:
        - session_id
        - eval_run_ids
        - payload
        - severity
        - sustained_count
        - dispatched
        - task_id
      title: SynthesizeEvalFailureResponse
      description: >-
        The fabricated session/runs plus the exact payload handed to
        ``dispatch``.


        ``payload`` is ``{}`` and ``dispatched`` is ``False`` only if the
        emitter found

        nothing notifiable (should not happen for the shapes this endpoint
        fabricates).
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````