h, if i create a CC message with the INTEGRATION_THREAD_ID threading model, is there a way for me to get this integrationThreadId back when i get the message again via API that’s NOT through the webhook event? all i can think of is saving it as a custom property on the message. thanks
Hey @humanroach,
Thanks for posting in the Community!
I’d like to tag in a few experts here to see what they might recommend!
@zach_threadint, @stefen, and @SteveHTM - do any of you have a workaround here?
Shane, Senior Community Moderator
Hi @humanroach,
Yes, you can absolutely retrieve your original integrationThreadId directly from the message payload without having to listen to the webhook event, and you do not need the overhead of saving it as a custom property.
How it Works Natively:
When you retrieve a message using the Conversations Messages API, HubSpot automatically returns the associated custom channel parameters in the response payload.
Because your channel is configured with the INTEGRATION_THREAD_ID threading model, the retrieved message object contains a native property called channelIntegrationThreadIds (an array of strings). This array will house the exact external integrationThreadId that was passed when the message was originally created.
The Endpoints to Use:
To fetch the message history (and get the integrationThreadId in the response), you can use the standard GET endpoints:
- Get all messages in a thread:
GET /conversations/v3/conversations/threads/{threadId}/messages - Get a specific message:
GET /conversations/v3/conversations/threads/{threadId}/messages/{messageId}
Example Response Payload:
When you perform the GET request, the returned JSON will contain the thread mappings like this:
codeJSON
{
"id": "message_id_here",
"threadId": "hubspot_thread_id_here",
"channelId": "your_custom_channel_id",
"channelIntegrationThreadIds": [
"your_original_external_integration_thread_id"
],
"type": "MESSAGE",
"text": "Hello, this is the message content..."
// ... other standard message fields
}
This completely eliminates the need for custom property syncing!
Official HubSpot Developer Resources:
- Custom Channels API Guide: You can review the full details on how different threading models return these properties in the Custom Channels API Guide.
- Conversations Messages Endpoint Reference: See the exact message schemas and returned fields in the Retrieve Messages API Reference.
Let me know if this helps resolve your custom channel threading workflow!