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

# Report a won or lost quote



## OpenAPI

````yaml /api-reference/openapi.json post /v1/outcomes
openapi: 3.1.0
info:
  title: Elastly API
  version: '2026-11-01'
servers:
  - url: https://api.elastly.ai
security: []
paths:
  /v1/outcomes:
    post:
      summary: Report a won or lost quote
      operationId: recordOutcomes
      parameters:
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: Elastly-Version
          in: header
        - schema:
            type: string
            pattern: ^[\x21-\x7e]{1,255}$
          required: false
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                quoteRef:
                  type: string
                  minLength: 1
                  maxLength: 100
                  pattern: ^[^\p{C}]+$/u
                occurredAt:
                  type: string
                  format: date-time
                lines:
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          lineRef:
                            type: string
                            minLength: 1
                            maxLength: 64
                          outcome:
                            type: string
                            enum:
                              - won
                          quantity:
                            type: string
                            pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
                        required:
                          - lineRef
                          - outcome
                          - quantity
                        additionalProperties: false
                      - type: object
                        properties:
                          lineRef:
                            type: string
                            minLength: 1
                            maxLength: 64
                          outcome:
                            type: string
                            enum:
                              - lost
                          reasonCode:
                            type: string
                            minLength: 1
                            maxLength: 80
                            pattern: ^[a-z0-9_]+$
                          competitor:
                            type: string
                            minLength: 1
                            maxLength: 200
                          competitorPrice:
                            type: string
                            pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
                          currency:
                            type: string
                            pattern: ^[A-Z]{3}$
                        required:
                          - lineRef
                          - outcome
                          - reasonCode
                        additionalProperties: false
                  minItems: 1
                  maxItems: 100
              required:
                - quoteRef
                - occurredAt
                - lines
              additionalProperties: false
              example:
                quoteRef: Q-1042
                occurredAt: '2026-11-02T09:30:00Z'
                lines:
                  - lineRef: L1
                    outcome: won
                    quantity: '400'
                  - lineRef: L2
                    outcome: lost
                    reasonCode: went_to_competitor
                    competitor: Northline Supply
                    competitorPrice: '11.80'
                    currency: USD
      responses:
        '200':
          description: Report a won or lost quote
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                Present and true when the response replays an earlier request
                with the same idempotency key
              schema:
                type: string
                enum:
                  - 'true'
          content:
            application/json:
              schema:
                type: object
                properties:
                  quoteRef:
                    type: string
                  lines:
                    type: array
                    items:
                      type: object
                      properties:
                        lineRef:
                          type: string
                        state:
                          type: string
                          enum:
                            - recorded
                            - stale
                            - line_not_found
                            - unknown_reason
                            - competitor_not_allowed
                            - occurred_in_future
                      required:
                        - lineRef
                        - state
                      additionalProperties: false
                required:
                  - quoteRef
                  - lines
                additionalProperties: false
        '400':
          description: unsupported_api_version, invalid_request, invalid_idempotency_key
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: unauthenticated
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            insufficient_scope, plan_required, workspace_read_only,
            workspace_locked, workspace_purging
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: quote_not_found
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: idempotency_request_in_progress
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: idempotency_key_reused
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: rate_limited
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: service_unavailable
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - apiKey: []
components:
  schemas:
    ApiError:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid_request
            - unauthenticated
            - access_denied
            - rate_limited
            - plan_required
            - workspace_read_only
            - workspace_locked
            - workspace_purging
            - service_unavailable
            - insufficient_scope
            - not_found
            - idempotency_key_reused
            - idempotency_key_required
            - invalid_idempotency_key
            - idempotency_request_in_progress
            - unsupported_api_version
            - invalid_cursor
            - quote_ref_customer_mismatch
            - channel_publishing
            - connection_unavailable
            - import_not_found
            - import_state_conflict
            - file_too_large
            - unsupported_format
            - writeback_unavailable
            - write_access_revoked
            - writeback_paused
            - too_many_claims
            - quote_not_found
        requestId:
          type: string
      required:
        - error
        - requestId
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.