App cards

Works on
  • iMessage

Send a card from your own iMessage app, update it in place, and read the cards people send back

An iMessage app lives inside Messages and posts cards into a conversation: a game move, an invitation, an order. If your company publishes one, your line can send a card as that app, replace it with a newer state, and receive the cards people send from it.

A card carries your app's identity, a url holding the state your app's Messages extension reads, and a caption with an optional subcaption. On a phone with your app, a card marked interactive is drawn by your app itself. On a phone without it, Messages draws a small card with your caption and subcaption.

Offered organization by organization

App cards are offered to an organization on request. Until yours is, kind: "app_card" and app_card.update answer 404 unsupported_command with reason: not_on_channel, and GET /v1/whoami does not list them. On a test line on a shared number, a card and an update go out as any message does, counted against that line's budgets. Receiving cards needs nothing turned on.

Register your app

A card goes out only as an app your organization has registered. Only an organization admin can register one: in the console, open Channels › iMessage, find Apps, and choose Add app. Members who are not admins see the list of apps but not Add app.

FieldWhat to enter
NameYour app's name. Every card you send names the app by this, and on a phone without your app it is the name the card shows
Team IDYour Apple developer Team ID: 10 capital letters and digits, under Membership details in your Apple developer account
Bundle IdentifierThe bundle id of your app's Messages extension, not of the app: in Xcode, the extension target's General tab

Only an organization with a dedicated live iMessage line can add an app, and it can add up to 5 apps itself. Each app belongs to one organization at a time. Register only an app your company publishes: Messages trusts the identity a card claims, and Mapier can disable an app registered by anyone else.

Send a card

Send message.send with kind: "app_card" into a conversation:

curl -X POST https://api.mapier.ai/v1/commands/message.send \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: game-7f3a-start" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{
    "target": { "conversationId": "a0000000-0000-4000-8000-000000000001" },
    "payload": {
      "kind": "app_card",
      "app": {
        "name": "Example Games",
        "teamId": "A1B2C3D4E5",
        "bundleId": "com.example.games.MessagesExtension"
      },
      "url": "https://games.example.com/card?game=7f3a",
      "interactive": true,
      "layout": { "caption": "Your move", "subcaption": "Tic-tac-toe" }
    }
  }'
  • app is your registered app: its registered name, teamId, bundleId and, if you like, its appStoreId. Another app, a disabled one, or another name is a 422 at payload.app.
  • url is your app's state, https, http or data, up to 4096 characters. Mapier never fetches it.
  • layout.caption, and an optional layout.subcaption: the words Messages draws where your app does not draw the card itself.
  • layout.image, if you like: the card's picture (see Add a picture).
  • interactive is false unless you send true. Send true only for an app that draws its own bubble: Messages starts such an app as soon as the card is on screen.
  • summary, if you like: accepted and sent, though where Messages shows it is not promised (see Limits).
  • Nothing else goes beside these, not even text.

Like any send, a card can answer a message: name it at target.replyToMessageId, and Mapier passes the reply on with the card. How a phone draws a card sent as a reply is not proven yet.

Add a picture

Put an https link to the picture at layout.image:

payload
{
  "kind": "app_card",
  "app": {
    "name": "Example Games",
    "teamId": "A1B2C3D4E5",
    "bundleId": "com.example.games.MessagesExtension"
  },
  "url": "https://games.example.com/card?game=7f3a",
  "layout": {
    "caption": "Your move",
    "image": "https://games.example.com/boards/7f3a.png"
  }
}
  • The picture is a JPEG, PNG, WebP, HEIC or HEIF image of up to 8388608 bytes (8 MiB), at a link of up to 2048 characters. Mapier fetches it and hands it to your line before the card is written. A link that cannot be fetched, or any other file, is a 422 at payload.layout.image, and nothing is sent.
  • A card with a picture cannot be a reply: target.replyToMessageId beside it is a 422 at payload.layout.image.
  • An update keeps the picture the card was sent with. To show another picture, send a new card.
  • Messages shows the picture only to a person who has your line in their contacts. Anyone else sees the card's words alone.
  • A line whose Mac cannot send card pictures settles the card failed with capability_constraint_violation. It never sends the card without its picture.

A card goes only into a conversation that can take it:

  • a one-to-one conversation the line has confirmed, or a group chat it has reported;
  • where someone other than your line has written. A card cannot start a conversation;
  • whose newest message went by iMessage. A conversation that last went by SMS or RCS, or where no service has been seen yet, is refused.

What the result means

The send's command event carries appCard.updatable.

  • succeeded means your line handed the card to Messages. It does not mean the card was delivered, or drawn as your app's card.
  • appCard.updatable: false means Messages gave the card no id: send a new card to change it.
  • ambiguous with errorCode: "app_card_unverified" means the card may be in the conversation. Look before you send it again.
  • failed with capability_constraint_violation means the line's Mac cannot send cards, or the picture the card names. /check cannot see that in advance.

A card is never sent twice for one Idempotency-Key, at any API version.

Update a card

app_card.update replaces a card your line sent with a new state. The person's phone keeps one card and draws the newest:

