Actions
The ballerinax/hubspot.marketing.events package exposes the following clients:
| Client | Purpose |
|---|---|
Client | Marketing 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
| Field | Type | Default | Description |
|---|---|---|---|
auth | http:BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfig | Required | Authentication configuration: OAuth 2.0 refresh token grant, bearer token, or API keys. |
httpVersion | http:HttpVersion | HTTP_2_0 | HTTP protocol version. |
timeout | decimal | 30 | Request timeout in seconds. |
retryConfig | http:RetryConfig | () | Retry configuration for failed requests. |
secureSocket | http:ClientSecureSocket | () | SSL/TLS configuration. |
proxy | http:ProxyConfig | () | Proxy server configuration. |
compression | http:Compression | COMPRESSION_AUTO | HTTP compression configuration. |
validation | boolean | true | Enable/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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | MarketingEventCreateRequestParams | Yes | Marketing event creation parameters including externalAccountId, externalEventId, eventName, eventOrganizer, and optional fields. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
queries | GetEventsExternalEventIdGetDetailsQueries | Yes | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
payload | MarketingEventCreateRequestParams | Yes | Marketing 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
payload | MarketingEventUpdateRequestParams | Yes | Fields to update. |
queries | PatchEventsExternalEventIdUpdateQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
queries | DeleteEventsExternalEventIdArchiveQueries | Yes | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
queries | GetQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The HubSpot internal object ID. |
payload | MarketingEventPublicUpdateRequestV2 | Yes | Fields 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:
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputMarketingEventCreateRequestParams | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputMarketingEventPublicUpdateRequestFullV2 | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputMarketingEventPublicObjectIdDeleteRequest | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputMarketingEventExternalUniqueIdentifier | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
payload | MarketingEventCompleteRequestParams | Yes | Completion parameters including startDateTime and endDateTime. |
queries | PostEventsExternalEventIdCompleteCompleteQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
queries | PostEventsExternalEventIdCancelCancelQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventSubscriber | Yes | Batch of contact IDs with optional interaction timestamps. |
queries | PostAttendanceExternalEventIdSubscriberStateCreateRecordByContactIdsQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The HubSpot internal object ID of the marketing event. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventSubscriber | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventEmailSubscriber | Yes | Batch of email addresses with optional interaction timestamps. |
queries | PostAttendanceExternalEventIdSubscriberStateEmailCreateRecordByContactEmailsQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The HubSpot internal object ID of the marketing event. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventEmailSubscriber | Yes | Batch 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventSubscriber | Yes | Batch of contact IDs with optional interaction timestamps. |
queries | PostEventsExternalEventIdSubscriberStateUpsertUpsertByContactIdQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The external event identifier. |
subscriberState | string | Yes | Subscriber state: register, attend, cancel, or noshow. |
payload | BatchInputMarketingEventEmailSubscriber | Yes | Batch of email addresses with optional interaction timestamps. |
queries | PostEventsExternalEventIdSubscriberStateEmailUpsertUpsertByContactEmailQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
marketingEventId | int | Yes | The internal HubSpot marketing event ID. |
queries | GetParticipationsMarketingEventIdBreakdownGetParticipationsBreakdownByMarketingEventIdQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalAccountId | string | Yes | The external account identifier. |
externalEventId | string | Yes | The external event identifier. |
queries | GetParticipationsExternalAccountIdExternalEventIdBreakdownGetParticipationsBreakdownByExternalEventIdQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
contactIdentifier | string | Yes | The contact identifier (contact ID or email). |
queries | GetParticipationsContactsContactIdentifierBreakdownGetParticipationsBreakdownByContactIdQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
marketingEventId | int | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalAccountId | string | Yes | The external account identifier. |
externalEventId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
marketingEventId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalAccountId | string | Yes | The external account identifier. |
externalEventId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
marketingEventId | string | Yes | The internal HubSpot marketing event ID. |
listId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalAccountId | string | Yes | The external account identifier. |
externalEventId | string | Yes | The external event identifier. |
listId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
marketingEventId | string | Yes | The internal HubSpot marketing event ID. |
listId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalAccountId | string | Yes | The external account identifier. |
externalEventId | string | Yes | The external event identifier. |
listId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
queries | GetEventsSearchDoSearchQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalEventId | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
appId | int:Signed32 | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
appId | int:Signed32 | Yes | The HubSpot app ID. |
payload | EventDetailSettingsUrl | Yes | Updated 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"}