HubSpot · Schema

MessageCollection

Paginated collection of messages

AnalyticsCommerceContentCRMCustomer ServiceEmail MarketingMarketingMarketing AutomationOperationsSales

Properties

Name Type Description
results array Array of message records
paging object Pagination information for list responses.
View JSON Schema on GitHub

JSON Schema

conversations-api-message-collection-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/conversations-api-message-collection-schema.json",
  "title": "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": "[email protected]",
                "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": "[email protected]",
                "type": "VISITOR"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/MessageStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "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": "[email protected]",
              "type": "VISITOR"
            }
          ],
          "recipients": [
            {
              "id": "actor_101",
              "actorId": "actor_101",
              "name": "John Customer",
              "email": "[email protected]",
              "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"
  ]
}