Skip to main content

Actions

The ballerinax/hubspot.marketing.events package exposes the following clients:

ClientPurpose
ClientMarketing Events API v3: event CRUD, attendance, analytics, list associations, and settings.

Client

Marketing Events API v3: event CRUD, attendance, analytics, list associations, and settings.

Configuration

FieldTypeDefaultDescription
authhttp:BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfigRequiredAuthentication configuration: OAuth 2.0 refresh token grant, bearer token, or API keys.
httpVersionhttp:HttpVersionHTTP_2_0HTTP protocol version.
timeoutdecimal30Request timeout in seconds.
retryConfighttp:RetryConfig()Retry configuration for failed requests.
secureSockethttp:ClientSecureSocket()SSL/TLS configuration.
proxyhttp:ProxyConfig()Proxy server configuration.
compressionhttp:CompressionCOMPRESSION_AUTOHTTP compression configuration.
validationbooleantrueEnable/disable payload validation.

Initializing the client

import ballerinax/hubspot.marketing.events as hsmktevents;

configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;

hsmktevents:Client mktEventsClient = check new ({
auth: {
clientId: clientId,
clientSecret: clientSecret,
refreshToken: refreshToken
}
});

Operations

Event CRUD (external iDs)

postEventsCreate

Creates a new marketing event.

Parameters:

NameTypeRequiredDescription
payloadMarketingEventCreateRequestParamsYesMarketing event creation parameters including externalAccountId, externalEventId, eventName, eventOrganizer, and optional fields.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: MarketingEventDefaultResponse|error

Sample code:

hsmktevents:MarketingEventDefaultResponse response = check mktEventsClient->postEventsCreate({
externalAccountId: "app-12345",
externalEventId: "webinar-2026-03",
eventName: "Ballerina Integration Summit 2026",
eventOrganizer: "WSO2",
eventType: "WEBINAR",
startDateTime: "2026-06-15T09:00:00Z",
endDateTime: "2026-06-15T17:00:00Z"
});

Sample response:

{"eventName": "Ballerina Integration Summit 2026", "eventOrganizer": "WSO2", "externalAccountId": "app-12345", "externalEventId": "webinar-2026-03", "eventType": "WEBINAR", "startDateTime": "2026-06-15T09:00:00Z", "endDateTime": "2026-06-15T17:00:00Z"}
getEventsExternalEventIdGetDetails

Retrieves a marketing event by its external account ID and external event ID.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
queriesGetEventsExternalEventIdGetDetailsQueriesYesQuery parameters including externalAccountId.

Returns: MarketingEventPublicReadResponse|error

Sample code:

hsmktevents:MarketingEventPublicReadResponse event = check mktEventsClient->getEventsExternalEventIdGetDetails(
"webinar-2026-03",
externalAccountId = "app-12345"
);

Sample response:

{"eventName": "Ballerina Integration Summit 2026", "eventOrganizer": "WSO2", "externalAccountId": "app-12345", "externalEventId": "webinar-2026-03", "eventType": "WEBINAR", "startDateTime": "2026-06-15T09:00:00Z", "endDateTime": "2026-06-15T17:00:00Z"}
putEventsExternalEventIdUpsert

Creates or updates a marketing event by external event ID. If the event exists, it is updated; otherwise, a new event is created.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
payloadMarketingEventCreateRequestParamsYesMarketing event parameters.

Returns: MarketingEventPublicDefaultResponse|error

Sample code:

hsmktevents:MarketingEventPublicDefaultResponse response = check mktEventsClient->putEventsExternalEventIdUpsert(
"webinar-2026-03",
{
externalAccountId: "app-12345",
externalEventId: "webinar-2026-03",
eventName: "Ballerina Integration Summit 2026 (Updated)",
eventOrganizer: "WSO2"
}
);

Sample response:

{"eventName": "Ballerina Integration Summit 2026 (Updated)", "eventOrganizer": "WSO2", "externalAccountId": "app-12345", "externalEventId": "webinar-2026-03"}
patchEventsExternalEventIdUpdate

Updates an existing marketing event by external event ID.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
payloadMarketingEventUpdateRequestParamsYesFields to update.
queriesPatchEventsExternalEventIdUpdateQueriesNoQuery parameters including externalAccountId.

Returns: MarketingEventPublicDefaultResponse|error

Sample code:

