HubSpot · JSON Structure

Conversations Api Message Collection Structure

Paginated collection of messages

Type: object Properties: 2 Required: 1
AnalyticsCommerceContentCRMCustomer ServiceEmail MarketingMarketingMarketing AutomationOperationsSales

MessageCollection is a JSON Structure definition published by HubSpot, describing 2 properties, of which 1 is required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

results paging

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-structure/conversations-api-message-collection-structure.json",
  "name": "MessageCollection",
  "description": "Paginated collection of messages",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Represents a message within a conversation thread.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the message",
            "example": "msg_123456"
          },
          "type": {
            "type": "string",
            "enum": [
              "MESSAGE",
              "COMMENT",
              "WELCOME_MESSAGE"
            ],
            "description": "Type of message",
            "example": "MESSAGE"
          },
          "text": {
            "type": "string",
            "description": "Plain text content of the message",
            "example": "Hello, I need help with my order."
          },
          "richText": {
            "type": "string",
            "description": "Rich text (HTML) content of the message",
            "example": "<p>Hello, I need help with my order.</p>"
          },
          "direction": {
            "type": "string",
            "enum": [
              "INCOMING",
              "OUTGOING"
            ],
            "description": "Direction of the message (incoming or outgoing)",
            "example": "INCOMING"
          },
          "channelId": {
            "type": "string",
            "description": "ID of the communication channel",
            "example": "channel_789"
          },
          "channelAccountId": {
            "type": "string",
            "description": "ID of the channel account",
            "example": "account_123"
          },
          "senders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Actor"
            },
            "description": "List of message senders",
            "example": [
              {
                "id": "actor_101",
                "actorId": "actor_101",
                "name": "John Customer",
                "email": "john@example.com",
                "type": "VISITOR"
              }
            ]
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Actor"
            },
            "description": "List of message recipients",
            "example": [
              {
                "id": "actor_101",
                "actorId": "actor_101",
                "name": "John Customer",
                "email": "john@example.com",
                "type": "VISITOR"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/MessageStatus"
          },
          "createdAt": {
            "type": "datetime",
            "description": "ISO 8601 timestamp when the message was created",
            "example": "2024-01-20T10:30:00Z"
          },
          "truncationStatus": {
            "type": "string",
            "description": "Whether the message was truncated",
            "example": "NOT_TRUNCATED"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "description": "Message attachments",
            "example": [
              {
                "id": "attach_001",
                "type": "application/pdf",
                "url": "https://api.hubapi.com/files/v3/files/attach_001",
                "filename": "invoice.pdf",
                "size": 102400
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "createdAt"
        ]
      },
      "description": "Array of message records",
      "example": [
        {
          "id": "msg_123456",
          "type": "MESSAGE",
          "text": "Hello, I need help with my order.",
          "richText": "<p>Hello, I need help with my order.</p>",
          "direction": "INCOMING",
          "channelId": "channel_789",
          "channelAccountId": "account_123",
          "senders": [
            {
              "id": "actor_101",
              "actorId": "actor_101",
              "name": "John Customer",
              "email": "john@example.com",
              "type": "VISITOR"
            }
          ],
          "recipients": [
            {
              "id": "actor_101",
              "actorId": "actor_101",
              "name": "John Customer",
              "email": "john@example.com",
              "type": "VISITOR"
            }
          ],
          "status": {},
          "createdAt": "2024-01-20T10:30:00Z",
          "truncationStatus": "NOT_TRUNCATED",
          "attachments": [
            {
              "id": "attach_001",
              "type": "application/pdf",
              "url": "https://api.hubapi.com/files/v3/files/attach_001",
              "filename": "invoice.pdf",
              "size": 102400
            }
          ]
        }
      ]
    },
    "paging": {
      "type": "object",
      "description": "Pagination information for list responses.",
      "properties": {
        "next": {
          "type": "object",
          "description": "Pagination cursor information for retrieving the next page.",
          "properties": {
            "after": {
              "type": "string",
              "description": "Cursor token for the next page",
              "example": "NTI1Cg%3D%3D"
            },
            "link": {
              "type": "string",
              "description": "API link to the next page",
              "example": "/conversations/v3/conversations/inboxes?after=NTI1Cg%3D%3D"
            }
          }
        }
      }
    }
  },
  "required": [
    "results"
  ]
}