Skip to content

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.

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 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.marketing_events.create_event(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create a marketing event — request body — body

Referenced models: Create a marketing event — 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 Create a marketing event — response body

Referenced models: Create a marketing event — response body

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

Create a marketing event — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
customPropertiesarrayRequired within parentA 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[]ModelEach itemExpand Create a marketing event — request body — body custom Properties item
endDateTimestringOptionalThe end date and time of the marketing event.
Format: date-time
eventCancelledbooleanOptionalIndicates if the marketing event has been cancelled. Defaults to `false`
eventCompletedbooleanOptionalIndicates if the marketing event has been completed. Defaults to `false`
eventDescriptionstringOptionalThe description of the marketing event.
eventNamestringRequired within parentThe name of the marketing event.
eventOrganizerstringRequired within parentThe name of the organizer of the marketing event.
eventTypestringOptionalDescribes what type of event this is. For example: `WEBINAR`, `CONFERENCE`, `WORKSHOP`
eventUrlstringOptionalA URL in the external event application where the marketing event can be managed.
externalAccountIdstringRequired within parentThe accountId that is associated with this marketing event in the external event application.
externalEventIdstringRequired within parentThe id of the marketing event in the external event application.
startDateTimestringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRoot
customPropertiesarrayRequired within parentA 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[]ModelEach itemExpand Create a marketing event — response body — custom Properties item
endDateTimestringOptionalThe end date and time of the marketing event.
Format: date-time
eventCancelledbooleanOptionalIndicates if the marketing event has been cancelled.
eventCompletedbooleanOptionalIndicates if the marketing event has been completed.
eventDescriptionstringOptionalThe description of the marketing event.
eventNamestringRequired within parentThe name of the marketing event.
eventOrganizerstringRequired within parentThe name of the organizer of the marketing event.
eventTypestringOptionalThe type of the marketing event.
eventUrlstringOptionalThe URL in the external event application where the marketing event can be managed.
objectIdstringOptionalThe ID of the marketing event CRM object
startDateTimestringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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.
dataSensitivitystringRequired within parentLevel of data sensitivity
One of: high, none, standard
isEncryptedbooleanRequired within parentIndicates whether the property is encrypted
isLargeValuebooleanRequired within parentIndicates whether the property value is stored as a large value in the storage
maskedSubstringsModelRequired within parentExpand Create a marketing event — request body — body custom Properties item masked Substrings
namestringRequired within parentName of custom property
persistenceTimestampintegerRequired within parentThe timestamp that indicates when the value being written is persisted in storage
Format: int64
requestIdstringRequired within parentThe ID of the request
selectedByUserbooleanRequired within parentIndicates whether the property is selected
selectedByUserTimestampintegerRequired within parentTimestamp of when the property was selected by the user
Format: int64
sourcestringRequired within parentSource 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
sourceIdstringRequired within parentID of the source of the property
sourceLabelstringRequired within parentLabel of the source of the property
sourceMetadatastringRequired within parentSource metadata encoded as a base64 string
sourceUpstreamDeployablestringRequired within parentIndicates which upstream service made the property change
sourceVidarrayRequired within parentAn array of integers representing IDs associated with the source of the property value.
sourceVid[]integerEach itemFormat: int64
timestampintegerRequired within parentTimestamp of the request
Format: int64
unitstringRequired within parentThe unit
updatedByUserIdintegerRequired within parentThe ID of the user who last updated the property
Format: int32
useTimestampAsPersistenceTimestampbooleanRequired within parentIndicates if the persistence timestamp is the same as storage version timestamp
valuestringRequired within parentCustom 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
FieldTypePresenceDescription and constraints
$objectRoot
substringsarrayRequired within parentAn 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRoot
substringsarrayRequired within parentAn 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRoot
endintegerRequired within parentAn integer indicating the ending position of the masked substring.
Format: int32
labelstringRequired within parent
startintegerRequired within parentAn integer indicating the starting position of the masked substring.
Format: int32

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"]

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.