hsmktevents:MarketingEventPublicDefaultResponse response = check mktEventsClient->patchEventsExternalEventIdUpdate(
"webinar-2026-03",
{eventName: "Updated Webinar Title"},
externalAccountId = "app-12345"
);

Sample response:

{"eventName": "Updated Webinar Title", "eventOrganizer": "WSO2", "externalAccountId": "app-12345", "externalEventId": "webinar-2026-03"}
deleteEventsExternalEventIdArchive

Deletes a marketing event by external event ID.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
queriesDeleteEventsExternalEventIdArchiveQueriesYesQuery parameters including externalAccountId.

Returns: error?

Sample code:

check mktEventsClient->deleteEventsExternalEventIdArchive(
"webinar-2026-03",
externalAccountId = "app-12345"
);

Event CRUD (object ID)

get

Retrieves all marketing events with optional pagination and filtering.

Parameters:

NameTypeRequiredDescription
queriesGetQueriesNoQuery parameters for pagination (limit, after) and filtering.

Returns: CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging|error

Sample code:

var response = check mktEventsClient->get();

Sample response:

{"results": [{"id": "12345", "properties": {"hs_marketing_event_name": "Webinar 2026", "hs_marketing_event_type": "WEBINAR"}}], "paging": {"next": {"after": "12345"}}}
getObjectId

Retrieves a marketing event by its internal HubSpot object ID.

Parameters:

NameTypeRequiredDescription
objectIdstringYesThe HubSpot internal object ID of the marketing event.

Returns: MarketingEventPublicReadResponseV2|error

Sample code:

hsmktevents:MarketingEventPublicReadResponseV2 event = check mktEventsClient->getObjectId("12345");

Sample response:

{"id": "12345", "properties": {"hs_marketing_event_name": "Ballerina Integration Summit 2026", "hs_marketing_event_type": "WEBINAR", "hs_marketing_event_organizer": "WSO2"}}
patchObjectId

Updates a marketing event by its internal HubSpot object ID.

Parameters:

NameTypeRequiredDescription
objectIdstringYesThe HubSpot internal object ID.
payloadMarketingEventPublicUpdateRequestV2YesFields to update.

Returns: MarketingEventPublicDefaultResponseV2|error

Sample code:

hsmktevents:MarketingEventPublicDefaultResponseV2 response = check mktEventsClient->patchObjectId(
"12345",
{
properties: {
"hs_marketing_event_name": "Updated Event Name"
}
}
);

Sample response:

{"id": "12345", "properties": {"hs_marketing_event_name": "Updated Event Name"}}
deleteObjectId

Deletes a marketing event by its internal HubSpot object ID.

Parameters:

NameTypeRequiredDescription
objectIdstringYesThe HubSpot internal object ID.

Returns: error?

Sample code:

check mktEventsClient->deleteObjectId("12345");

Batch operations

postEventsUpsertBatchUpsert

Batch creates or updates multiple marketing events using external IDs.

Parameters:

NameTypeRequiredDescription
payloadBatchInputMarketingEventCreateRequestParamsYesBatch input containing an array of marketing event creation parameters.

Returns: BatchResponseMarketingEventPublicDefaultResponse|error

Sample code:

hsmktevents:BatchResponseMarketingEventPublicDefaultResponse response = check mktEventsClient->postEventsUpsertBatchUpsert({
inputs: [
{
externalAccountId: "app-12345",
externalEventId: "event-001",
eventName: "Event One",
eventOrganizer: "WSO2"
},
{
externalAccountId: "app-12345",
externalEventId: "event-002",
eventName: "Event Two",
eventOrganizer: "WSO2"
}
]
});

Sample response:

{"status": "COMPLETE", "results": [{"eventName": "Event One", "externalEventId": "event-001"}, {"eventName": "Event Two", "externalEventId": "event-002"}]}
postBatchUpdate

Batch updates multiple marketing events by their internal object IDs.

Parameters:

NameTypeRequiredDescription
payloadBatchInputMarketingEventPublicUpdateRequestFullV2YesBatch input containing an array of update requests with object IDs.

Returns: BatchResponseMarketingEventPublicDefaultResponseV2|BatchResponseMarketingEventPublicDefaultResponseV2WithErrors|error

Sample code:

var response = check mktEventsClient->postBatchUpdate({
inputs: [
{
id: "12345",
properties: {"hs_marketing_event_name": "Updated Event One"}
},
{
id: "12346",
properties: {"hs_marketing_event_name": "Updated Event Two"}
}
]
});

Sample response:

