Skip to content

HubSpot: Publish a message

HubSpot customChannels.createCustomChannel: arguments, response, policy and SDK examples.

← Custom channels operations · Get started

Operation hubspot.custom_channels_create_custom_channel

Provider route: POST /conversations/custom-channels/2026-09/{channelId}/messages. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["customChannels"]["createCustomChannel"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.customChannels.createCustomChannel(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.custom_channels.create_custom_channel(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.channelIdintegerRequired within parentFormat: int32
bodyModelRequired within parentExpand Publish a message — request body — body

Referenced models: Publish a message — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a message — response body

Referenced models: Get a message — response body

34 more schemas are linked from the tables above, on the schema pages.

Publish a message — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
associateWithContactIdintegerOptionalThe ID of the contact with which this message should be associated.
Format: int64
attachmentsarrayRequired within parentAn array of attachments included with the message, which can be files, locations, contacts, or other supported types.
attachments[]JSONEach item
attachments[] (oneOf 1)ModelAlternativeExpand Publish a message — request body — body / attachments / item / fileUsageType: AUDIO, IMAGE, OTHER, STICKER, VOICE RECORDING, type: FILE
attachments[] (oneOf 2)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: LOCATION
attachments[] (oneOf 3)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: CONTACT
attachments[] (oneOf 4)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: UNSUPPORTED CONTENT
attachments[] (oneOf 5)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: MESSAGE HEADER
attachments[] (oneOf 6)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: QUICK REPLIES
attachments[] (oneOf 7)ModelAlternativeExpand Publish a message — request body — body / attachments / item / type: SOCIAL MEDIA METADATA
channelAccountIdstringRequired within parentThe ID of the channel account through which the message is sent.
inReplyToIdstringOptionalThe ID of the message this message is replying to.
integrationIdempotencyIdstringOptionalA unique identifier to ensure idempotency of the message within the integration.
integrationThreadIdstringOptionalA unique identifier for the thread within the integration.
messageDirectionstringRequired within parentThe direction of the message, indicating whether it is 'INCOMING' or 'OUTGOING'.
One of: INCOMING, OUTGOING
preResolvedContactsModelOptionalExpand Publish a message — request body — body pre Resolved Contacts
recipientsarrayRequired within parentAn array of participants representing the recipients of the message.
recipients[]ModelEach itemExpand Publish a message — request body — body senders item
richTextstringOptionalThe rich text content of the message, allowing for formatting.
sendersarrayRequired within parentAn array of participants representing the senders of the message.
senders[]ModelEach itemExpand Publish a message — request body — body senders item
textstringRequired within parentThe plain text content of the message.
timestampstringRequired within parentThe date and time when the message was created, in ISO 8601 format.
Format: date-time

Referenced models: Publish a message — request body — body senders item, Publish a message — request body — body / attachments / item / type: CONTACT, Publish a message — request body — body / attachments / item / type: SOCIAL MEDIA METADATA, Publish a message — request body — body / attachments / item / fileUsageType: AUDIO, IMAGE, OTHER, STICKER, VOICE RECORDING, type: FILE, Publish a message — request body — body / attachments / item / type: LOCATION, Publish a message — request body — body / attachments / item / type: MESSAGE HEADER, Publish a message — request body — body pre Resolved Contacts, Publish a message — request body — body / attachments / item / type: QUICK REPLIES, Publish a message — request body — body / attachments / item / type: UNSUPPORTED CONTENT

Publish a message — request body — body senders item
FieldTypePresenceDescription and constraints
$objectRoot
deliveryIdentifierModelRequired within parentExpand Create a channel account — request body — body delivery Identifier
namestringOptionalThe name of the participant. It is a string that can be used to identify the participant within the channel.
senderActorIdstringOptionalA string representing the unique identifier of the sender actor. This is used to distinguish the sender within the channel integration.

Referenced models: Create a channel account — request body — body delivery Identifier

Publish a message — request body — body / attachments / item / type: CONTACT
FieldTypePresenceDescription and constraints
$objectRoot
contactProfileModelRequired within parentExpand Publish a message — request body — body / attachments / item / type: CONTACT contact Profile
typestringRequired within parentA string indicating the type of attachment. The default value is 'CONTACT'.
Default: CONTACT
One of: CONTACT

Referenced models: Publish a message — request body — body / attachments / item / type: CONTACT contact Profile

Publish a message — request body — body / attachments / item / type: SOCIAL MEDIA METADATA
FieldTypePresenceDescription and constraints
$objectRoot
socialMetadataModelRequired within parentExpand Publish a message — request body — body / attachments / item / type: SOCIAL MEDIA METADATA social Metadata
typestringRequired within parentA string indicating the type of attachment, which is 'SOCIAL_MEDIA_METADATA'.
Default: SOCIAL_MEDIA_METADATA
One of: SOCIAL_MEDIA_METADATA

Referenced models: Publish a message — request body — body / attachments / item / type: SOCIAL MEDIA METADATA social Metadata

Publish a message — request body — body / attachments / item / fileUsageType: AUDIO, IMAGE, OTHER, STICKER, VOICE RECORDING, type: FILE
FieldTypePresenceDescription and constraints
$objectRoot
fileIdstringRequired within parentA string representing the unique identifier for the file.
fileUsageTypestringOptionalA string that specifies the usage type of the file. Valid values include 'STICKER', 'VOICE_RECORDING', 'IMAGE', 'AUDIO', and 'OTHER'.
One of: AUDIO, IMAGE, OTHER, STICKER, VOICE_RECORDING
typestringRequired within parentA string that indicates the type of attachment. The default value is 'FILE'.
Default: FILE
One of: FILE
Publish a message — request body — body / attachments / item / type: LOCATION
FieldTypePresenceDescription and constraints
$objectRoot
addressstringOptionalA string representing the address of the location.
latitudenumberRequired within parentA number representing the latitude of the location.
longitudenumberRequired within parentA number representing the longitude of the location.
namestringOptionalA string representing the name of the location.
typestringRequired within parentA string indicating the type of attachment, which is always 'LOCATION'.
Default: LOCATION
One of: LOCATION
urlstringOptionalA string representing a URL associated with the location.
Publish a message — request body — body / attachments / item / type: MESSAGE HEADER
FieldTypePresenceDescription and constraints
$objectRoot
fileIdintegerOptionalAn optional integer representing the ID of an associated file, formatted as an int64.
Format: int64
textstringOptionalAn optional string containing text information for the message header.
typestringRequired within parentA string representing the type of attachment, which is always 'MESSAGE_HEADER'.
Default: MESSAGE_HEADER
One of: MESSAGE_HEADER
Publish a message — request body — body pre Resolved Contacts
FieldTypePresenceDescription and constraints
$objectRoot
contactsarrayRequired within parentAn array of PreResolvedContact objects. Each object contains information about a contact that has been pre-resolved, including properties that led to the match. This array is required.
contacts[]ModelEach itemExpand Publish a message — request body — body pre Resolved Contacts contacts item

Referenced models: Publish a message — request body — body pre Resolved Contacts contacts item

Publish a message — request body — body / attachments / item / type: UNSUPPORTED CONTENT
FieldTypePresenceDescription and constraints
$objectRoot
typestringRequired within parentA string indicating the type of the attachment. The default value is 'UNSUPPORTED_CONTENT'.
Default: UNSUPPORTED_CONTENT
One of: UNSUPPORTED_CONTENT

SDK function policy ID: hubspot.custom_channels_create_custom_channel. Catalog operation: custom_channels_create_custom_channel. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["conversations.custom_channels.write"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.