Skip to content
LinqCopy agent prompt

Webhooks

ModelsExpand Collapse
class MessageEventV2:

Unified payload for message webhooks when using webhook_version: "2026-02-03".

This schema is used for message.sent, message.received, message.delivered, and message.read events when the subscription URL includes ?version=2026-02-03.

Key differences from V1 (2025-01-01):

  • direction: “inbound” or “outbound” instead of is_from_me boolean
  • sender_handle: Full handle object for the sender
  • chat: Nested object with id, is_group, and owner_handle
  • Message fields (id, parts, effect, etc.) are at the top level, not nested in message

Timestamps indicate the message state:

  • message.sent: sent_at set, delivered_at=null, read_at=null
  • message.received: sent_at set, delivered_at=null, read_at=null
  • message.delivered: sent_at set, delivered_at set, read_at=null
  • message.read: sent_at set, delivered_at set, read_at set
id: str

Message identifier

formatuuid
chat: Chat

Chat information

id: str

Chat identifier

formatuuid
health_status: ChatHealthStatus

[BETA] Current health for a chat. Always present — chats start at HEALTHY and may shift based on engagement and delivery signals on the conversation. Many AT_RISK or CRITICAL chats on a single line increase the risk of line flagging.

Switch on status to surface chat and line health in your UI — the enum is the long-term contract. Each status carries a doc_url that deep-links to the relevant section of the Chat Health guide. To gate a send, act on the response rather than the status: a 403 is the authoritative answer.

See the Chat Health guide for what each status means and how to react.

doc_url: str

Deep-link to the relevant section of the Chat Health guide for this status.

formaturi
status: Literal["HEALTHY", "AT_RISK", "CRITICAL", "OPTED_OUT"]

Current health bucket for the chat. See the Chat Health guide for what each value means and how to react. doc_url deep-links to the relevant section.

OPTED_OUT — the recipient sent STOP, UNSUBSCRIBE, OPTOUT, CANCEL, END, or QUIT. The keyword must be the whole trimmed message, never part of a longer one: STOP counts, please stop does not. Most keywords must match exactly, including case. OPT OUT is the exception — it matches in any casing, with or without the space or a hyphen, so opt out, Opt-Out and optout all count. It clears as soon as they reply again: any later message from them that is not itself an opt-out keyword opts them back in immediately — a reply in any conversation with you counts, the same way the block does.

OPTED_OUT marks only the conversation the keyword arrived in. The block below is wider than the mark, so a conversation still reading HEALTHY can be blocked as well — gate on the 403, not on the status. Group threads are never marked and are never blocked.

Linq enforces this: while a recipient is opted out, every send to them is rejected with 403 (error code 2024) before the message is queued, across every chat and every line on your account. Nothing is delivered, including a final courtesy message — to send one, set override_optout: true on that single request.

One of the following:
"HEALTHY"
"AT_RISK"
"CRITICAL"
"OPTED_OUT"
updated_at: datetime

When this status last changed.

formatdate-time
is_group: Optional[bool]

Whether this is a group chat

owner_handle: Optional[ChatHandle]

Your phone number’s handle. Always has is_me=true.

id: str

Unique identifier for this handle

formatuuid
handle: str

Phone number (E.164) or email address of the participant

joined_at: datetime

When this participant joined the chat

formatdate-time
service: ServiceType

Messaging service type

One of the following:
"iMessage"
"SMS"
"RCS"
is_me: Optional[bool]

Whether this handle belongs to the sender (your phone number)

left_at: Optional[datetime]

When they left (if applicable)

formatdate-time
status: Optional[Literal["active", "left", "removed"]]

Participant status

One of the following:
"active"
"left"
"removed"
direction: Literal["inbound", "outbound"]

Message direction - “outbound” if sent by you, “inbound” if received

One of the following:
"inbound"
"outbound"
parts: List[Part]

Message parts (text and/or media)

One of the following:
class SchemasTextPartResponse:

A text message part

type: Literal["text"]

Indicates this is a text message part

value: str

The text content

mention: Optional[str]

Handle (E.164 phone number or Apple ID email) of the @mentioned chat participant, as sent. null when the part carries no mention.

mention_range: Optional[List[int]]

Character range [start, end) in value highlighted as the mention, as sent. null when the send omitted it (the whole value is highlighted) or the part carries no mention. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

text_decorations: Optional[List[TextDecoration]]