{"status": "COMPLETE", "results": [{"id": "12345", "properties": {"hs_marketing_event_name": "Updated Event One"}}, {"id": "12346", "properties": {"hs_marketing_event_name": "Updated Event Two"}}]}
postBatchArchive

Batch deletes multiple marketing events by their internal object IDs.

Parameters:

NameTypeRequiredDescription
payloadBatchInputMarketingEventPublicObjectIdDeleteRequestYesBatch input containing object IDs to delete.

Returns: error?

Sample code:

check mktEventsClient->postBatchArchive({
inputs: [{id: "12345"}, {id: "12346"}]
});
postEventsDeleteBatchArchive

Batch deletes multiple marketing events by their external identifiers.

Parameters:

NameTypeRequiredDescription
payloadBatchInputMarketingEventExternalUniqueIdentifierYesBatch input containing external account ID and external event ID pairs.

Returns: http:Response|error

Sample code:

http:Response response = check mktEventsClient->postEventsDeleteBatchArchive({
inputs: [
{externalAccountId: "app-12345", externalEventId: "event-001"},
{externalAccountId: "app-12345", externalEventId: "event-002"}
]
});

Sample response:

204 No Content

Event lifecycle

postEventsExternalEventIdCompleteComplete

Marks a marketing event as completed, setting its start and end date/time.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
payloadMarketingEventCompleteRequestParamsYesCompletion parameters including startDateTime and endDateTime.
queriesPostEventsExternalEventIdCompleteCompleteQueriesNoQuery parameters including externalAccountId.

Returns: MarketingEventDefaultResponse|error

Sample code:

hsmktevents:MarketingEventDefaultResponse response = check mktEventsClient->postEventsExternalEventIdCompleteComplete(
"webinar-2026-03",
{
startDateTime: "2026-06-15T09:00:00Z",
endDateTime: "2026-06-15T17:00:00Z"
},
externalAccountId = "app-12345"
);

Sample response:

{"eventName": "Ballerina Integration Summit 2026", "externalEventId": "webinar-2026-03", "startDateTime": "2026-06-15T09:00:00Z", "endDateTime": "2026-06-15T17:00:00Z"}
postEventsExternalEventIdCancelCancel

Marks a marketing event as cancelled.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
queriesPostEventsExternalEventIdCancelCancelQueriesNoQuery parameters including externalAccountId.

Returns: MarketingEventDefaultResponse|error

Sample code:

hsmktevents:MarketingEventDefaultResponse response = check mktEventsClient->postEventsExternalEventIdCancelCancel(
"webinar-2026-03",
externalAccountId = "app-12345"
);

Sample response:

{"eventName": "Ballerina Integration Summit 2026", "externalEventId": "webinar-2026-03", "eventCancelled": true}

Attendance by contact ID

postAttendanceExternalEventIdSubscriberStateCreateRecordByContactIds

Records participant attendance by contact IDs using external event identifiers.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventSubscriberYesBatch of contact IDs with optional interaction timestamps.
queriesPostAttendanceExternalEventIdSubscriberStateCreateRecordByContactIdsQueriesNoQuery parameters including externalAccountId.

Returns: BatchResponseSubscriberVidResponse|error

Sample code:

hsmktevents:BatchResponseSubscriberVidResponse response = check mktEventsClient->postAttendanceExternalEventIdSubscriberStateCreateRecordByContactIds(
"webinar-2026-03",
"register",
{
inputs: [
{vid: 101, interactionDateTime: 1750000000000},
{vid: 102, interactionDateTime: 1750000000000}
]
},
externalAccountId = "app-12345"
);

Sample response:

{"status": "COMPLETE", "results": [{"vid": 101, "status": "register"}, {"vid": 102, "status": "register"}]}
postObjectIdAttendanceSubscriberStateCreate

Records participant attendance by contact IDs using the internal marketing event object ID.

Parameters:

NameTypeRequiredDescription
objectIdstringYesThe HubSpot internal object ID of the marketing event.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventSubscriberYesBatch of contact IDs with optional interaction timestamps.

Returns: BatchResponseSubscriberVidResponse|error

Sample code:

hsmktevents:BatchResponseSubscriberVidResponse response = check mktEventsClient->postObjectIdAttendanceSubscriberStateCreate(
"12345",
"attend",
{
inputs: [{vid: 101, interactionDateTime: 1750000000000}]
}
);

Sample response:

{"status": "COMPLETE", "results": [{"vid": 101, "status": "attend"}]}

