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

# Create a deal scoring

> Enqueues a scoring workflow for the deal. Returns the scoring resource with status "processing". Poll GET /v1/deals/{id}/scorings/{scoring_id} for completion.




## OpenAPI

````yaml /openapi.yaml post /v1/deals/{id}/scorings
openapi: 3.1.0
info:
  title: Lymo Platform API
  version: 1.0.0
  description: >
    Public API for external integrations. Authenticated via Unkey API keys. All
    endpoints are org-scoped — the API key determines which organization's data
    is accessible.
servers:
  - url: https://platform.lymo.jp
    description: Production
  - url: http://127.0.0.1:54321/functions/v1/platform
    description: Local development (Supabase CLI)
security:
  - apiKeyAuth: []
tags:
  - name: system
    description: Health and status endpoints
  - name: videos
    description: Video data and analysis
  - name: deals
    description: Deal management and scoring
  - name: members
    description: Organization members
  - name: analyses
    description: Video analysis resources (async)
  - name: scorings
    description: Deal scoring resources (async)
  - name: webhooks
    description: Webhook endpoint management
  - name: keys
    description: API key self-service
  - name: search
    description: Cross-entity search
paths:
  /v1/deals/{id}/scorings:
    post:
      tags:
        - scorings
      summary: Create a deal scoring
      description: >
        Enqueues a scoring workflow for the deal. Returns the scoring resource
        with status "processing". Poll GET /v1/deals/{id}/scorings/{scoring_id}
        for completion.
      operationId: createDealScoring
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Deal ID
      responses:
        '201':
          description: Scoring created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - status
                      - deal_id
                      - created_at
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                        enum:
                          - processing
                          - completed
                          - failed
                      deal_id:
                        type: string
                      result:
                        type: object
                        nullable: true
                        description: Scoring result payload. Null while processing.
                        properties:
                          probability:
                            type: number
                            nullable: true
                          factors:
                            type: array
                            nullable: true
                            items:
                              type: object
                              properties:
                                factor_id:
                                  type: string
                                score:
                                  type: number
                                reason:
                                  type: string
                                  nullable: true
                      error:
                        type: object
                        nullable: true
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                      started_at:
                        type: string
                        format: date-time
                        nullable: true
                      finished_at:
                        type: string
                        format: date-time
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                  meta:
                    type: object
                    required:
                      - request_id
                    properties:
                      request_id:
                        type: string
                        description: Unique identifier for this request
                        example: req_abc123
        '404':
          description: Deal not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code
                        example: not_found
                      message:
                        type: string
                        description: Human-readable error description
                        example: Video not found
                  meta:
                    type: object
                    required:
                      - request_id
                    properties:
                      request_id:
                        type: string
                        description: Unique identifier for this request
                        example: req_abc123
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: Unkey API key (prefix lymo_)

````