Send Instagram Text
curl --request POST \
--url https://api.flowiq.live/send-instagram \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instagram_id": "17841400000000000",
"message_type": "text",
"text": "Hello! How can we help?"
}
'import requests
url = "https://api.flowiq.live/send-instagram"
payload = {
"instagram_id": "17841400000000000",
"message_type": "text",
"text": "Hello! How can we help?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instagram_id: '17841400000000000',
message_type: 'text',
text: 'Hello! How can we help?'
})
};
fetch('https://api.flowiq.live/send-instagram', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowiq.live/send-instagram",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instagram_id' => '17841400000000000',
'message_type' => 'text',
'text' => 'Hello! How can we help?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowiq.live/send-instagram"
payload := strings.NewReader("{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flowiq.live/send-instagram")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowiq.live/send-instagram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message_id": "ig.message.example",
"recipient_id": "17841400000000000",
"message_type": "text",
"quoted": false,
"contact": {
"id": "00000000-0000-4000-8000-000000000003",
"name": "Customer",
"instagram_username": "customer"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Send Messages
Send Instagram Text
Send an Instagram text message to an existing contact through FlowIQ, using your organization’s API key.
POST
/
send-instagram
Send Instagram Text
curl --request POST \
--url https://api.flowiq.live/send-instagram \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instagram_id": "17841400000000000",
"message_type": "text",
"text": "Hello! How can we help?"
}
'import requests
url = "https://api.flowiq.live/send-instagram"
payload = {
"instagram_id": "17841400000000000",
"message_type": "text",
"text": "Hello! How can we help?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instagram_id: '17841400000000000',
message_type: 'text',
text: 'Hello! How can we help?'
})
};
fetch('https://api.flowiq.live/send-instagram', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flowiq.live/send-instagram",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instagram_id' => '17841400000000000',
'message_type' => 'text',
'text' => 'Hello! How can we help?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flowiq.live/send-instagram"
payload := strings.NewReader("{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flowiq.live/send-instagram")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flowiq.live/send-instagram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instagram_id\": \"17841400000000000\",\n \"message_type\": \"text\",\n \"text\": \"Hello! How can we help?\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message_id": "ig.message.example",
"recipient_id": "17841400000000000",
"message_type": "text",
"quoted": false,
"contact": {
"id": "00000000-0000-4000-8000-000000000003",
"name": "Customer",
"instagram_username": "customer"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Send a text message to an existing Instagram contact. Use the same organization
Use a contact belonging to the API key’s organization. A username or phone number cannot replace
fiq_ API key as WhatsApp.
Basic Usage
curl -X POST "https://api.flowiq.live/send-instagram" \
-H "Authorization: Bearer fiq_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instagram_id": "17841400000000000",
"message_type": "text",
"text": "Hello! How can we help?"
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
instagram_id | string | One recipient identifier | Instagram-scoped ID, supplied as a string |
contact_id | string | One recipient identifier | FlowIQ contact UUID, as an alternative to instagram_id |
message_type | string | No | Defaults to "text" |
text | string | Yes | Message text, 1–1000 characters |
reply_to_message_id | string | No | Quote an earlier message in this conversation (see below) |
instagram_id. If both identifiers are supplied, they must refer to the same contact. Find an ID with Instagram Conversations.
Instagram permissions and messaging windows still apply. Eligible replies to a recent comment can use the inbox sender’s private-reply fallback.
Reply to a specific message
Addreply_to_message_id to quote an earlier message, the way a person swipes to reply in Instagram. The customer sees the quoted message above your reply.
curl -X POST "https://api.flowiq.live/send-instagram" \
-H "Authorization: Bearer fiq_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instagram_id": "17841400000000000",
"text": "Yes, the 5L is back in stock.",
"reply_to_message_id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZA..."
}'
- Use the message’s
idor itsinstagram_message_id, both returned by Instagram Conversations and by Instagram webhooks. You can quote the customer’s messages or your own. - The message must belong to this conversation, otherwise the request is refused with
400and nothing is sent. - The response says
"quoted": truewhen the customer sees the quote. It isfalsewhen Instagram cannot quote that message (for example a comment rather than a direct message), or when your account is connected to FlowIQ through a partner inbox rather than directly to Instagram. The reply is still sent, without the quote. - Works the same for image, video and audio messages.
Response
Success (200)
{
"success": true,
"message_id": "ig.message.example",
"recipient_id": "17841400000000000",
"message_type": "text",
"quoted": false,
"contact": {
"id": "00000000-0000-4000-8000-000000000003",
"name": "Customer",
"instagram_username": "customer"
}
}
message_id is the Instagram message ID. quoted is true only for a reply sent with reply_to_message_id that the customer sees as a quote. Success means Instagram accepted the message; delivery and read receipts arrive separately when recorded.
Errors
Errors includesuccess: false and an error string. Invalid input returns 400, an invalid or expired key returns 401, and an unknown contact returns 404.
502 or 504 can mean the send outcome is unknown. Read the conversation before retrying; the sender does not retry automatically.
Webhook Events
Registerplatform: "instagram" on Create Webhook. See Instagram event payloads, delivery authentication and signing.Authorizations
Body
application/json
- Option 1
- Option 2
Optional. Quote an earlier message in this conversation: its FlowIQ message id or its instagram_message_id (both returned by GET /instagram-conversations and by webhooks). On accounts connected directly to Instagram the customer sees the quoted message above your reply. On accounts connected through a partner inbox the message is sent without the quote (quoted: false). A message that is not in this conversation is refused with 400.
Maximum string length:
200Response
Message accepted