Attendance by email

postAttendanceExternalEventIdSubscriberStateEmailCreateRecordByContactEmails

Records participant attendance by email addresses using external event identifiers.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventEmailSubscriberYesBatch of email addresses with optional interaction timestamps.
queriesPostAttendanceExternalEventIdSubscriberStateEmailCreateRecordByContactEmailsQueriesNoQuery parameters including externalAccountId.

Returns: BatchResponseSubscriberEmailResponse|error

Sample code:

hsmktevents:BatchResponseSubscriberEmailResponse response = check mktEventsClient->postAttendanceExternalEventIdSubscriberStateEmailCreateRecordByContactEmails(
"webinar-2026-03",
"register",
{
inputs: [
{email: "[email protected]", interactionDateTime: 1750000000000},
{email: "[email protected]", interactionDateTime: 1750000000000}
]
},
externalAccountId = "app-12345"
);

Sample response:

{"status": "COMPLETE", "results": [{"email": "[email protected]", "status": "register"}, {"email": "[email protected]", "status": "register"}]}
postObjectIdAttendanceSubscriberStateEmailCreate

Records participant attendance by email addresses using the internal marketing event object ID.

Parameters:

NameTypeRequiredDescription
objectIdstringYesThe HubSpot internal object ID of the marketing event.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventEmailSubscriberYesBatch of email addresses with optional interaction timestamps.

Returns: BatchResponseSubscriberEmailResponse|error

Sample code:

hsmktevents:BatchResponseSubscriberEmailResponse response = check mktEventsClient->postObjectIdAttendanceSubscriberStateEmailCreate(
"12345",
"attend",
{
inputs: [
{email: "[email protected]", interactionDateTime: 1750000000000}
]
}
);

Sample response:

{"status": "COMPLETE", "results": [{"email": "[email protected]", "status": "attend"}]}

Subscriber state upsert

postEventsExternalEventIdSubscriberStateUpsertUpsertByContactId

Records or updates subscriber state by contact ID using external event identifiers.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventSubscriberYesBatch of contact IDs with optional interaction timestamps.
queriesPostEventsExternalEventIdSubscriberStateUpsertUpsertByContactIdQueriesNoQuery parameters including externalAccountId.

Returns: http:Response|error

Sample code:

http:Response response = check mktEventsClient->postEventsExternalEventIdSubscriberStateUpsertUpsertByContactId(
"webinar-2026-03",
"attend",
{
inputs: [{vid: 101, interactionDateTime: 1750000000000}]
},
externalAccountId = "app-12345"
);

Sample response:

204 No Content
postEventsExternalEventIdSubscriberStateEmailUpsertUpsertByContactEmail

Records or updates subscriber state by email using external event identifiers.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.
subscriberStatestringYesSubscriber state: register, attend, cancel, or noshow.
payloadBatchInputMarketingEventEmailSubscriberYesBatch of email addresses with optional interaction timestamps.
queriesPostEventsExternalEventIdSubscriberStateEmailUpsertUpsertByContactEmailQueriesNoQuery parameters including externalAccountId.

Returns: http:Response|error

Sample code:

http:Response response = check mktEventsClient->postEventsExternalEventIdSubscriberStateEmailUpsertUpsertByContactEmail(
"webinar-2026-03",
"cancel",
{
inputs: [{email: "[email protected]", interactionDateTime: 1750000000000}]
},
externalAccountId = "app-12345"
);

Sample response:

204 No Content

Participation analytics

getParticipationsMarketingEventIdBreakdownGetParticipationsBreakdownByMarketingEventId

Retrieves a detailed participation breakdown for a marketing event by its internal event ID.

Parameters:

NameTypeRequiredDescription
marketingEventIdintYesThe internal HubSpot marketing event ID.
queriesGetParticipationsMarketingEventIdBreakdownGetParticipationsBreakdownByMarketingEventIdQueriesNoQuery parameters for pagination and filtering.

Returns: CollectionResponseWithTotalParticipationBreakdownForwardPaging|error

Sample code:

var response = check mktEventsClient->getParticipationsMarketingEventIdBreakdownGetParticipationsBreakdownByMarketingEventId(12345);

Sample response:

{"total": 2, "results": [{"contactId": "101", "state": "ATTENDED", "timestamp": "2026-06-15T10:00:00Z"}, {"contactId": "102", "state": "REGISTERED", "timestamp": "2026-06-10T14:00:00Z"}]}
getParticipationsExternalAccountIdExternalEventIdBreakdownGetParticipationsBreakdownByExternalEventId

