HubSpot: Create a marketing event
HubSpot marketingEvents.createEvent: arguments, response, policy and SDK examples.
← Marketing events operations · Get started
Operation hubspot.marketing_events_create_event
Provider route: POST /marketing/marketing-events/2026-09/events. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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["marketingEvents"]["createEvent"]>[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.marketingEvents.createEvent(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.marketing_events.create_event(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create a marketing event — request body — body |
Referenced models: Create a marketing event — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create a marketing event — response body |
Referenced models: Create a marketing event — response body
Schemas
Section titled “Schemas”2 more schemas are linked from the tables above, on the schema pages.
Create a marketing event — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
customProperties | array | Required within parent | A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts. |
customProperties[] | Model | Each item | Expand Create a marketing event — request body — body custom Properties item |
endDateTime | string | Optional | The end date and time of the marketing event. Format: date-time |
eventCancelled | boolean | Optional | Indicates if the marketing event has been cancelled. Defaults to `false` |
eventCompleted | boolean | Optional | Indicates if the marketing event has been completed. Defaults to `false` |
eventDescription | string | Optional | The description of the marketing event. |
eventName | string | Required within parent | The name of the marketing event. |
eventOrganizer | string | Required within parent | The name of the organizer of the marketing event. |
eventType | string | Optional | Describes what type of event this is. For example: `WEBINAR`, `CONFERENCE`, `WORKSHOP` |
eventUrl | string | Optional | A URL in the external event application where the marketing event can be managed. |
externalAccountId | string | Required within parent | The accountId that is associated with this marketing event in the external event application. |
externalEventId | string | Required within parent | The id of the marketing event in the external event application. |
startDateTime | string | Optional | The start date and time of the marketing event. Format: date-time |
Referenced models: Create a marketing event — request body — body custom Properties item
Create a marketing event — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
customProperties | array | Required within parent | A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts. |
customProperties[] | Model | Each item | Expand Create a marketing event — response body — custom Properties item |
endDateTime | string | Optional | The end date and time of the marketing event. Format: date-time |
eventCancelled | boolean | Optional | Indicates if the marketing event has been cancelled. |
eventCompleted | boolean | Optional | Indicates if the marketing event has been completed. |
eventDescription | string | Optional | The description of the marketing event. |
eventName | string | Required within parent | The name of the marketing event. |
eventOrganizer | string | Required within parent | The name of the organizer of the marketing event. |
eventType | string | Optional | The type of the marketing event. |
eventUrl | string | Optional | The URL in the external event application where the marketing event can be managed. |
objectId | string | Optional | The ID of the marketing event CRM object |
startDateTime | string | Optional | The start date and time of the marketing event. Format: date-time |
Referenced models: Create a marketing event — response body — custom Properties item
Create a marketing event — request body — body custom Properties item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a single custom property of a marketing event, storing its name, value, metadata (like source, timestamp, and sensitivity), and related audit information for tracking changes. |
dataSensitivity | string | Required within parent | Level of data sensitivity One of: high, none, standard |
isEncrypted | boolean | Required within parent | Indicates whether the property is encrypted |
isLargeValue | boolean | Required within parent | Indicates whether the property value is stored as a large value in the storage |
maskedSubstrings | Model | Required within parent | Expand Create a marketing event — request body — body custom Properties item masked Substrings |
name | string | Required within parent | Name of custom property |
persistenceTimestamp | integer | Required within parent | The timestamp that indicates when the value being written is persisted in storage Format: int64 |
requestId | string | Required within parent | The ID of the request |
selectedByUser | boolean | Required within parent | Indicates whether the property is selected |
selectedByUserTimestamp | integer | Required within parent | Timestamp of when the property was selected by the user Format: int64 |
source | string | Required within parent | Source of the property One of: ACADEMY, ACCEPTANCE_TEST, ACTIVITY_AUTO_ASSOCIATE, ACTIVITY_LOG_REVERT, ADS, AI_GROUP, ANALYTICS, API, APPROVALS, ASSISTS, ASSOCIATIONS, AUTO_ASSOCIATE_BY_DOMAIN, AUTOMATION_JOURNEY, AUTOMATION_PLATFORM, AVATARS_SERVICE, BATCH_UPDATE, BCC_TO_CRM, BEHAVIORAL_EVENTS, BET_ASSIGNMENT, BET_CRM_CONNECTOR, BIDEN, BILLING, BOT, BREEZE_AGENT, CALCULATED, CENTRAL_EXCHANGE_RATES, CHATSPOT, CLONE_OBJECTS, COMMUNICATOR, COMPANIES, COMPANY_FAMILIES, COMPANY_INSIGHTS, CONNECTED_ACCOUNT, CONTACTS, CONTACTS_WEB, CONTENT_MEMBERSHIP, CONVERSATIONAL_ENRICHMENT, CONVERSATIONS, CRM_PROCESSES_PLATFORM, CRM_UI, CRM_UI_BULK_ACTION, CUSTOMER_AGENT, CUSTOMER_PORTAL, DATA_ENRICHMENT, DATA_QUALITY, DATASET, DEALS, DEFAULT, DELETE_OBJECTS, DI_WRITE_TO_CRM, EMAIL, EMAIL_INBOX_IMPORT, EMAIL_INTEGRATION, ENGAGEMENTS, EXTENSION, FILE_MANAGER, FLYWHEEL_PRODUCT_DATA_SYNC, FORECASTING, FORM, FORWARD_TO_CRM, GMAIL_INTEGRATION, GOALS, HEISENBERG, HELP_DESK, HELP_DESK_AI, IMPORT, INTEGRATION, INTEGRATIONS_PLATFORM, INTEGRATIONS_SYNC, INTENT, INTERNAL_PROCESSING, LEADIN, LEGAL_BASIS_REMEDIATION, MARKET_SOURCING, MARKETPLACE, MARKETS, MEETINGS, MERGE_COMPANIES, MERGE_CONTACTS, MERGE_OBJECTS, MERGE_REVERT_OBJECTS, MICROAPPS, MIGRATION, MOBILE_ANDROID, MOBILE_IOS, PAYMENTS, PIPELINE_SETTINGS, PLAYBOOKS, PORTAL_OBJECT_SYNC, PORTAL_USER_ASSOCIATOR, PRESENTATIONS, PRIMARY_AUTOMATION, PROPERTY_DEFAULT_VALUE, PROPERTY_RESTORE, PROPERTY_SETTINGS, PROSPECTING_AGENT, QUOTAS, QUOTES, RECYCLING_BIN, RESTORE_OBJECTS, REVENUE_PLATFORM, SALES, SALES_MESSAGES, SALESFORCE, SEQUENCES, SETTINGS, SIDEKICK, SIGNALS, SLACK_INTEGRATION, SMART_DATA_CAPTURE, SOCIAL, SUCCESS, TALLY, TASK, UNKNOWN, WAL_INCREMENTAL, WORK_UI, WORKFLOW_CONTACT_DELETE_ACTION, WORKFLOWS |
sourceId | string | Required within parent | ID of the source of the property |
sourceLabel | string | Required within parent | Label of the source of the property |
sourceMetadata | string | Required within parent | Source metadata encoded as a base64 string |
sourceUpstreamDeployable | string | Required within parent | Indicates which upstream service made the property change |
sourceVid | array | Required within parent | An array of integers representing IDs associated with the source of the property value. |
sourceVid[] | integer | Each item | Format: int64 |
timestamp | integer | Required within parent | Timestamp of the request Format: int64 |
unit | string | Required within parent | The unit |
updatedByUserId | integer | Required within parent | The ID of the user who last updated the property Format: int32 |
useTimestampAsPersistenceTimestamp | boolean | Required within parent | Indicates if the persistence timestamp is the same as storage version timestamp |
value | string | Required within parent | Custom property value |
Referenced models: Create a marketing event — request body — body custom Properties item masked Substrings
Create a marketing event — request body — body custom Properties item masked Substrings
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
substrings | array | Required within parent | An array of masked substring objects, each defining a specific portion of a string to be masked. Each object in the array specifies the start and end positions of the substring to be masked. |
substrings[] | Model | Each item | Expand Create a marketing event — request body — body custom Properties item masked Substrings substrings item |
Referenced models: Create a marketing event — request body — body custom Properties item masked Substrings substrings item
Create a marketing event — response body — custom Properties item masked Substrings
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
substrings | array | Required within parent | An array of masked substring objects, each defining a specific portion of a string to be masked. Each object in the array specifies the start and end positions of the substring to be masked. |
substrings[] | Model | Each item | Expand Create a marketing event — response body — custom Properties item masked Substrings substrings item |
Referenced models: Create a marketing event — response body — custom Properties item masked Substrings substrings item
Create a marketing event — request body — body custom Properties item masked Substrings substrings item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
end | integer | Required within parent | An integer indicating the ending position of the masked substring. Format: int32 |
label | string | Required within parent | |
start | integer | Required within parent | An integer indicating the starting position of the masked substring. Format: int32 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.marketing_events_create_event. Catalog operation: marketing_events_create_event. 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: ["crm.objects.marketing_events.write"]