Your Instagram Direct message threads
instagram.x.user-messagesList Instagram Direct conversations that customers started with your account
- Price
- freeAt provider cost
- Success rate
- —No success-rate data yetNo success-rate data yet
- Latency p50
- ——
- Last verified
- —Not verified yet
GEThttps://toolswitch.dev/v1/tools/instagram.x.user-messagesPreview- Uses platform quota
- Synchronous response
- Reads public data
Parameters
Direct Instagram Login uses the Instagram Professional account id and an Instagram User token. Existing Facebook-backed connections use the linked Page id, add platform=instagram, and keep the same public endpoint id. Conversation ids are Graph API ids; an instagram.com/direct/t/... browser thread id is not interchangeable.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Path parameters | ||||
page_id | string | Required | required with Facebook Page authorization: linked Facebook Page id | 123456789012345 |
ig_user_id | string | Required | required with Instagram Login: numeric Instagram Professional account id | 17841400000000000 |
| Query parameters | ||||
limit | integer | Optional | 25 | |
fields | string | Optional | request participants and messages together when preparing a reply | id,updated_time,participants,messages{id,from,to,message,created_time} |
platform | string | Required | required with Facebook Page authorization; selects Instagram rather than Messenger conversations | instagram |
- Path parameters
page_idstringRequiredrequired with Facebook Page authorization: linked Facebook Page id
Example:
123456789012345ig_user_idstringRequiredrequired with Instagram Login: numeric Instagram Professional account id
Example:
17841400000000000- Query parameters
limitintegerOptionalExample:
25fieldsstringOptionalrequest participants and messages together when preparing a reply
Example:
id,updated_time,participants,messages{id,from,to,message,created_time}platformstringRequiredrequired with Facebook Page authorization; selects Instagram rather than Messenger conversations
Example:
instagram
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
curl -X GET 'https://toolswitch.dev/v1/tools/instagram.x.user-messages' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/instagram.x.user-messages",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/instagram.x.user-messages", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at free, including the service fee.