Retrieves a detailed participation breakdown for a marketing event by external account and event IDs.

Parameters:

NameTypeRequiredDescription
externalAccountIdstringYesThe external account identifier.
externalEventIdstringYesThe external event identifier.
queriesGetParticipationsExternalAccountIdExternalEventIdBreakdownGetParticipationsBreakdownByExternalEventIdQueriesNoQuery parameters for pagination and filtering.

Returns: CollectionResponseWithTotalParticipationBreakdownForwardPaging|error

Sample code:

var response = check mktEventsClient->getParticipationsExternalAccountIdExternalEventIdBreakdownGetParticipationsBreakdownByExternalEventId(
"app-12345",
"webinar-2026-03"
);

Sample response:

{"total": 2, "results": [{"contactId": "101", "state": "ATTENDED", "timestamp": "2026-06-15T10:00:00Z"}, {"contactId": "102", "state": "REGISTERED", "timestamp": "2026-06-10T14:00:00Z"}]}
getParticipationsContactsContactIdentifierBreakdownGetParticipationsBreakdownByContactId

Retrieves a participation breakdown for a specific contact across all marketing events.

Parameters:

NameTypeRequiredDescription
contactIdentifierstringYesThe contact identifier (contact ID or email).
queriesGetParticipationsContactsContactIdentifierBreakdownGetParticipationsBreakdownByContactIdQueriesNoQuery parameters for pagination and filtering.

Returns: CollectionResponseWithTotalParticipationBreakdownForwardPaging|error

Sample code:

var response = check mktEventsClient->getParticipationsContactsContactIdentifierBreakdownGetParticipationsBreakdownByContactId("[email protected]");

Sample response:

{"total": 1, "results": [{"eventId": "12345", "state": "ATTENDED", "timestamp": "2026-06-15T10:00:00Z"}]}
getParticipationsMarketingEventIdGetParticipationsCountersByMarketingEventId

Retrieves participation counters (registered, attended, cancelled, no-shows) for a marketing event by internal ID.

Parameters:

NameTypeRequiredDescription
marketingEventIdintYesThe internal HubSpot marketing event ID.

Returns: AttendanceCounters|error

Sample code:

hsmktevents:AttendanceCounters counters = check mktEventsClient->getParticipationsMarketingEventIdGetParticipationsCountersByMarketingEventId(12345);

Sample response:

{"registered": 150, "attended": 120, "cancelled": 20, "noShows": 10}
getParticipationsExternalAccountIdExternalEventIdGetParticipationsCountersByEventExternalId

Retrieves participation counters for a marketing event by external account and event IDs.

Parameters:

NameTypeRequiredDescription
externalAccountIdstringYesThe external account identifier.
externalEventIdstringYesThe external event identifier.

Returns: AttendanceCounters|error

Sample code:

hsmktevents:AttendanceCounters counters = check mktEventsClient->getParticipationsExternalAccountIdExternalEventIdGetParticipationsCountersByEventExternalId(
"app-12345",
"webinar-2026-03"
);

Sample response:

{"registered": 150, "attended": 120, "cancelled": 20, "noShows": 10}

List associations

getAssociationsMarketingEventIdListsGetAllByMarketingEventId

Retrieves all HubSpot lists associated with a marketing event by its internal event ID.

Parameters:

NameTypeRequiredDescription
marketingEventIdstringYesThe internal HubSpot marketing event ID.

Returns: CollectionResponseWithTotalPublicListNoPaging|error

Sample code:

var response = check mktEventsClient->getAssociationsMarketingEventIdListsGetAllByMarketingEventId("12345");

Sample response:

{"total": 1, "results": [{"listId": "67890", "name": "Webinar Registrants"}]}
getAssociationsExternalAccountIdExternalEventIdListsGetAllByExternalAccountAndEventIds

Retrieves all HubSpot lists associated with a marketing event by external account and event IDs.

Parameters:

NameTypeRequiredDescription
externalAccountIdstringYesThe external account identifier.
externalEventIdstringYesThe external event identifier.

Returns: CollectionResponseWithTotalPublicListNoPaging|error

Sample code:

var response = check mktEventsClient->getAssociationsExternalAccountIdExternalEventIdListsGetAllByExternalAccountAndEventIds(
"app-12345",
"webinar-2026-03"
);

Sample response:

