Skip to main content
PUT
https://staging.api.onenumber.africa/v1
/
message
/
{reference}
Update Message
curl --request PUT \
  --url https://staging.api.onenumber.africa/v1/message/{reference} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "<string>",
  "recipients": [
    {}
  ],
  "message": "<string>",
  "expiry": 123,
  "deliveryTime": "<string>"
}
'
{
  "statusCode": 123,
  "message": "<string>",
  "data": [
    {
      "reference": "<string>",
      "currentStatus": "<string>",
      "type": "<string>",
      "message": "<string>",
      "expiry": "<string>",
      "recipients": [
        {
          "reference": "<string>",
          "phoneNumber": "<string>",
          "email": "<string>",
          "firstName": "<string>",
          "lastName": "<string>"
        }
      ],
      "statuses": [
        {
          "name": "<string>",
          "createdAt": "<string>"
        }
      ]
    }
  ]
}
Only messages that have these statuses can be updated: created, scheduled.

Request Path Parameters

reference
string
The reference of the Message.

Request Body Parameters

type
string
required
The type of the Message. This can either be: OTP or SMS.
recipients
array
required
The recipients to receive the message. This can contain valid phone numbers and Recipient references.
message
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.
expiry
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.
deliveryTime
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.

Successful Response Data

statusCode
int
required
The status of the response. For successful response, value is 201. Check the Response Codes page for details.
message
string
required
The message of the response.
data
array