Update an app card

Works on
  • iMessage

Replace an iMessage app card your line sent with a new state, in place

POST/v1/commands/app_card.update

Replaces a card your line sent from your iMessage app with a new url, caption and subcaption. The person's phone keeps one card and draws the newest state; no second card appears. Your organization must be offered app cards and hold the app; see App cards.

Name the card by target.messageId: the first card, any update of it, or a card the person sent that replaced it (a received card whose appCard.updates is set). Each of them leads to the same first card, which is the one Messages updates. The app cannot change, and an update is never a reply. An update keeps the picture its card was sent with: payload.layout.image is a 422.

Every update alerts each person in the conversation

An update is a new message to Messages, not a quiet edit: each person's phone shows a new notification for it, with the caption and the full url. Put nothing private in either, and do not update a card more often than a person would want to be alerted.

Honors Idempotency-Key: a repeated key adopts the first update and never sends again.

Body

Target

Prop

Type

Payload

Prop

Type

What is refused before anything is sent

AnswerWhen
404 unsupported_command, reason: not_on_channelYour organization is not offered app cards, whether or not the message exists, or the line is not iMessage
404 not_foundtarget.messageId is not a message this project holds, or not a card
409 conflict, reason: card_update_in_flightThe card's first send or its latest update has not finished. Wait for its command event, then send the update again
422 validation_failed, reason: card_not_updatableAt target.messageId: the first card failed or was never confirmed, Messages gave it no id, the person started it, its app was disabled, or the conversation is now on another line. Send a new card
422 validation_failedAt the field that is wrong: a key beside target.messageId in the target, or a payload field that is missing, out of bounds or not one of those above
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 texted
429 rate_limited, reason: card_update_limitThe card has had 50 updates in the past hour. Wait details.retryAfter seconds, then send the update again under the same Idempotency-Key
429 rate_limited, reason: shared_lineOn a test line on a shared number, its budget for your project is spent for now. An update is counted as any message is
403 recipient_not_allowed, app_card_needs_imessageThe newest message in the conversation did not go by iMessage, or none has been seen

Opt-out, a paused line and rate limits apply as they do on a send.

Example request

curl 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" }
    }
  }'

Response

202 Accepted
{
  "commandId": "0192b3e2-4d7f-7a10-8b21-6c0d2e3f4a5b",
  "status": "queued",
  "repeated": false,
  "lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
  "lineSelection": "reused_active_chat"
}

Then a command event, type: "app_card.update", with the update's own messageId:

  • succeeded with appCard.updatable: true once your line handed the update to Messages. It does not mean the person's phone drew it.
  • failed on a line whose Mac cannot update cards. /check cannot see that beforehand: the update is accepted, settles failed, and never becomes a new card.

Errors

Every command can return the errors listed under How commands work › Errors. Specific to this command, the refusals above.

Guide