{"total": 1, "results": [{"listId": "67890", "name": "Webinar Registrants"}]}
putAssociationsMarketingEventIdListsListIdAssociateByMarketingEventId

Associates a HubSpot list with a marketing event by internal event ID.

Parameters:

NameTypeRequiredDescription
marketingEventIdstringYesThe internal HubSpot marketing event ID.
listIdstringYesThe HubSpot list ID to associate.

Returns: error?

Sample code:

check mktEventsClient->putAssociationsMarketingEventIdListsListIdAssociateByMarketingEventId("12345", "67890");
putAssociationsExternalAccountIdExternalEventIdListsListIdAssociateByExternalAccountAndEventIds

Associates a HubSpot list with a marketing event by external account and event IDs.

Parameters:

NameTypeRequiredDescription
externalAccountIdstringYesThe external account identifier.
externalEventIdstringYesThe external event identifier.
listIdstringYesThe HubSpot list ID to associate.

Returns: error?

Sample code:

check mktEventsClient->putAssociationsExternalAccountIdExternalEventIdListsListIdAssociateByExternalAccountAndEventIds(
"app-12345",
"webinar-2026-03",
"67890"
);
deleteAssociationsMarketingEventIdListsListIdDisassociateByMarketingEventId

Disassociates a HubSpot list from a marketing event by internal event ID.

Parameters:

NameTypeRequiredDescription
marketingEventIdstringYesThe internal HubSpot marketing event ID.
listIdstringYesThe HubSpot list ID to disassociate.

Returns: error?

Sample code:

check mktEventsClient->deleteAssociationsMarketingEventIdListsListIdDisassociateByMarketingEventId("12345", "67890");
deleteAssociationsExternalAccountIdExternalEventIdListsListIdDisassociateByExternalAccountAndEventIds

Disassociates a HubSpot list from a marketing event by external account and event IDs.

Parameters:

NameTypeRequiredDescription
externalAccountIdstringYesThe external account identifier.
externalEventIdstringYesThe external event identifier.
listIdstringYesThe HubSpot list ID to disassociate.

Returns: error?

Sample code:

check mktEventsClient->deleteAssociationsExternalAccountIdExternalEventIdListsListIdDisassociateByExternalAccountAndEventIds(
"app-12345",
"webinar-2026-03",
"67890"
);

Search & discovery

getEventsSearchDoSearch

Searches for marketing events by a query string (searches external event IDs).

Parameters:

NameTypeRequiredDescription
queriesGetEventsSearchDoSearchQueriesNoQuery parameters including q (search term).

Returns: CollectionResponseSearchPublicResponseWrapperNoPaging|error

Sample code:

var response = check mktEventsClient->getEventsSearchDoSearch(q = "webinar");

Sample response:

{"results": [{"id": "12345", "eventName": "Ballerina Integration Summit 2026", "externalEventId": "webinar-2026-03"}]}
getExternalEventIdIdentifiers

Finds all marketing event identifiers associated with an external event ID.

Parameters:

NameTypeRequiredDescription
externalEventIdstringYesThe external event identifier.

Returns: CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging|error

Sample code:

var response = check mktEventsClient->getExternalEventIdIdentifiers("webinar-2026-03");

Sample response:

{"total": 1, "results": [{"externalAccountId": "app-12345", "externalEventId": "webinar-2026-03", "objectId": "12345"}]}

App settings

getAppIdSettingsGetAll

Retrieves the event detail settings for a HubSpot app.

Parameters:

NameTypeRequiredDescription
appIdint:Signed32YesThe HubSpot app ID.

Returns: EventDetailSettings|error

Sample code:

hsmktevents:EventDetailSettings settings = check mktEventsClient->getAppIdSettingsGetAll(12345);

Sample response:

{"appId": 12345, "eventDetailsUrl": "https://example.com/events/%s"}
postAppIdSettingsUpdate

Updates the event detail settings for a HubSpot app.

Parameters:

NameTypeRequiredDescription
appIdint:Signed32YesThe HubSpot app ID.
payloadEventDetailSettingsUrlYesUpdated event detail settings URL.

Returns: EventDetailSettings|error

Sample code:

hsmktevents:EventDetailSettings settings = check mktEventsClient->postAppIdSettingsUpdate(
12345,
{eventDetailsUrl: "https://example.com/events/%s"}
);

Sample response:

{"appId": 12345, "eventDetailsUrl": "https://example.com/events/%s"}