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

# Schedule Message

> Queue a text to send into a patient chat at a future time.

The heartbeat sweep sends it through the normal send path when due.



## OpenAPI

````yaml post /comms/chat/schedule-message
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /comms/chat/schedule-message:
    post:
      tags:
        - Messages
      summary: Schedule Message
      description: |-
        Queue a text to send into a patient chat at a future time.

        The heartbeat sweep sends it through the normal send path when due.
      operationId: schedule_message_comms_chat_schedule_message_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledMessageCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledMessageSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ScheduledMessageCreate:
      properties:
        chatId:
          type: string
          title: Chatid
        senderId:
          type: string
          title: Senderid
        content:
          type: string
          title: Content
        sendAt:
          type: string
          format: date-time
          title: Sendat
      type: object
      required:
        - chatId
        - senderId
        - content
        - sendAt
      title: ScheduledMessageCreate
    ScheduledMessageSummary:
      properties:
        id:
          type: string
          title: Id
        chatId:
          type: string
          title: Chatid
        content:
          type: string
          title: Content
        sendAt:
          type: string
          format: date-time
          title: Sendat
        status:
          $ref: '#/components/schemas/ScheduledMessageStatus'
        sender:
          $ref: '#/components/schemas/UserTiny'
        createdDate:
          type: string
          format: date-time
          title: Createddate
        sentAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sentat
        sentMessageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sentmessageid
        errorMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Errormessage
      type: object
      required:
        - id
        - chatId
        - content
        - sendAt
        - status
        - sender
        - createdDate
      title: ScheduledMessageSummary
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ScheduledMessageStatus:
      type: string
      enum:
        - SCHEDULED
        - SENT
        - CANCELLED
        - FAILED
      title: ScheduledMessageStatus
    UserTiny:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
      type: object
      required:
        - id
        - type
      title: UserTiny
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType

````