Name and photo

Works on
  • iMessage

Set the name and photo people see for your line, and offer them in a chat

Three commands work with the name and photo people see for your line in their messages app.

CommandWhat it does
profile.getRead the name and photo. It messages no one.
profile.setChange the name, the photo, or both
profile.shareOffer them to a person in a one-to-one chat

name_photo.get, name_photo.set and name_photo.share are deprecated. Use profile.get, profile.set and profile.share. Results and events name the command name_photo.get, name_photo.set or name_photo.share.

Without a share, a person sees whatever their own contacts hold for your line's address. For someone new, that is only the address.

ChannelPeople see
iMessageWhat these commands set, once you share it

On any channel but iMessage, profile.get, profile.set and profile.share answer 404 unsupported_command.

Set the name and photo

Get and set act on the line, not on a conversation. Name the line by its lineId from GET /v1/whoami.

curl -X POST https://api.mapier.ai/v1/commands/profile.set \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: profile-northwind-1" \
  -H "x-mapier-version: 2026-12-01" \
  -d '{
    "target": { "lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d" },
    "payload": { "name": "Northwind Support", "photoUrl": "https://example.com/northwind.png" }
  }'

Send at least one of name, firstName, lastName and photoUrl. A photoUrl is an https link to a JPEG, PNG, GIF, WEBP or HEIC image of at most 8 MiB, which Mapier fetches before anything changes. A photo you leave out is kept.

The result carries what the line now shows, as namePhoto:

namePhoto
{ "name": "Northwind Support", "firstName": null, "lastName": null, "hasPhoto": true }

After an ambiguous result, read before you set again

When Mapier cannot confirm the change, the result is ambiguous, and the name and photo may or may not have changed. Read them with profile.get before you set them again. hasPhoto is true for the old photo and the new one alike.

Read the name and photo

profile.get takes no payload. Its result carries namePhoto, as above. The photo itself is never returned.

Offer them in a chat

profile.share shows the person the prompt their messages app offers when you start talking to someone new. It works only in a one-to-one conversation the person has already written in: name its conversationId, and send an empty payload. A group, a phone number, or a conversation the person has not written in is refused with 422 validation_failed at target.conversationId, and nothing is sent.

The result is succeeded whether or not the prompt was shown. Messages often skips it when the person has already seen your card, and nothing tells the two apart.

All three commands take an Idempotency-Key, so a retry does not act twice. If your line cannot show a name and photo yet, a get or a set fails, and nothing changes.