POST /v1/instagram/dm/outreach
Instagram DM API: send a direct message by username
Sends one Instagram direct message to a person from an Instagram account we run for your organization, so you never log in to Instagram. Send to (a handle or profile link), text and a client_token; a retry with the same token never sends twice. Keep the id from the answer to read replies with the DM conversation API.
- Price
- $0.0500 per call
- Batch
- No
- Failed calls
- Not charged
Example request
curl -X POST 'https://api.virev.ai/v1/instagram/dm/outreach' \
-H "Authorization: Bearer $VIREV_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"to":"rhino.29941499","text":"Yes, we ship to Seoul! Please send your address and we'\''ll get it out this week.","client_token":"gifting-oct-02"}'import os
import requests
response = requests.request(
"POST",
"https://api.virev.ai/v1/instagram/dm/outreach",
json={
"to": "rhino.29941499",
"text": "Yes, we ship to Seoul! Please send your address and we'll get it out this week.",
"client_token": "gifting-oct-02",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Request body
{
"to": "rhino.29941499",
"text": "Yes, we ship to Seoul! Please send your address and we'll get it out this week.",
"client_token": "gifting-oct-02"
}Example response
The example response of the API reference.
{
"data": {
"id": 21,
"to": {
"handle": "rhino.29941499",
"user_id": "29826377850"
},
"state": "open",
"unanswered": 1,
"last_sent_at": "2026-10-29T20:59:11.259143+00:00",
"last_reply_at": "2026-10-29T20:58:35.973000+00:00",
"started_at": "2026-10-29T20:55:53.540810+00:00",
"updated_at": "2026-10-29T20:59:11.259134+00:00",
"messages": [
{
"id": 84,
"direction": "sent",
"text": "Hi! We're Glow Lab, a clean skincare brand. We love your morning routine videos and would like to send you our new Vitamin C serum, with no strings attached. Can we ship it to you?",
"status": "sent",
"client_token": "gifting-oct-01",
"sent_at": "2026-10-29T20:56:29.831581+00:00"
},
{
"id": 86,
"direction": "received",
"text": "Hi! Thank you, I'd love to try it. Do you ship to Seoul?",
"status": "received",
"client_token": null,
"sent_at": "2026-10-29T20:58:35.973000+00:00"
},
{
"id": 87,
"direction": "sent",
"text": "Yes, we ship to Seoul! Please send your address and we'll get it out this week.",
"status": "sent",
"client_token": "gifting-oct-02",
"sent_at": "2026-10-29T20:59:10.678650+00:00"
}
],
"sent": {
"status": "sent",
"delivered": true,
"deduplicated": false
}
},
"meta": {
"cost": "$0.0500",
"balance": "$2.4238",
"request_id": "req_1b15280c1eeac2f86a7e7b77c832f1f1"
}
}How it works
Sends one Instagram message to a person. If you already have a conversation with them, the message continues it. Otherwise it starts one. We send from an Instagram account we run for your organization, so you never log in to Instagram.
Keep the id from the answer, and pass it to Check conversation to read their replies.
Send a client_token with every message. Retrying with the same token never sends twice and costs $0. A message costs $0.05 only when it goes out.
Errors
| Status | When |
|---|---|
400 | The body is missing to or text, has a field this call does not take, or to is not a handle or profile link. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | Instagram has no account with this handle. Check the spelling in to. Nothing was sent and you are not charged. |
409 | This person has not accepted your first message yet, Instagram paused the account we send this conversation from, or your workspace has no paid credit. |
422 | Instagram will not deliver messages to this person, for example because they blocked the account we send from. Nothing was sent and you are not charged. Do not retry. |
429 | Over the per-minute limit for your organization, out of messages for today, or Instagram asked us to slow down. |
502 | Instagram blocked this call. You are not charged. Retry it. |
503 | We cannot send right now, your workspace or our proxy provider is paused, or billing could not be confirmed. |