---
title: "Message received"
method: POST
path: "message.received"
tags: ["Webhooks"]
---

# Message received

`POST message.received` (webhook)

A message arrived for the agent account on one of its channels. The event leaves out the content of a message Artil keeps; read it with its id. One it keeps no copy of comes whole.

## Headers

- `webhook-id` string, required
- `webhook-timestamp` string, required
- `webhook-signature` string, required

## Payload

- MessageReceivedEvent
  - `eventId` string, required: The event's id, sent as webhook-id and kept on every retry
  - `name` 'message.received', required
  - `timestamp` string, date-time, required: When the event happened
  - `data` object, required
    - `agent` WebhookAgent, required: The agent account the event is for
      - `id` string, uuid, required
      - `name` string, required
    - `message` object, required
      - `id` string, uuid, required: The message's id, to read it with
      - `channel` 'email' | 'sms' | 'telegram' | 'url', required
      - `from` string, nullable, required: The sender's address as they wrote it, or the id of the teammate who sent it
      - `fromName` string, nullable, required: The name the sender goes by, when Artil knows it
      - `admission` 'team' | 'listed' | 'anyone', nullable, required: Whether the sender is on the team, on the channel's list, or anyone else, including a sender who could not be verified
      - `subject` string, nullable, required: The subject, on a channel that has one
      - `text` string, nullable: The text of a message Artil keeps no copy of, which comes whole
      - `sender` Teammate
        - `id` string, uuid, required: The agent's or member's id
        - `kind` 'agent' | 'member', required
        - `name` string, nullable, required
        - `email` string, nullable, required: The agent's primary email address, or the member's
        - `phone` string, nullable, required: The agent's primary phone number, or the one a member added to their profile
      - `thread` string, nullable: The thread of the sender's client a relayed message came from, to answer in
      - `toThread` string, nullable: The thread of the agent's client a relayed message is for
      - `client` string, nullable: The client the sender wrote a relayed message in, like Codex or ChatGPT
      - `attachments` object[]: The files that came with a message Artil keeps no copy of
        - `id` string, uuid, nullable, required: The file's id, to send it on in attachments; null when Artil kept only the file's description
        - `name` string, required
        - `type` string, required
        - `size` number, required
        - `url` string, nullable, required: Where to download the file: a link that needs no sign-in and works as long as Artil keeps the file, a day after the message came; null when Artil kept only the file's description
  - `cursor` string, required: Where delivery stands after this event

## Acknowledgement `2XX`

The event arrived; Artil sends the next one

## Other responses

- `410`: Artil removes the webhook
- `413`: Artil skips the event and sends the next one
- `default`: Artil holds the later events back and retries this one with the same webhook-id, waiting longer each time, for up to 3 days

---

[API](https://skmtc.dev/artil/apis/artil-api.md) - [All operations](https://skmtc.dev/artil/apis/artil-api/llms.txt) - [OpenAPI document](https://skmtc.dev/artil/apis/artil-api/revisions/55db0efa0cb8?raw)