Text decorations applied to character ranges in the value

range: List[int]

Character range [start, end) in the value string where the decoration applies. start is inclusive, end is exclusive. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

animation: Optional[Literal["big", "small", "shake", 5 more]]

Animated text effect to apply. Mutually exclusive with style.

One of the following:
"big"
"small"
"shake"
"nod"
"explode"
"ripple"
"bloom"
"jitter"
style: Optional[Literal["bold", "italic", "strikethrough", "underline"]]

Text style to apply. Mutually exclusive with animation.

One of the following:
"bold"
"italic"
"strikethrough"
"underline"
class SchemasMediaPartResponse:

A media attachment part

id: str

Unique attachment identifier

formatuuid
filename: str

Original filename

mime_type: str

MIME type of the file

size_bytes: int

File size in bytes

type: Literal["media"]

Indicates this is a media attachment part

url: str

Presigned URL for downloading the attachment (expires in 1 hour).

formaturi
class PartSchemasLinkPartResponse:

A rich link preview part

type: Literal["link"]

Indicates this is a rich link preview part

value: str

The URL

class PartSchemasIMessageAppPartResponse:

An iMessage app card part.

app: PartSchemasIMessageAppPartResponseApp

Identifies the iMessage app (Messages app extension) that backs the card.

bundle_id: str

Bundle identifier of the Messages app extension.

name: str

Display name of the app.

team_id: str

The app’s 10-character team identifier.

app_store_id: Optional[int]

The owning app’s App Store id, when known.

formatint64
layout: PartSchemasIMessageAppPartResponseLayout

Visible layout of the card.

caption: Optional[str]

Primary label, top-left and bold.

subcaption: Optional[str]

Secondary label, below caption on the left.

trailing_caption: Optional[str]

Label shown top-right.

trailing_subcaption: Optional[str]

Label shown below trailing_caption.

type: Literal["imessage_app"]

Indicates this is an iMessage app card part.

url: str

The URL the recipient’s app opens when the user taps the card.

formaturi
fallback_text: Optional[str]

Fallback text for surfaces that cannot render the card.

class PartSchemasAppClipPartResponse:

An Apple Pay App Clip payment card part

type: Literal["app_clip"]

Indicates this is an App Clip payment card part

value: str

The checkout link the card opens

description: Optional[str]

The card’s summary line, composed by Linq from the checkout session

image_url: Optional[str]

The card’s preview image

title: Optional[str]

The card’s headline, composed by Linq from the checkout session

sender_handle: ChatHandle

The handle that sent this message

id: str

Unique identifier for this handle

formatuuid
handle: str

Phone number (E.164) or email address of the participant

joined_at: datetime

When this participant joined the chat

formatdate-time
service: ServiceType

Messaging service type

One of the following:
"iMessage"
"SMS"
"RCS"
is_me: Optional[bool]

Whether this handle belongs to the sender (your phone number)

left_at: Optional[datetime]

When they left (if applicable)

formatdate-time
status: Optional[Literal["active", "left", "removed"]]

Participant status

One of the following:
"active"
"left"
"removed"
service: ServiceType

Messaging service type

One of the following:
"iMessage"
"SMS"
"RCS"
delivered_at: Optional[datetime]

When the message was delivered. Null if not yet delivered.

formatdate-time
effect: Optional[SchemasMessageEffect]

iMessage effect applied to a message (screen or bubble animation)

name: Optional[str]

Effect name (confetti, fireworks, slam, gentle, etc.)

type: Optional[Literal["screen", "bubble"]]

Effect category

One of the following:
"screen"
"bubble"
idempotency_key: Optional[str]

Idempotency key for deduplication of outbound messages.

preferred_service: Optional[Literal["iMessage", "SMS", "RCS", "auto"]]

Preferred messaging service type. Includes “auto” for default fallback behavior.

One of the following:
"iMessage"
"SMS"
"RCS"
"auto"
read_at: Optional[datetime]

When the message was read. Null if not yet read.

formatdate-time
reconciled_at: Optional[datetime]

Present only when this message was recovered by reconciliation rather than delivered live, and set to the time of that recovery. The field is omitted entirely for normally-delivered messages, which is the overwhelming majority. When present, expect sent_at to be substantially earlier than delivery of this event: the message is genuine but is arriving late and out of real-time order, so treat it as history rather than as a live inbound (for example, suppress auto-replies).

formatdate-time
reply_to: Optional[ReplyTo]

