---
title: "Upsert an event for a message on the mobile phone"
method: POST
path: "/messages/{messageID}/events"
tags: ["Messages"]
---

# Upsert an event for a message on the mobile phone

`POST /messages/{messageID}/events`

Use this endpoint to send events for a message when it is failed, sent or delivered by the mobile phone.

## Path parameters

- `messageID` string, required

## Request body

- RequestsMessageEvent
  - `event_name` string, required — EventName is the type of event * SENT: is emitted when a message is sent by the mobile phone * FAILED: is event is emitted when the message could not be sent by the mobile phone * DELIVERED: is event is emitted when a delivery report has been received by the mobile phone
  - `reason` string, required — Reason is the exact error message in case the event is an error
  - `timestamp` string, required — Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible

## Response `200`

OK

- ResponsesMessageResponse
  - `data` EntitiesMessage, required
    - `attachments` string[], required
    - `contact` string, required
    - `content` string, required
    - `created_at` string, required
    - `delivered_at` string
    - `encrypted` boolean, required
    - `expired_at` string
    - `failed_at` string
    - `failure_reason` string
    - `id` string, required
    - `last_attempted_at` string
    - `max_send_attempts` integer, required
    - `order_timestamp` string, required
    - `owner` string, required
    - `received_at` string
    - `request_id` string
    - `request_received_at` string, required
    - `scheduled_at` string
    - `scheduled_send_time` string
    - `send_attempt_count` integer, required
    - `send_time` integer — SendDuration is the number of nanoseconds from when the request was received until when the mobile phone send the message
    - `sent_at` string
    - `sim` 'SIM1' | 'SIM2', required
    - `status` string, required
    - `type` string, required
    - `updated_at` string, required
    - `user_id` string, required
  - `message` string, required
  - `status` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.net/ndolestudio/apis/httpsms-api-reference.md) · [All operations](https://skmtc.net/ndolestudio/apis/httpsms-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ndolestudio/httpsms-api-reference/versions/ddd090b6b679/schema)
