Skip to content

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.

PlatformList and replyHideDeleteDirect messages
InstagramYesYesYesYes
FacebookYesYesYesYes
ThreadsYesYesOnly replies your own account wroteNo
YouTubeYesYes (rejects the comment)YesNo

List comments (all platforms)

GET/v1/comments

One 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 · integer

    1–50, default 25.

  • cursorquery · string

    The nextCursor from the previous page.

  • accountIdsquery · comma-separated ids

    Only these accounts.

  • groupIdquery · string

    Only members of this group. With accountIds too, only accounts in both.

  • platformsquery · comma-separated

    INSTAGRAM, FACEBOOK, THREADS, YOUTUBE.

  • hiddenquery · `true` | `false`

    Only hidden, or only visible, comments.

  • dateFromquery · ISO 8601

    Posted at or after.

  • dateToquery · ISO 8601

    Posted 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

200 response
{
  "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

List comments (all platforms) errors
StatusWhen
400Invalid filter (for example TIKTOK in platforms) or Invalid cursor.
404Group not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

List one account’s comments

GET/v1/{platform}/accounts/{accountId}/comments

Up 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 · string

    instagram, facebook, threads or youtube (the comment’s platform).

  • accountIdrequiredpath · string

    Account 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

200 response
[
  {
    "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

List one account’s comments errors
StatusWhen
404Account not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Reply to a comment

POST/v1/{platform}/comments/{commentId}/replies

Posts 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 · string

    instagram, facebook, threads or youtube (the comment’s platform).

  • commentIdrequiredpath · string

    The comment’s Flenvio id.

  • messagerequiredbody · string

    1–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.

201 response
{
  "id": "17900000000000002",
  "status": "sent"
}

Errors

Reply to a comment errors
StatusWhen
400Empty or too long message.
404Comment not found.
500The 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.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

Hide or unhide a comment

POST/v1/{platform}/comments/{commentId}/hide

Hides 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 · string

    instagram, facebook, threads or youtube (the comment’s platform).

  • commentIdrequiredpath · string

    The 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:

201 response
{
  "id": "c0111e17-0000-4000-8000-000000000001",
  "hidden": true
}

Response 201

YouTube:

201 response
{
  "id": "c0111e17-0000-4000-8000-000000000001",
  "moderationStatus": "rejected"
}

Errors

Hide or unhide a comment errors
StatusWhen
404Comment not found.
500The 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.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

Delete a comment

DELETE/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 · string

    instagram, facebook, threads or youtube (the comment’s platform).

  • commentIdrequiredpath · string

    The 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

200 response
{
  "id": "c0111e17-0000-4000-8000-000000000001",
  "deleted": true
}

Errors

Delete a comment errors
StatusWhen
400Threads: Threads only allows deleting replies authored by your own account. Use hide instead.
404Comment not found.
500The 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.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

List conversations

GET/v1/{instagram|facebook}/accounts/{accountId}/conversations

Direct-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 · string

    Account 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

200 response
[
  {
    "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

List conversations errors
StatusWhen
404Account not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

List the inbox

GET/v1/inbox/conversations

Conversations 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 · string

    Only this account’s conversations.

  • groupIdquery · string

    Only 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

200 response
[
  {
    "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

List the inbox errors
StatusWhen
400accountId or groupId isn’t a valid id.
404Group not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Count unread conversations

GET/v1/inbox/unread

How 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

200 response
{
  "total": 3,
  "accounts": [
    {
      "accountId": "acc1a000-0000-4000-8000-000000000001",
      "conversations": 2
    },
    {
      "accountId": "acc1a000-0000-4000-8000-000000000002",
      "conversations": 1
    }
  ]
}

Errors

Count unread conversations errors
StatusWhen
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Mark a conversation read

POST/v1/inbox/conversations/{conversationId}/read

Clears 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 · string

    Conversation 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

200 response
{
  "read": true
}

Errors

Mark a conversation read errors
StatusWhen
404Conversation not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.

List messages

GET/v1/{instagram|facebook}/conversations/{conversationId}/messages

Messages 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 · string

    Conversation 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

200 response
[
  {
    "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

List messages errors
StatusWhen
404Conversation not found.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.

Send a message

POST/v1/{instagram|facebook}/conversations/{conversationId}/messages

Sends 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 · string

    Conversation id.

  • textrequiredbody · string

    1–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

201 response
{
  "id": "aWdfZAG1faXRlbToxOklHTWVzc2FnZAexample",
  "status": "sent"
}

Errors

Send a message errors
StatusWhen
400Empty or too long text.
404Conversation not found.
500The 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.
401Missing, invalid, revoked or expired API key.
429Too many requests to this endpoint; wait Retry-After seconds.
403code: "api_key_read_only": the API key is read-only, and this request changes something.
Comments and direct messages API reference · Flenvio