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

# Save a lead's message

> The first message as written, with `subject` only when the sequence's first message is an email. Once the lead is in its sequence, a message that fits that step is the one it sends; one that does not fit stays on the lead only.



## OpenAPI

````yaml /openapi.yaml put /v1/plays/{id}/leads/{leadId}/message
openapi: 3.1.0
info:
  title: Retriever Public API
  version: 1.0.0
  description: >
    Retriever public API: start the prospecting agent (runs), read and export

    tables, import data, sync exclusion lists, run structured research (Go),

    and call atomic services.


    **Model Context Protocol (MCP)**: the same account and credits are available

    through the hosted MCP server (`POST /mcp`, Streamable HTTP). See the MCP

    guide in this documentation (Model Context Protocol navigation). Primary

    tools: `service_discover`, `service_execute`, `service_batch_execute` and

    `service_batch_get` (the slow services), `retriever_build_list_*`,

    `retriever_research_*`, `workspace_list`, `table_*`, `exclusion_*`,

    `credits`, `sequence_*`, `sender_*`, `inbox_*`.


    **Authentication**: `Authorization: Bearer ret_live_…`. Create the key in
    the

    app: Settings → **API keys** → **Create API key**. The key grants access to

    resources in the key owner's organization.


    **Errors**: every HTTP error has the shape

    `{ "error": { "code": "…", "message": "…", "details": … } }`.

    Branch your code on `error.code` (stable), never on `message`.


    **Rate limits**: key-authenticated responses include

    `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (seconds).

    A `429` response also includes `Retry-After` (seconds).

    Any key-authenticated operation can also answer `503` with code

    `key_check_busy` (see `components.responses.KeyCheckBusy`): the key could

    not be checked right now, often a key created a moment ago during a flood

    of unknown keys. Retry after `Retry-After` seconds.


    **Request size**: a request body can be at most 10 MiB (10,485,760

    bytes), and 25 MiB (26,214,400 bytes) on a table import. A larger body

    gets `413 body_too_large`.


    API error messages are in English.
  contact:
    name: Retriever
servers:
  - url: https://api.retriever.run
    description: Production
  - url: http://localhost:4320
    description: Local app-server
security:
  - bearerAuth: []
tags:
  - name: Runs
    description: Prospecting agent « prompt in, table out ». Asynchronous.
  - name: Tables
    description: Read live tables in a workspace.
  - name: Workspaces
    description: Create workspaces and import tables.
  - name: Exclusions
    description: Company and people lists to never source.
  - name: Scheduled runs
    description: Repeat a list-building mission on a cadence.
  - name: Plays
    description: Find, qualify and contact leads on a cadence, and sort them.
  - name: Go
    description: >-
      One question, one structured answer: the Go agent searches the web and can
      call every Retriever service.
  - name: Services
    description: Atomic services (search, scraping, email…).
  - name: Credits
    description: Credit balance.
paths:
  /v1/plays/{id}/leads/{leadId}/message:
    put:
      tags:
        - Plays
      summary: Save a lead's message
      description: >-
        The first message as written, with `subject` only when the sequence's
        first message is an email. Once the lead is in its sequence, a message
        that fits that step is the one it sends; one that does not fit stays on
        the lead only.
      operationId: savePlayLeadMessage
      parameters:
        - $ref: '#/components/parameters/PlayId'
        - $ref: '#/components/parameters/PlayLeadId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              additionalProperties: false
              properties:
                subject:
                  type: string
                  maxLength: 200
                text:
                  type: string
                  maxLength: 4000
      responses:
        '200':
          description: The lead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlayLead'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/PlayNotFound'
        '409':
          $ref: '#/components/responses/PlayConflict'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    PlayId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Id of the play.
    PlayLeadId:
      name: leadId
      in: path
      required: true
      schema:
        type: string
      description: Id of the lead.
  schemas:
    PlayLead:
      type: object
      properties:
        id:
          type: string
        review_state:
          type: string
          enum:
            - review
            - accepted
            - rejected
        person:
          type: object
          properties:
            name:
              type: string
            title:
              type: string
            company:
              type: string
            companyDomain:
              type: string
            linkedinUrl:
              type: string
            location:
              type: string
            email:
              type: string
        signal:
          type:
            - object
            - 'null'
          properties:
            summary:
              type: string
            source_url:
              type:
                - string
                - 'null'
        fit:
          type:
            - string
            - 'null'
        in_sequence:
          type: boolean
        first_message:
          type:
            - object
            - 'null'
          properties:
            subject:
              type:
                - string
                - 'null'
            text:
              type: string
            edited_by_user:
              type: boolean
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable code; use in your application.
            message:
              type: string
              description: Human-readable explanation. May change.
            details:
              description: Optional details (e.g. list of invalid fields).
  responses:
    BadRequest:
      description: >-
        `invalid_request`: unreadable JSON, unknown field or query parameter,
        wrong type, `limit` out of range, empty `Idempotency-Key`, invalid
        `output` contract. `message` names each invalid field; `details` lists
        them as `{ path, message }`. On `POST /v1/runs`, `workspace_mismatch`:
        the conversation does not belong to the provided workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: 'prompt: prompt must not be blank'
              details:
                - path: prompt
                  message: prompt must not be blank
    Unauthorized:
      description: >-
        `not_authenticated`: missing header, malformed (expected `Bearer
        <key>`), revoked or unknown key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_authenticated
              message: A valid API key is required.
    PlayNotFound:
      description: >-
        `play_not_found`: unknown id or another organization's play.
        `play_lead_not_found`. `play_update_not_found`: unknown proposal.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PlayConflict:
      description: >-
        `play_archived`: restore it first. `play_not_launched`: launch it first.
        `play_lead_decided`: the lead was already kept or rejected.
        `play_update_stale`, `play_update_decided`,
        `play_update_not_applicable`: about a proposal.
        `play_message_edited_by_hand`: the message was edited by hand in its
        sequence. `play_message_not_synced`: the sequence did not take the
        message (its step already left). `play_run_busy`: a run of the play is
        waiting or going. `play_paused`: resume it first.
        `scheduled_run_archived`: the play was archived meanwhile.
        `company_icp_brief_not_found`: a new channel gets its steps written from
        the Brain, and the organization has none. `play_version_moved`: another
        change was saved on the play at the same moment; read it again and
        retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: '`invalid_request`: add `Content-Type: application/json`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Content-Type must be application/json.
    TooManyRequests:
      description: '`rate_limited`: wait `Retry-After` seconds, then retry.'
      headers:
        Retry-After:
          schema:
            type: integer
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Retry in 12 s.
  headers:
    RateLimit-Limit:
      schema:
        type: integer
      description: Window budget.
    RateLimit-Remaining:
      schema:
        type: integer
      description: Remaining requests.
    RateLimit-Reset:
      schema:
        type: integer
      description: Seconds until reset.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key `ret_live_…` created in Settings → API keys.

````

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