Reference to the message this is replying to (for threaded replies)

message_id: Optional[str]

ID of the message being replied to

formatuuid
part_index: Optional[int]

Index of the part being replied to

formatint32
minimum0
sent_at: Optional[datetime]

When the message was sent. Null if not yet sent.

formatdate-time
class MessagePayload:

Message content nested within webhook events

id: Optional[str]

Message identifier

formatuuid
created_at: Optional[datetime]

When the message record was created

formatdate-time
delivered_at: Optional[datetime]

When the message was delivered

formatdate-time
effect: Optional[SchemasMessageEffect]

iMessage effect applied to a message (screen or bubble animation)

name: Optional[str]

Effect name (confetti, fireworks, slam, gentle, etc.)

type: Optional[Literal["screen", "bubble"]]

Effect category

One of the following:
"screen"
"bubble"
is_delivered: Optional[bool]

Whether the message has been delivered

is_read: Optional[bool]

Whether the message has been read

parts: Optional[List[Part]]

Message content parts (text and/or media)

One of the following:
class SchemasTextPartResponse:

A text message part

type: Literal["text"]

Indicates this is a text message part

value: str

The text content

mention: Optional[str]

Handle (E.164 phone number or Apple ID email) of the @mentioned chat participant, as sent. null when the part carries no mention.

mention_range: Optional[List[int]]

Character range [start, end) in value highlighted as the mention, as sent. null when the send omitted it (the whole value is highlighted) or the part carries no mention. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

text_decorations: Optional[List[TextDecoration]]

Text decorations applied to character ranges in the value

range: List[int]

Character range [start, end) in the value string where the decoration applies. start is inclusive, end is exclusive. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

animation: Optional[Literal["big", "small", "shake", 5 more]]

Animated text effect to apply. Mutually exclusive with style.

One of the following:
"big"
"small"
"shake"
"nod"
"explode"
"ripple"
"bloom"
"jitter"
style: Optional[Literal["bold", "italic", "strikethrough", "underline"]]

Text style to apply. Mutually exclusive with animation.

One of the following:
"bold"
"italic"
"strikethrough"
"underline"
class SchemasMediaPartResponse:

A media attachment part

id: str

Unique attachment identifier

formatuuid
filename: str

Original filename

mime_type: str

MIME type of the file

size_bytes: int

File size in bytes

type: Literal["media"]

Indicates this is a media attachment part

url: str

Presigned URL for downloading the attachment (expires in 1 hour).

formaturi
class PartSchemasLinkPartResponse:

A rich link preview part

type: Literal["link"]

Indicates this is a rich link preview part

value: str

The URL

class PartSchemasIMessageAppPartResponse:

An iMessage app card part.

app: PartSchemasIMessageAppPartResponseApp

Identifies the iMessage app (Messages app extension) that backs the card.

bundle_id: str

Bundle identifier of the Messages app extension.

name: str

Display name of the app.

team_id: str

The app’s 10-character team identifier.

app_store_id: Optional[int]

The owning app’s App Store id, when known.

formatint64
layout: PartSchemasIMessageAppPartResponseLayout

Visible layout of the card.

caption: Optional[str]

Primary label, top-left and bold.

subcaption: Optional[str]

Secondary label, below caption on the left.

trailing_caption: Optional[str]

Label shown top-right.

trailing_subcaption: Optional[str]

Label shown below trailing_caption.

type: Literal["imessage_app"]

Indicates this is an iMessage app card part.

url: str

The URL the recipient’s app opens when the user taps the card.

formaturi
fallback_text: Optional[str]

Fallback text for surfaces that cannot render the card.

class PartSchemasAppClipPartResponse:

An Apple Pay App Clip payment card part

type: Literal["app_clip"]

Indicates this is an App Clip payment card part

value: str

The checkout link the card opens

description: Optional[str]

The card’s summary line, composed by Linq from the checkout session

image_url: Optional[str]

The card’s preview image

title: Optional[str]

The card’s headline, composed by Linq from the checkout session

read_at: Optional[datetime]

When the message was read

formatdate-time
reconciled_at: Optional[datetime]

Present only when this message was recovered by reconciliation rather than delivered live, and set to the time of that recovery. The field is omitted entirely for normally-delivered messages, which is the overwhelming majority. When present, expect sent_at to be substantially earlier than delivery of this event: the message is genuine but is arriving late and out of real-time order, so treat it as history rather than as a live inbound (for example, suppress auto-replies).

