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

# Update Message

<Note>
  Only messages that have these statuses can be updated: created, scheduled.
</Note>

## Request Path Parameters

<ParamField path="reference" type="string" placeholder="MSG_xPZprDayEqNU9bZ">
  The reference of the Message.
</ParamField>

## Request Body Parameters

<ParamField body="type" type="string" placeholder="SMS" required>
  The type of the Message. This can either be: OTP or SMS.
</ParamField>

<ParamField body="recipients" type="array" required>
  The recipients to receive the message. This can contain valid phone numbers and Recipient references.
</ParamField>

<ParamField body="message" type="string">
  The message to be sent. It is required when type is SMS. If no value is entered (in the case of OTP type), a default 6-digit OTP is generated and sent to the recipients.
</ParamField>

<ParamField body="expiry" type="int">
  The expiry time of the message in minutes. This is useful for OTP type messages. If no value is specified, it defaults to 10 minutes.
</ParamField>

<ParamField body="deliveryTime" type="string">
  The date and time for message delivery. Use this to schedule messages to be sent later. The accepted time format is: Y-m-d H:i:s. If no value is specified, the message will be sent immediately.
</ParamField>

## Successful Response Data

<ResponseField name="statusCode" type="int" required>
  The status of the response. For successful response, value is 201. Check the Response Codes page for details.
</ResponseField>

<ResponseField name="message" type="string" required>
  The message of the response.
</ResponseField>

<ResponseField name="data" type="array">
  <Expandable title="properties">
    <ResponseField name="reference" type="string">
      The ID of the Message.
    </ResponseField>

    <ResponseField name="currentStatus" type="string">
      The current status of the message.
    </ResponseField>

    <ResponseField name="type" type="string">
      The type of the Message.
    </ResponseField>

    <ResponseField name="message" type="string">
      The message.
    </ResponseField>

    <ResponseField name="expiry" type="string">
      The expiry date and time of the Message.
    </ResponseField>

    <ResponseField name="recipients" type="array">
      <Expandable title="properties" type="array">
        <ResponseField name="reference" type="string">
          The ID of the Recipient.
        </ResponseField>

        <ResponseField name="phoneNumber" type="string">
          The phone number of the Recipient.
        </ResponseField>

        <ResponseField name="email" type="string">
          The email of the Recipient.
        </ResponseField>

        <ResponseField name="firstName" type="string">
          The first name of the Recipient.
        </ResponseField>

        <ResponseField name="lastName" type="string">
          The last name of the Recipient.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="statuses" type="array">
      <Expandable title="properties" type="array">
        <ResponseField name="name" type="string">
          The status name.
        </ResponseField>

        <ResponseField name="createdAt" type="string">
          The date and time of the status.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
