Sends a contact card — a name and phone number — to a user, group, or channel.
💡 Bothphone_numberandnameare required. Include the country code in the phone number, without a leading+.
Request
method is "sendContact".Field | Type | Required | Description |
chat_id | String | Yes | The target chat or user. |
phone_number | String | Yes | Contact's phone number, including country code. |
name | String | Yes | Contact's full name. |
app_id | String | Yes | The app the message belongs to. |
reference | Long | Yes | Your local id for the message. Echoed back in messageAck so you can match them up. |
to_user_id | String | Optional | Target a single user inside a group or channel. |
reply_to_message_id | String | Optional | Set this to send the contact as a reply to an existing message. |
echo | Integer | Optional | 1 returns a copy of the sent message to you. Default 0. |
web_page_preview | Integer | Optional | 1 disable preview · 2 hide the link · 3 instant view · 4 instant view without the link. |
disable_notification | Boolean | Optional | Deliver silently — the user gets no notification sound. |
menu_ref | String | Optional | Attach an existing predefined menu, shown inline beneath the message. |
inline_menu | Array of Menu | Optional | Attach a menu defined inline. Takes priority over menu_ref if both are set. |
chat_settings | Integer | Optional | 1 routes the message to the Bot Manager, used for admin-only communication. |
Preconditions
Your API needs the right permission, and the right standing in the chat.
Requirement | Needed for |
"Send Message" permission | Sending at all. |
"Reply to Message" permission | Only when using reply_to_message_id. |
Chat type | Your API must be |
--- | --- |
User chat | Already started by the user |
Group | A member |
Channel | An admin |
Response
When | Method | What it tells you |
Always | messageAck | The server accepted the message. Carries the new message_id and echoes your reference. |
If echo = 1 | message | A full copy of the message as it was sent. |
SDKs
SDK | Call | Callback |
Java | api.sendContact(chatId, phoneNumber, name, reference, appId); | onMessagAckCallback(MessageAck msgAck) |
JavaScript | api.sendContact(chatId, phoneNumber, name, reference, appId); | onMessagAckCallback(msgAck) |
Python | napi.send_contact(chat_id=chat_id, phone_number=phone_number, name=name, reference=reference, app_id=app_id) | on_message_ack_callback(self, msg_ack) |
Example
Request
json{ "method": "sendContact", "chat_id": "90090684438172188", "name": "Adam Harley", "phone_number": "16134567890", "reference": 111111147, "app_id": "90090684293000559", "echo": 1 }
javaapi.sendContact(chatId, phoneNumber, name, reference, appId);
javascriptapi.sendContact(chatId, phoneNumber, name, reference, appId);
pythonnapi.send_contact(chat_id=chat_id, phone_number=phone_number, name=name, reference=reference, app_id=app_id)
Response
json{ "method": "messageAck", "ack": { "reference": 111111147, "date": 1741983544156, "gmid": 25, "message_id": "d1_Y55weZ5M126268" } }
And, because
echo was 1:json{ "method": "message", "app_id": 90090684293000559, "message": { "message_id": "d1_Y55weZ5M126268", "reference": 111111147, "date": 1741983544156, "gmid": "25", "type": "contact", "contact": { "name": "Adam Harley", "phone_number": "16134567890" }, "chat": { "id": "90090684438172188", "title": "New Chat", "type": "Group" }, "from": { "id": "90091783822039252", "name": "My First API", "type": "Bot", "terminal": "API" } } }