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

# Record a run's outcome

> What the run turned out to be worth, reported whenever it is known: a pull request merged, an answer accepted, a test suite green. Kept on the run's record and in its trace; a run may gather several.



## OpenAPI

````yaml /docs/reference/openapi.json post /runs/{run_id}/outcome
openapi: 3.1.0
info:
  description: >-
    The HTTP API of an agent served with `omniserve run --agent agent.py`: runs,
    approvals, budgets, background tasks, sessions and the evidence of every
    run.
  title: OmniServe
  version: latest
servers:
  - description: omniserve run, locally
    url: http://localhost:8000
security: []
paths:
  /runs/{run_id}/outcome:
    post:
      tags:
        - Runs
      summary: Record a run's outcome
      description: >-
        What the run turned out to be worth, reported whenever it is known: a
        pull request merged, an answer accepted, a test suite green. Kept on the
        run's record and in its trace; a run may gather several.
      operationId: record_outcome_runs__run_id__outcome_post
      parameters:
        - in: path
          name: run_id
          required: true
          schema:
            title: Run Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OutcomeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                title: Response Record Outcome Runs  Run Id  Outcome Post
                type: object
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    OutcomeRequest:
      description: What a run turned out to be worth, reported after it ended.
      properties:
        detail:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Anything else worth keeping
          title: Detail
        label:
          anyOf:
            - type: string
            - type: 'null'
          description: What the outcome is called (merged, accepted)
          title: Label
        reward:
          anyOf:
            - type: number
            - type: 'null'
          description: The number a trainer or evaluator uses
          title: Reward
        source:
          description: Who reports it (github, reviewer, an evaluator)
          minLength: 1
          title: Source
          type: string
      required:
        - source
      title: OutcomeRequest
      type: object
    ErrorResponse:
      description: Standard error response model.
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Additional error details
          title: Detail
        error:
          description: Error type
          title: Error
          type: string
        message:
          description: Error message
          title: Message
          type: string
      required:
        - error
        - message
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````