formatdate-time
reply_to: Optional[ReplyTo]

Reference to the message this is replying to

message_id: Optional[str]

The ID of the message being replied to

formatuuid
part_index: Optional[int]

Index of the message part being replied to (0-based)

formatint32
minimum0
sent_at: Optional[datetime]

When the message was sent

formatdate-time
updated_at: Optional[datetime]

When the message record was last updated

formatdate-time
class ReactionEventBase:
is_from_me: bool

Whether this reaction was from the owner of the phone number (true) or from someone else (false)

reaction_type: ReactionType

Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question. Custom emoji reactions have type “custom” with the actual emoji in the custom_emoji field. Sticker reactions have type “sticker” with sticker attachment details in the sticker field.

One of the following:
"love"
"like"
"dislike"
"laugh"
"emphasize"
"question"
"custom"
"sticker"
chat_id: Optional[str]

Chat identifier (UUID)

custom_emoji: Optional[str]

The actual emoji when reaction_type is “custom”. Null for standard tapbacks.

Deprecatedfrom_: Optional[str]

DEPRECATED: Use from_handle instead. Phone number or email address of the person who added/removed the reaction.

from_handle: Optional[ChatHandle]

The person who added/removed the reaction as a full handle object

id: str

Unique identifier for this handle

formatuuid
handle: str

Phone number (E.164) or email address of the participant

joined_at: datetime

When this participant joined the chat

formatdate-time
service: ServiceType

Messaging service type

One of the following:
"iMessage"
"SMS"
"RCS"
is_me: Optional[bool]

Whether this handle belongs to the sender (your phone number)

left_at: Optional[datetime]

When they left (if applicable)

formatdate-time
status: Optional[Literal["active", "left", "removed"]]

Participant status

One of the following:
"active"
"left"
"removed"
message_id: Optional[str]

Message identifier (UUID) that the reaction was added to or removed from

part_index: Optional[int]

Index of the message part that was reacted to (0-based)

formatint32
minimum0
reacted_at: Optional[datetime]

When the reaction was added or removed

formatdate-time
service: Optional[ServiceType]

Messaging service type

One of the following:
"iMessage"
"SMS"
"RCS"
sticker: Optional[Sticker]

Sticker attachment details when reaction_type is “sticker”. Null for non-sticker reactions.

file_name: Optional[str]

Filename of the sticker

height: Optional[int]

Sticker image height in pixels

mime_type: Optional[str]

MIME type of the sticker image

url: Optional[str]

Presigned URL for downloading the sticker image (expires in 1 hour).

formaturi
width: Optional[int]

Sticker image width in pixels

class SchemasMediaPartResponse:

A media attachment part

id: str

Unique attachment identifier

formatuuid
filename: str

Original filename

mime_type: str

MIME type of the file

size_bytes: int

File size in bytes

type: Literal["media"]

Indicates this is a media attachment part

url: str

Presigned URL for downloading the attachment (expires in 1 hour).

formaturi
class SchemasMessageEffect:

iMessage effect applied to a message (screen or bubble animation)

name: Optional[str]

Effect name (confetti, fireworks, slam, gentle, etc.)

type: Optional[Literal["screen", "bubble"]]

Effect category

One of the following:
"screen"
"bubble"
class SchemasTextPartResponse:

A text message part

type: Literal["text"]

Indicates this is a text message part

value: str

The text content

mention: Optional[str]

Handle (E.164 phone number or Apple ID email) of the @mentioned chat participant, as sent. null when the part carries no mention.

mention_range: Optional[List[int]]

Character range [start, end) in value highlighted as the mention, as sent. null when the send omitted it (the whole value is highlighted) or the part carries no mention. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

text_decorations: Optional[List[TextDecoration]]

Text decorations applied to character ranges in the value

range: List[int]

Character range [start, end) in the value string where the decoration applies. start is inclusive, end is exclusive. Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.

animation: Optional[Literal["big", "small", "shake", 5 more]]

Animated text effect to apply. Mutually exclusive with style.

One of the following:
"big"
"small"
"shake"
"nod"
"explode"
"ripple"
"bloom"
"jitter"
style: Optional[Literal["bold", "italic", "strikethrough", "underline"]]

Text style to apply. Mutually exclusive with animation.

One of the following:
"bold"
"italic"
"strikethrough"
"underline"