App cards
- 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.
| Field | What to enter |
|---|---|
| Name | Your 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 ID | Your Apple developer Team ID: 10 capital letters and digits, under Membership details in your Apple developer account |
| Bundle Identifier | The 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" }
}
}'appis your registered app: its registeredname,teamId,bundleIdand, if you like, itsappStoreId. Another app, a disabled one, or another name is a422atpayload.app.urlis your app's state,https,httpordata, up to 4096 characters. Mapier never fetches it.layout.caption, and an optionallayout.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).interactiveisfalseunless you sendtrue. Sendtrueonly 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:
{
"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
422atpayload.layout.image, and nothing is sent. - A card with a picture cannot be a reply:
target.replyToMessageIdbeside it is a422atpayload.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
failedwithcapability_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.
succeededmeans your line handed the card to Messages. It does not mean the card was delivered, or drawn as your app's card.appCard.updatable: falsemeans Messages gave the card no id: send a new card to change it.ambiguouswitherrorCode: "app_card_unverified"means the card may be in the conversation. Look before you send it again.failedwithcapability_constraint_violationmeans the line's Mac cannot send cards, or the picture the card names./checkcannot 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
messageIdof 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
interactiveand the card keeps its last value. The picture cannot change either:layout.imageon an update is a422. - One update at a time: while the card's last send has not finished, another
update is a
409 conflictwithreason: card_update_in_flight. Wait for thecommandevent, then send it again. - At most 50 updates in any hour, counting every update of one card. The next
is a
429 rate_limitedwithreason: card_update_limit: waitdetails.retryAfterseconds, then send it again under the sameIdempotency-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
422withreason: 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:
{
"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.
updatesis themessageIdof the first card this one replaces, when the app linked it. To answer on your own card, sendapp_card.updatenaming the received card.updatesis best effort: an app links its card to yours only when it sends in your card's session, which is the app's choice, sonulldoes not prove the card is new.urlis the sender's data. Treat it as untrusted input; Mapier never fetches it.url,layoutandinteractivecan each benull, so check each before you read it:urlwhen the card carried none, or is over 16384 characters;layoutwhen the card carried none;- all three on a card from one of Apple's own apps (team id
0000000000), andinteractivewhenever 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. summaryis 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
receiptevent 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 noappStoreIdcannot 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
layoutwhere you can. - No edit or unsend.
message.editandmessage.unsendrefuse a card with a422; 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.
| Error | Means | Fix |
|---|---|---|
404 unsupported_command, not_on_channel | Your organization is not offered app cards, or the line is not iMessage | Ask for app cards, or send from a live iMessage line |
422 validation_failed at payload.app | The app is not registered to your organization, is disabled, or its name differs | Register the app, or send its registered name |
422 validation_failed, conversation_not_confirmed | The line has not confirmed this conversation yet | Send a text first |
403 recipient_not_allowed, recipient_must_write_first | Nobody 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 texted | Wait until someone writes |
403 recipient_not_allowed, app_card_needs_imessage | The conversation's newest message did not go by iMessage | Wait until the person writes by iMessage |
409 conflict, card_update_in_flight | The card's last send has not finished | Wait for its command event, then update again |
422 validation_failed, card_not_updatable | This card cannot be updated | Send a new card |
429 rate_limited, card_update_limit | The card has had 50 updates in the past hour | Wait details.retryAfter seconds, then update again |
429 rate_limited, shared_line | A test line on a shared number: its budget for your project is spent for now | Wait, then send again |
409 limit_reached | A test line's daily limit is reached | Wait until 00:00 UTC, when it resets |