API reference
Comments and messages
Read your comments inbox, reply to, hide and delete comments, and read and send Instagram and Facebook direct messages.
Comments and messages are collected by Flenvio as they arrive (YouTube comments are checked every 5 minutes), so lists show what Flenvio has received, not a live view of the platform. TikTok comments aren’t available.
| Platform | List and reply | Hide | Delete | Direct messages |
|---|---|---|---|---|
| Yes | Yes | Yes | Yes | |
| Yes | Yes | Yes | Yes | |
| Threads | Yes | Yes | Only replies your own account wrote | No |
| YouTube | Yes | Yes (rejects the comment) | Yes | No |
List comments (all platforms)
/v1/commentsOne feed of comments across your Instagram, Facebook, Threads and YouTube accounts, newest first. Deleted comments are left out.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Use an item’s id and platform with the actions below. parentProviderId is set on replies. mediaRef is the platform’s id of the post the comment is on (not a Flenvio post id).
Parameters
limitquery · integer1–50, default 25.
cursorquery · stringThe
nextCursorfrom the previous page.accountIdsquery · comma-separated idsOnly these accounts.
groupIdquery · stringOnly members of this group. With
accountIdstoo, only accounts in both.platformsquery · comma-separatedINSTAGRAM,FACEBOOK,THREADS,YOUTUBE.hiddenquery · `true` | `false`Only hidden, or only visible, comments.
dateFromquery · ISO 8601Posted at or after.
dateToquery · ISO 8601Posted at or before.
Example request
curl "https://api.flenvio.com/v1/comments?limit=25&platforms=INSTAGRAM%2CYOUTUBE&hidden=false" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
{
"items": [
{
"id": "c0111e17-0000-4000-8000-000000000001",
"platform": "INSTAGRAM",
"providerCommentId": "17900000000000001",
"parentProviderId": null,
"author": "jen.ceramics",
"text": "Is the Huila available as whole beans?",
"hidden": false,
"providerCreatedAt": "2026-10-12T08:14:00.000Z",
"account": {
"id": "acc1a000-0000-4000-8000-000000000001",
"platform": "INSTAGRAM",
"accountName": "lumen.coffee",
"avatarUrl": null
},
"mediaRef": "18000000000000001"
}
],
"nextCursor": "MjAyNi0xMC0xMlQwODoxNDowMC4wMDBafGMwMTExZTE3…"
}Errors
| Status | When |
|---|---|
400 | Invalid filter (for example TIKTOK in platforms) or Invalid cursor. |
404 | Group not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
List one account’s comments
/v1/{platform}/accounts/{accountId}/commentsUp to the 100 most recent comments Flenvio has for one account. Not paginated; prefer GET /v1/comments for new code.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Fields differ slightly by platform: the author is authorUsername (Instagram, Threads), authorName (Facebook) or authorDisplayName (YouTube), and YouTube has moderationStatus instead of hidden.
Parameters
{platform}requiredpath · stringinstagram,facebook,threadsoryoutube(the comment’s platform).accountIdrequiredpath · stringAccount id.
Example request
curl "https://api.flenvio.com/v1/instagram/accounts/acc1a000-0000-4000-8000-000000000001/comments" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
[
{
"id": "c0111e17-0000-4000-8000-000000000001",
"text": "Is the Huila available as whole beans?",
"authorUsername": "jen.ceramics",
"parentProviderId": null,
"hidden": false,
"instagramMediaId": "f00d0000-0000-4000-8000-000000000001",
"providerCreatedAt": "2026-10-12T08:14:00.000Z",
"createdAt": "2026-10-12T08:14:03.000Z"
}
]Errors
| Status | When |
|---|---|
404 | Account not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
Reply to a comment
/v1/{platform}/comments/{commentId}/repliesPosts a public reply as your account. The reply shows up in the comment lists once the platform reports it back.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
On YouTube, replying to a reply attaches it to the top-level comment.
Parameters
{platform}requiredpath · stringinstagram,facebook,threadsoryoutube(the comment’s platform).commentIdrequiredpath · stringThe comment’s Flenvio
id.messagerequiredbody · string1–2,200 characters.
Example request
curl -X POST "https://api.flenvio.com/v1/instagram/comments/c0111e17-0000-4000-8000-000000000001/replies" \
-H "x-api-key: $FLENVIO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"message": "Yes! Whole beans or ground, your choice."
}'Response 201
id is the reply’s id on the platform.
{
"id": "17900000000000002",
"status": "sent"
}Errors
| Status | When |
|---|---|
400 | Empty or too long message. |
404 | Comment not found. |
500 | The platform refused or couldn’t be reached. The response doesn’t include the platform’s reason; check the account’s connection and try again later. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
403 | code: "api_key_read_only": the API key is read-only, and this request changes something. |
Hide or unhide a comment
/v1/{platform}/comments/{commentId}/hideHides the comment from the public (or shows it again with /unhide). On YouTube this rejects the comment (moderationStatus: "rejected"), and unhide publishes it.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Parameters
{platform}requiredpath · stringinstagram,facebook,threadsoryoutube(the comment’s platform).commentIdrequiredpath · stringThe comment’s Flenvio
id.
Example request
curl -X POST "https://api.flenvio.com/v1/instagram/comments/c0111e17-0000-4000-8000-000000000001/hide" \
-H "x-api-key: $FLENVIO_API_KEY"Response 201
Instagram, Facebook, Threads:
{
"id": "c0111e17-0000-4000-8000-000000000001",
"hidden": true
}Response 201
YouTube:
{
"id": "c0111e17-0000-4000-8000-000000000001",
"moderationStatus": "rejected"
}Errors
| Status | When |
|---|---|
404 | Comment not found. |
500 | The platform refused or couldn’t be reached. The response doesn’t include the platform’s reason; check the account’s connection and try again later. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
403 | code: "api_key_read_only": the API key is read-only, and this request changes something. |
Delete a comment
/v1/{platform}/comments/{commentId}Deletes the comment on the platform. On Threads only replies written by your own account can be deleted; hide others instead.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Parameters
{platform}requiredpath · stringinstagram,facebook,threadsoryoutube(the comment’s platform).commentIdrequiredpath · stringThe comment’s Flenvio
id.
Example request
curl -X DELETE "https://api.flenvio.com/v1/instagram/comments/c0111e17-0000-4000-8000-000000000001" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
{
"id": "c0111e17-0000-4000-8000-000000000001",
"deleted": true
}Errors
| Status | When |
|---|---|
400 | Threads: Threads only allows deleting replies authored by your own account. Use hide instead. |
404 | Comment not found. |
500 | The platform refused or couldn’t be reached. The response doesn’t include the platform’s reason; check the account’s connection and try again later. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
403 | code: "api_key_read_only": the API key is read-only, and this request changes something. |
List conversations
/v1/{instagram|facebook}/accounts/{accountId}/conversationsDirect-message conversations for an Instagram or Facebook account, most recent first (up to 100).
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Parameters
accountIdrequiredpath · stringAccount id.
Example request
curl "https://api.flenvio.com/v1/instagram/accounts/acc1a000-0000-4000-8000-000000000001/conversations" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
[
{
"id": "c0a7e000-0000-4000-8000-000000000001",
"providerConversationId": "aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6example",
"participantName": "jen.ceramics",
"lastMessageAt": "2026-10-12T08:20:00.000Z",
"createdAt": "2026-10-10T17:02:00.000Z"
}
]Errors
| Status | When |
|---|---|
404 | Account not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
List the inbox
/v1/inbox/conversationsConversations from every connected Facebook Page and Instagram account, most recent first (up to 200), each with its account, last message and unread count. Narrow it to one account or one group.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
unreadCount is the number of messages received since the conversation was last opened in Flenvio or marked read.
Parameters
accountIdquery · stringOnly this account’s conversations.
groupIdquery · stringOnly the conversations of this group’s Facebook and Instagram accounts.
Example request
curl "https://api.flenvio.com/v1/inbox/conversations" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
[
{
"id": "c0a7e000-0000-4000-8000-000000000001",
"providerConversationId": "aWdfZAG06MTpJR01lc3NhZA2VUaHJlYWQ6example",
"participantName": "@jen.ceramics",
"lastMessageAt": "2026-10-12T08:20:00.000Z",
"createdAt": "2026-10-10T17:02:00.000Z",
"unreadCount": 2,
"account": {
"id": "acc1a000-0000-4000-8000-000000000001",
"accountName": "lumen.coffee",
"platform": "INSTAGRAM",
"avatarUrl": null
},
"lastMessage": {
"text": "Do you ship to Canada?",
"direction": "INBOUND"
}
}
]Errors
| Status | When |
|---|---|
400 | accountId or groupId isn’t a valid id. |
404 | Group not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
Count unread conversations
/v1/inbox/unreadHow many conversations have unread messages, in total and per account. Accounts with none are left out.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Example request
curl "https://api.flenvio.com/v1/inbox/unread" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
{
"total": 3,
"accounts": [
{
"accountId": "acc1a000-0000-4000-8000-000000000001",
"conversations": 2
},
{
"accountId": "acc1a000-0000-4000-8000-000000000002",
"conversations": 1
}
]
}Errors
| Status | When |
|---|---|
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
Mark a conversation read
/v1/inbox/conversations/{conversationId}/readClears a conversation’s unread count. Sending a message in it does the same.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Parameters
conversationIdrequiredpath · stringConversation id.
Example request
curl -X POST "https://api.flenvio.com/v1/inbox/conversations/c0a7e000-0000-4000-8000-000000000001/read" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
{
"read": true
}Errors
| Status | When |
|---|---|
404 | Conversation not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
403 | code: "api_key_read_only": the API key is read-only, and this request changes something. |
List messages
/v1/{instagram|facebook}/conversations/{conversationId}/messagesMessages in a conversation, oldest first (up to 200). direction is INBOUND or OUTBOUND.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
Parameters
conversationIdrequiredpath · stringConversation id.
Example request
curl "https://api.flenvio.com/v1/instagram/conversations/c0a7e000-0000-4000-8000-000000000001/messages" \
-H "x-api-key: $FLENVIO_API_KEY"Response 200
[
{
"id": "e5500000-0000-4000-8000-000000000001",
"direction": "INBOUND",
"senderId": "17840000000000009",
"text": "Do you ship to Canada?",
"providerCreatedAt": "2026-10-12T08:19:00.000Z",
"createdAt": "2026-10-12T08:19:02.000Z"
}
]Errors
| Status | When |
|---|---|
404 | Conversation not found. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
Send a message
/v1/{instagram|facebook}/conversations/{conversationId}/messagesSends a text message in an existing conversation, as your account. You can’t start new conversations.
- Auth
- API key
x-api-key - Rate limit
- 120/minute
The platform may refuse a message (for example outside its messaging window); that shows up as an error.
Parameters
conversationIdrequiredpath · stringConversation id.
textrequiredbody · string1–1,000 characters.
Example request
curl -X POST "https://api.flenvio.com/v1/instagram/conversations/c0a7e000-0000-4000-8000-000000000001/messages" \
-H "x-api-key: $FLENVIO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"text": "We do! Shipping to Canada takes 4–6 days."
}'Response 201
{
"id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAexample",
"status": "sent"
}Errors
| Status | When |
|---|---|
400 | Empty or too long text. |
404 | Conversation not found. |
500 | The platform refused or couldn’t be reached. The response doesn’t include the platform’s reason; check the account’s connection and try again later. |
401 | Missing, invalid, revoked or expired API key. |
429 | Too many requests to this endpoint; wait Retry-After seconds. |
403 | code: "api_key_read_only": the API key is read-only, and this request changes something. |