For the complete documentation index, see llms.txt. This page is also available as Markdown.

Messaging

Endpoints related to reading and sending direct messages on connected social media accounts.

List conversations

get

Lists the current user's direct-message conversations from their connected social accounts, ordered by last activity time (most recent first). Supports cursor-based pagination and filtering by platform and account.

Authorizations
blotato-api-keystringRequired
Query parameters
limitinteger · min: 1 · max: 250Optional

Maximum number of conversations to return. Defaults to 50.

Default: 50
cursorstringOptional

Opaque cursor returned by a previous call. Pass it to fetch the next page.

platformstring · enumOptionalPossible values:
accountIdstringOptional

Filter to conversations belonging to a single connected account.

Responses
200

Default Response

application/json
cursorstringOptional

Cursor for the next page. Absent when there are no more conversations.

get/v2/conversations
GET /v2/conversations HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
  "items": [
    {
      "accountId": "text",
      "createdAt": "text",
      "id": "text",
      "participants": [
        {
          "id": "text",
          "name": "text",
          "profileImageUrl": "text",
          "username": "text"
        }
      ],
      "platform": "facebook",
      "updatedAt": "text"
    }
  ],
  "cursor": "text"
}

Get a conversation

get

Fetches a single conversation by id, including participant metadata.

Authorizations
blotato-api-keystringRequired
Path parameters
conversationIdstringRequired
Responses
200

Default Response

application/json
accountIdstringRequired

ID of the social account this conversation belongs to.

createdAtstringRequired
idstringRequired
platformstring · enumRequiredPossible values:
updatedAtstringRequired
get/v2/conversations/{conversationId}
GET /v2/conversations/{conversationId} HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
  "accountId": "text",
  "createdAt": "text",
  "id": "text",
  "participants": [
    {
      "id": "text",
      "name": "text",
      "profileImageUrl": "text",
      "username": "text"
    }
  ],
  "platform": "facebook",
  "updatedAt": "text"
}

List messages

get

Lists the current user's messages from their connected social accounts, ordered by creation time (most recent first). Supports cursor-based pagination and filtering by platform and conversation.

Authorizations
blotato-api-keystringRequired
Query parameters
limitinteger · min: 1 · max: 250Optional

Maximum number of messages to return. Defaults to 50.

Default: 50
cursorstringOptional

Opaque cursor returned by a previous call. Pass it to fetch the next page.

conversationIdstringOptional

Filter to messages within a single conversation.

accountIdstringOptional

Filter to messages belonging to a single connected account.

Responses
200

Default Response

application/json
cursorstringOptional

Cursor for the next page. Absent when there are no more messages.

get/v2/messages
GET /v2/messages HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
  "items": [
    {
      "conversationId": "text",
      "createdAt": "text",
      "direction": "incoming",
      "errorCode": 1,
      "errorMessage": "text",
      "id": "text",
      "payload": {
        "attachment": {
          "type": "button",
          "buttons": [
            {
              "type": "web_url",
              "title": "text",
              "url": "text"
            }
          ]
        },
        "quickReplies": [
          {
            "title": "text",
            "payload": "text"
          }
        ],
        "selection": {
          "payload": "text",
          "type": "postback"
        }
      },
      "platform": "facebook",
      "recipientId": "text",
      "senderId": "text",
      "status": "delivered",
      "text": "text"
    }
  ],
  "cursor": "text"
}

Send a message

post

Sends a direct message to a single recipient on the specified platform.

Authorizations
blotato-api-keystringRequired
Body
accountIdstringRequired

Blotato id of the connected social account the message is sent from.

targetone ofRequired
or
recipientIdstringRequired

Platform-native id of the recipient (e.g. Instagram business-scoped user id).

textstring · min: 1 · max: 10000Required

Plain-text message body.

Responses
201

Default Response

application/json
conversationIdstring · nullableRequired

Parent Blotato conversation id.

createdAtstringRequired
directionstring · enumRequiredPossible values:
errorCodeinteger · nullableRequired

Set only when status is failed.

errorMessagestring · nullableRequired

Set only when status is failed.

idstringRequired
platformstring · enumRequiredPossible values:
recipientIdstringRequired
senderIdstring · nullableRequired
statusstring · enumRequiredPossible values:
textstringRequired
post/v2/messages
POST /v2/messages HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 310

{
  "accountId": "text",
  "target": {
    "targetType": "facebook",
    "pageId": "123456789",
    "attachment": {
      "type": "button",
      "buttons": [
        {
          "type": "web_url",
          "title": "text",
          "url": "text"
        }
      ]
    },
    "commentId": "text",
    "quickReplies": [
      {
        "title": "text",
        "payload": "text"
      }
    ],
    "responseType": "RESPONSE",
    "tag": "text"
  },
  "recipientId": "text",
  "text": "text"
}
{
  "conversationId": "text",
  "createdAt": "text",
  "direction": "incoming",
  "errorCode": 1,
  "errorMessage": "text",
  "id": "text",
  "payload": {
    "attachment": {
      "type": "button",
      "buttons": [
        {
          "type": "web_url",
          "title": "text",
          "url": "text"
        }
      ]
    },
    "quickReplies": [
      {
        "title": "text",
        "payload": "text"
      }
    ],
    "selection": {
      "payload": "text",
      "type": "postback"
    }
  },
  "platform": "facebook",
  "recipientId": "text",
  "senderId": "text",
  "status": "delivered",
  "text": "text"
}

Get a message

get

Fetches a single direct message by its Blotato ID. The message may be an inbound message received from a contact, or an outbound message the user sent through Blotato.

Authorizations
blotato-api-keystringRequired
Path parameters
messageIdstringRequired

Blotato id of the message to fetch.

Responses
200

Default Response

application/json
conversationIdstring · nullableRequired

Parent Blotato conversation id.

createdAtstringRequired
directionstring · enumRequiredPossible values:
errorCodeinteger · nullableRequired

Set only when status is failed.

errorMessagestring · nullableRequired

Set only when status is failed.

idstringRequired
platformstring · enumRequiredPossible values:
recipientIdstringRequired
senderIdstring · nullableRequired
statusstring · enumRequiredPossible values:
textstringRequired
get/v2/messages/{messageId}
GET /v2/messages/{messageId} HTTP/1.1
Host: backend.blotato.com
blotato-api-key: YOUR_API_KEY
Accept: */*
{
  "conversationId": "text",
  "createdAt": "text",
  "direction": "incoming",
  "errorCode": 1,
  "errorMessage": "text",
  "id": "text",
  "payload": {
    "attachment": {
      "type": "button",
      "buttons": [
        {
          "type": "web_url",
          "title": "text",
          "url": "text"
        }
      ]
    },
    "quickReplies": [
      {
        "title": "text",
        "payload": "text"
      }
    ],
    "selection": {
      "payload": "text",
      "type": "postback"
    }
  },
  "platform": "facebook",
  "recipientId": "text",
  "senderId": "text",
  "status": "delivered",
  "text": "text"
}

Last updated