Skip to content

HubSpot: Create or Update Multiple Marketing Events

HubSpot marketingEvents.batchUpsertMarketingEvents: arguments, response, policy and SDK examples.

← Marketing events operations · Get started

Operation hubspot.marketing_events_batch_upsert_marketing_events

Provider route: POST /marketing/marketing-events/2026-09/events/upsert. 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"]["batchUpsertMarketingEvents"]>[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.batchUpsertMarketingEvents(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.batch_upsert_marketing_events(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create or Update Multiple Marketing Events — request body — body

Referenced models: Create or Update Multiple Marketing Events — 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 or Update Multiple Marketing Events — response body

Referenced models: Create or Update Multiple Marketing Events — response body

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

Create or Update Multiple Marketing Events — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
inputsarrayRequired within parentAn array of MarketingEventCreateRequestParams objects, each containing the necessary details to create a marketing event. This includes properties such as event name, organizer, and custom properties.
inputs[]ModelEach itemExpand Create a marketing event — request body — body

Referenced models: Create a marketing event — request body — body

Create or Update Multiple Marketing Events — response body
FieldTypePresenceDescription and constraints
$objectRoot
completedAtstringRequired within parentTimestamp of when the request was completed.
Format: date-time
errorsarrayOptionalAn array of errors encountered during the batch operation, each item detailing a specific error.
errors[]ModelEach itemExpand Create or Update Multiple Marketing Events — response body — errors item
linksobjectOptionalResult of the request.
Additional keys: see wildcard field
links.*stringAdditional keys
numErrorsJSONOptional
numErrors (anyOf 1)integerAlternativeThe number of errors that occurred during the request.
Format: int32
numErrors (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
requestedAtstringOptionalTimestamp of when the request was sent.
Format: date-time
resultsarrayRequired within parentAn array of results from the batch operation, each item representing a response for an individual marketing event.
results[]ModelEach itemExpand Create or update a marketing event — response body
startedAtstringRequired within parentTimestamp of when the request started processing.
Format: date-time
statusstringRequired within parentStatus of the response.
Known values: CANCELED, COMPLETE, PENDING, PROCESSING

Referenced models: Create or Update Multiple Marketing Events — response body — errors item, Create or update a marketing event — response body

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 or Update Multiple Marketing Events — response body — errors item
FieldTypePresenceDescription and constraints
$objectRootYe olde error
categorystringRequired within parentThe category of the error
contextobjectRequired within parentThe object that contains details of the errors
Additional keys: see wildcard field
context.*arrayAdditional keys
context.*[]stringEach item
errorsarrayRequired within parentAn array of ErrorDetail objects providing further information about the error.
errors[]ModelEach itemExpand Batch insert events — response body — errors item errors item
idstringOptionalThe ID of the request
linksobjectRequired within parentResults of the request
Additional keys: see wildcard field
links.*stringAdditional keys
messagestringRequired within parentA human readable message describing the error along with remediation steps where appropriate
statusstringRequired within parentStatus of the response
subCategoryobjectOptionalThe Sub-category of the error

Referenced models: Batch insert events — response body — errors item errors item

Create or update a marketing event — response body
FieldTypePresenceDescription and constraints
$objectRoot
createdAtstringRequired within parentThe creation date and time of the marketing event.
Format: date-time
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.
eventUrlstringOptionalA URL in the external event application where the marketing event can be managed.
idstringRequired within parentThe ID of the marketing event CRM object.
objectIdstringOptionalThe ID of the marketing event CRM object.
startDateTimestringOptionalThe start date and time of the marketing event.
Format: date-time
updatedAtstringRequired within parentThe update date and time of the marketing event.
Format: date-time

Referenced models: Create a marketing event — response body — custom Properties item

Batch insert events — response body — errors item errors item
FieldTypePresenceDescription and constraints
$objectRootRepresents detailed information about an error that occurred in the API. This component is used to provide additional context and specifics about errors, typically as part of an error response.
codestringOptionalThe status code associated with the error detail
contextobjectOptionalContext about the error condition
Additional keys: see wildcard field
context.*arrayAdditional keys
context.*[]stringEach item
instringOptionalThe name of the field or parameter in which the error was found.
messagestringRequired within parentA human readable message describing the error along with remediation steps where appropriate
subCategorystringOptionalA specific category that contains more specific detail about the error
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

SDK function policy ID: hubspot.marketing_events_batch_upsert_marketing_events. Catalog operation: marketing_events_batch_upsert_marketing_events. 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.