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

# Leave a draft message on a conversation

> Leaves a suggested reply on an existing conversation for an agent to review, edit and send from the portal composer. Nothing is sent and the client is not notified. Every agent of the partner sees the draft, labelled as coming from the Public API. A conversation holds one such draft per `isPrivate` value: posting again replaces its text and returns the same draft id. When an agent has dismissed or sent a draft, posting the exact same text again leaves it retired and the response reports `status: dismissed`. The draft retires on its own once the client or an agent replies, or the conversation is solved or closed; a solved or closed conversation rejects new drafts with `422`. Requires the partner's suggested replies access and the `conversation:write` scope.



## OpenAPI

````yaml /openapi.yaml post /v1/conversation/{id}/message/draft
openapi: 3.1.0
info:
  title: ProVision Public API
  version: 1.0.0
  description: >-
    Use the ProVision Public API to integrate with ProVision conversations,
    clients, sites, projects, users, labels, and signal incidents. All endpoints
    accept and return JSON, are authenticated with an `x-api-key` header, and
    are scoped to a single partner tenant.
  contact:
    email: help@onevisionresources.com
    name: OneVision Resources Support
  license:
    name: Proprietary
servers:
  - url: https://connect.provisionapp.io
    description: Production
security: []
tags:
  - name: Conversations
    description: >-
      Support conversations: list and read them, create new ones, update status
      and urgency, read messages, post internal notes, and link sites and
      labels.
  - name: Clients
    description: >-
      The people your team supports: list, read, create, and update clients, and
      link them to their sites.
  - name: Sites
    description: >-
      The addresses your team services: list, read, create, and update sites,
      and apply labels.
  - name: Site files
    description: >-
      Documentation attached to a site, such as plans, photos, and manuals:
      list, download, upload, and delete.
  - name: Projects
    description: >-
      Installation projects at a site. Available to partners with access to
      ProVision Projects.
  - name: Users
    description: The platform users on your team, who can be assignees and message senders.
  - name: User groups
    description: >-
      The groups that bundle permissions for platform users: list the public
      groups available to your team.
  - name: Labels
    description: >-
      The public labels your team can apply to conversations, sites, and
      client-site links.
  - name: Signal incidents
    description: >-
      Raised when a conversation pages someone, and open until an agent resolves
      it: list and resolve them.
  - name: System
    description: Service health, for checking that your API key and network path work.
paths:
  /v1/conversation/{id}/message/draft:
    post:
      tags:
        - Conversations
      summary: Leave a draft message on a conversation
      description: >-
        Leaves a suggested reply on an existing conversation for an agent to
        review, edit and send from the portal composer. Nothing is sent and the
        client is not notified. Every agent of the partner sees the draft,
        labelled as coming from the Public API. A conversation holds one such
        draft per `isPrivate` value: posting again replaces its text and returns
        the same draft id. When an agent has dismissed or sent a draft, posting
        the exact same text again leaves it retired and the response reports
        `status: dismissed`. The draft retires on its own once the client or an
        agent replies, or the conversation is solved or closed; a solved or
        closed conversation rejects new drafts with `422`. Requires the
        partner's suggested replies access and the `conversation:write` scope.
      operationId: postConversationMessageDraft
      parameters:
        - schema:
            type: string
            format: uuid
            example: 8c1f2e3d-4b5a-4c6d-9e7f-0a1b2c3d4e5f
          required: true
          name: id
          in: path
          description: Id of the conversation, as returned by `GET /v1/conversation/list`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostConversationMessageDraftPayload'
      responses:
        '201':
          description: Created or updated draft
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationMessageDraft'
              example:
                id: 57f2d879-20f8-4106-9abb-44fa099e0448
                conversationId: 8c1f2e3d-4b5a-4c6d-9e7f-0a1b2c3d4e5f
                isPrivate: false
                body: On my way, about 20 minutes out.
                status: active
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OpenApiKeyAuth: []
components:
  schemas:
    PostConversationMessageDraftPayload:
      type: object
      properties:
        body:
          type: string
          minLength: 1
          description: >-
            The draft text, as plain text: HTML is not interpreted and shows up
            literally. Each line becomes its own paragraph in the composer, and
            a blank line stays blank. In a private draft (`isPrivate: true`)
            users and assignee groups can be mentioned with the same
            `<@{userId}>` and `<@group:{conversationAssigneeGroupId}>` tokens as
            `POST /v1/conversation/{id}/message`; mentioned users and groups are
            notified only when an agent sends the draft. A public draft
            (`isPrivate: false`) rejects mention tokens with `400`.
          example: On my way, about 20 minutes out.
        isPrivate:
          type: boolean
          description: >-
            `true` drafts a private (internal) note, `false` a public reply to
            the client. Each conversation holds one API draft per value.
          example: false
      required:
        - body
        - isPrivate
      additionalProperties: false
    ConversationMessageDraft:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Id of the draft. Posting again for the same conversation and
            `isPrivate` returns the same id.
          example: 57f2d879-20f8-4106-9abb-44fa099e0448
        conversationId:
          type: string
          format: uuid
          description: Id of the conversation the draft belongs to.
          example: 8c1f2e3d-4b5a-4c6d-9e7f-0a1b2c3d4e5f
        isPrivate:
          type: boolean
          description: Whether the draft is a private (internal) note or a public reply.
          example: false
        body:
          type: string
          description: The draft text as sent in the request (trimmed).
          example: On my way, about 20 minutes out.
        status:
          type: string
          enum:
            - active
            - dismissed
          description: >-
            `active` when agents see the draft in the composer. `dismissed` when
            an agent already dismissed or sent this exact text: the draft stays
            retired and nobody sees it; post different text to propose it again.
          example: active
      required:
        - id
        - conversationId
        - isPrivate
        - body
        - status
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: NOT_FOUND
        message:
          type: string
          description: Human-readable error description
      required:
        - code
        - message
  securitySchemes:
    OpenApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Send the API key in the x-api-key header.

````

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