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

# Post a message to the event's thread

> Posts one line to the thread the leased event came from, before the run answers, with the fleet's secret values masked. The daemon holds the channel's credential and posts; the runner sends text. A run may post at most 8 messages, refused past that with `UZ-RUN-020`. An event from no thread, such as an API steer, a webhook or a schedule, is refused with `UZ-RUN-019`. Both are 409s naming their `current_state`. `delivered` is false when the channel refused the line, or stayed unreachable through every retry within 12 seconds. Takes no `Idempotency-Key`: each line is its own post. 



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/runners/me/leases/{lease_id}/messages
openapi: 3.1.0
info:
  title: agentsfleet Control Plane API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/runners/me/leases/{lease_id}/messages:
    post:
      tags:
        - Runners
      summary: Post a message to the event's thread
      description: >-
        Posts one line to the thread the leased event came from, before the run
        answers, with the fleet's secret values masked. The daemon holds the
        channel's credential and posts; the runner sends text. A run may post at
        most 8 messages, refused past that with `UZ-RUN-020`. An event from no
        thread, such as an API steer, a webhook or a schedule, is refused with
        `UZ-RUN-019`. Both are 409s naming their `current_state`. `delivered` is
        false when the channel refused the line, or stayed unreachable through
        every retry within 12 seconds. Takes no `Idempotency-Key`: each line is
        its own post. 
      operationId: runner_post_message
      parameters:
        - name: lease_id
          in: path
          description: '`UUIDv7` of the lease.'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagePosted'
        '400':
          description: The request could not be read
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: No credential, or one this route does not accept
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: The credential is good and lacks the capability this route requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: No such resource, or none this caller may see
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: The request conflicts with the resource's current state
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The payload is over this route's ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: The instance is at its ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: The daemon failed to answer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A dependency this route needs is unreachable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - RunnerBearerAuth: []
components:
  schemas:
    MessageRequest:
      type: object
      description: '`POST /v1/runners/me/leases/{lease_id}/messages` request.'
      required:
        - fencing_token
        - text
      properties:
        fencing_token:
          type: integer
          format: int64
          description: >-
            The lease's fencing token; a holder the fleet has superseded is
            refused.
          minimum: 0
        text:
          type: string
          description: What to say in the thread. At most 4096 bytes.
          maxLength: 4096
          minLength: 1
      additionalProperties: false
    MessagePosted:
      type: object
      description: What posting a message did.
      required:
        - delivered
      properties:
        delivered:
          type: boolean
          description: >-
            Whether the thread has the message. `false` when the channel refused

            it or stayed unreachable through every retry; the run goes on, and
            the

            report still carries the answer. Beta: this field may change shape
            before it is stable.
          x-stability: beta
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - integer
            - 'null'
          format: int64
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: The opaque agt_r token minted when the runner enrols (POST /v1/runners)

````

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