curl -X POST https://api.mapier.ai/v1/commands/app_card.update \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: game-7f3a-move-2" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{
    "target": { "messageId": "0192b3e2-3c6e-7f42-a073-5e9b1c4d8f32" },
    "payload": {
      "url": "https://games.example.com/card?game=7f3a&move=2",
      "layout": { "caption": "Your move", "subcaption": "Tic-tac-toe" }
    }
  }'
  • Name the card by the messageId of your first card, of any update of it, or of a card the person sent that replaced it. Every update replaces the first card, so you never track which one is newest.
  • The app cannot change, and an update is never a reply. Leave out interactive and the card keeps its last value. The picture cannot change either: layout.image on an update is a 422.
  • One update at a time: while the card's last send has not finished, another update is a 409 conflict with reason: card_update_in_flight. Wait for the command event, then send it again.
  • At most 50 updates in any hour, counting every update of one card. The next is a 429 rate_limited with reason: card_update_limit: wait details.retryAfter seconds, then send it again under the same Idempotency-Key. An update that was refused or never ran does not count.
  • You cannot update a card the person started, a card that failed or was never confirmed, a card Messages gave no id, a card whose app was disabled, or a card in a conversation now on another line. Each is a 422 with reason: card_not_updatable: send a new card instead.

Every update alerts each person

An update is not a quiet edit. Each person in the conversation gets a new notification for every update, with sound unless their phone is silenced. Update a card when something has happened that is worth an alert, not on a timer.

Receive a card

A card a person sends arrives as a message.received webhook (and a message event on the stream) with kind: "app_card", text: null, no attachments, and the card under appCard. A received card is never a reply:

message.received, data
{
  "messageId": "0192b3f0-7a1c-7d22-9e3b-4c5d6e7f8a9b",
  "conversationId": "a0000000-0000-4000-8000-000000000001",
  "from": "+15555550100",
  "kind": "app_card",
  "text": null,
  "attachments": [],
  "appCard": {
    "app": {
      "name": "Example Games",
      "teamId": "A1B2C3D4E5",
      "bundleId": "com.example.games.MessagesExtension",
      "appStoreId": null
    },
    "url": "https://games.example.com/card?game=7f3a&move=3",
    "interactive": true,
    "layout": { "caption": "Your move", "subcaption": "Tic-tac-toe" },
    "updates": "0192b3e2-3c6e-7f42-a073-5e9b1c4d8f32"
  }
}
  • Any app the person has can send a card, registered with Mapier or not.
  • updates is the messageId of the first card this one replaces, when the app linked it. To answer on your own card, send app_card.update naming the received card. updates is best effort: an app links its card to yours only when it sends in your card's session, which is the app's choice, so null does not prove the card is new.
  • url is the sender's data. Treat it as untrusted input; Mapier never fetches it.
  • url, layout and interactive can each be null, so check each before you read it:
    • url when the card carried none, or is over 16384 characters;
    • layout when the card carried none;
    • all three on a card from one of Apple's own apps (team id 0000000000), and interactive whenever the line could not read the card's contents.
  • The card's picture is not passed on.

A line not yet updated to report cards delivers a card as a message with unreadable text and a picture. Skip a received message you cannot read rather than answer it.

Limits

What Messages showed on real phones, and what that means for your cards:

  • Every update alerts each person. A card and each of its updates is its own notification.
  • A notification shows the caption and the full url. Put nothing private in either: no names, tokens or anything a lock screen should not show.
  • summary is not promised. It is accepted and sent, but in our tests Messages did not show it reliably, and never for an update.
  • No pictures. A card carries words; your app draws anything else itself.
  • No delivery receipts for cards. A card's result says your line handed it to Messages, and no receipt event is promised for a card or an update. In a group chat, Messages reports no card as delivered.
  • No replies on a card. The phone offers no way to reply to a card. A card your agent sends may name a reply, but how a phone draws it is not proven.
  • Without appStoreId, a tap goes nowhere. On a phone without your app, a tap on a card that carries no appStoreId cannot open anything: in our tests it ended in "cannot connect".
  • A caption with a date, a time, an address or a phone number may arrive as plain text. One card with all four stayed a card in our tests, but that is the only case we have run, so keep such details out of layout where you can.
  • No edit or unsend. message.edit and message.unsend refuse a card with a 422; update it instead.
  • Each text is 1 to 4096 characters.

Errors you may see

Each of these comes back at once, and nothing is sent.

ErrorMeansFix
404 unsupported_command, not_on_channelYour organization is not offered app cards, or the line is not iMessageAsk for app cards, or send from a live iMessage line
422 validation_failed at payload.appThe app is not registered to your organization, is disabled, or its name differsRegister the app, or send its registered name
422 validation_failed, conversation_not_confirmedThe line has not confirmed this conversation yetSend a text first
403 recipient_not_allowed, recipient_must_write_firstNobody but your line has written in the conversation. On a test line on a shared number, also: the person has not texted the line, is no longer connected, or has left 20 turns or 100 messages unanswered since they last textedWait until someone writes
403 recipient_not_allowed, app_card_needs_imessageThe conversation's newest message did not go by iMessageWait until the person writes by iMessage
409 conflict, card_update_in_flightThe card's last send has not finishedWait for its command event, then update again
422 validation_failed, card_not_updatableThis card cannot be updatedSend a new card
429 rate_limited, card_update_limitThe card has had 50 updates in the past hourWait details.retryAfter seconds, then update again
429 rate_limited, shared_lineA test line on a shared number: its budget for your project is spent for nowWait, then send again
409 limit_reachedA test line's daily limit is reachedWait until 00:00 UTC, when it resets

Next