canonical: https://jentic.com/apis/hubspot.com/hubspot-events-manage-event-definitions

# HubSpot Events Manage Event Definitions

The HubSpot Manage Event Definitions API lets you create, update, and delete the schemas for custom behavioural events tracked against contacts in a HubSpot account. Each event definition declares a unique event name and a set of typed properties, which then governs every occurrence sent through the Send Event Completions API. This API also supports adding, updating, and removing individual properties on an existing event definition without redefining the whole schema, which keeps custom events evolvable as the product or campaign tracking changes.

## For AI agents

Define and evolve custom behavioural event schemas in HubSpot - create event definitions, then add or remove typed properties without rebuilding the whole schema.

## Scope

Does not send event occurrences, query event history, or manage CRM contact records - use for defining and evolving custom event schemas only.

## Capabilities

- Create a new custom behavioural event definition with a typed property set
- Update an existing event definition's metadata and label by event name
- Delete a custom event definition that is no longer in use
- Add a new typed property to an event definition without redefining the whole schema
- Update or remove an individual property on an existing event definition
- Read back the current schema for a custom event before sending occurrences

## Use cases

### Provision a Custom Event Schema

Before tracking a new product behaviour in HubSpot you must register an event definition with the property types it will carry. This API lets an agent create a definition such as checkout_completed with typed properties (order_value as number, currency as string), so that subsequent event completions are validated and reportable in HubSpot. Provisioning the schema once unlocks reporting, segmentation, and workflow triggers across the platform.

Example prompt: Call POST /events/v3/event-definitions with eventName=pe12345_checkout_completed and a property array including order_value (number) and currency (string).

### Evolve an Event Schema Without Rebuilding

Product tracking needs change - add a new property to an existing event definition without losing historical occurrences or redefining the full schema. POST to the property subresource of an event definition to register a new typed property, or DELETE to remove a deprecated one. Useful when adding a new attribute (for example coupon_code on checkout_completed) mid-campaign.

Example prompt: Call POST /events/v3/event-definitions/{eventName}/property with name=coupon_code and type=string to add the property.

### Schema Cleanup and Deprecation

Deprecate event definitions that are no longer in use by deleting the definition or removing specific properties to keep the HubSpot reporting catalogue clean. Listing the current schema before deletion lets an agent confirm there are no active dashboards that depend on the property. Useful for end-of-campaign cleanup and for reducing portal clutter when a product feature is sunset.

Example prompt: Call DELETE /events/v3/event-definitions/{eventName}/property/{propertyName} to remove a deprecated property, then DELETE /events/v3/event-definitions/{eventName} once unused.

### AI Agent Schema Bootstrap via Jentic

An AI agent provisioning a new analytics integration searches Jentic for HubSpot event-definition operations, loads the create-definition schema, and submits the event with its property list. Jentic stores the OAuth credentials so the agent never handles raw tokens, and the typed input schema means the agent gets validation feedback before the call hits HubSpot.

Example prompt: Search Jentic for "create hubspot event definition", load the input schema, and execute POST /events/v3/event-definitions with the new event name and property array.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /events/v3/event-definitions | Create a new custom event definition |
| PATCH | /events/v3/event-definitions/{eventName} | Update an existing event definition |
| DELETE | /events/v3/event-definitions/{eventName} | Delete a custom event definition |
| POST | /events/v3/event-definitions/{eventName}/property | Add a property to an event definition |
| PATCH | /events/v3/event-definitions/{eventName}/property/{propertyName} | Update a property on an event definition |
| DELETE | /events/v3/event-definitions/{eventName}/property/{propertyName} | Delete a property from an event definition |

## Key resources

- **Event Definitions** — Custom behavioural event schemas - created, updated, deleted by event name.
- **Event Properties** — Typed properties attached to a definition, addressable individually for incremental schema changes.

## Why Jentic

- **Setup:** Wiring HubSpot Event Definitions by hand means learning its OAuth2 access token auth, targeting the api.hubapi.com host, and shaping event and property schema payloads yourself. Through Jentic you install once, import HubSpot Event Definitions from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** The Event Definitions API puts the event name in the URL path (/events/v3/event-definitions/{eventName}), so a rule can pin your agent to one event definition for updating it and its properties. You choose the operations it may call, so deleting a definition or a property is not included unless you add it.
- **Credential handling:** Your HubSpot access token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a HubSpot event definition' or 'add an event property', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Events Send Event Completions** — Send occurrences of the events you define here
- **Events Events** — Read back the events captured against contacts
- **CRM Contacts** — Manage the contacts that events are fired against
- **Mixpanel** — Schema-on-write product analytics with broader event modelling than HubSpot's custom events

## FAQ

### What authentication does the Manage Event Definitions API use?

It accepts HubSpot OAuth 2.0 access tokens or private app tokens (legacy schemes oauth2_legacy and private_apps_legacy) sent as Bearer in the Authorization header. Through Jentic, the token is stored encrypted in your Jentic One instance and injected at execution time.

### Can I add a property to an event without redefining the whole schema?

Yes. Call POST /events/v3/event-definitions/{eventName}/property with the property name and type. Existing occurrences are preserved and new sends can immediately include the property.

### What property types are supported for event definitions?

HubSpot supports string, number, datetime, and enumeration property types on custom event definitions. Set the type field on each property when creating the definition or adding a property to an existing one.

### What are the rate limits for this API?

HubSpot enforces account-level limits of 100 requests per 10 seconds for OAuth and private app tokens, with daily caps that depend on the subscription tier. Watch the X-HubSpot-RateLimit response headers to back off before hitting the cap.

### How do I create a custom event definition through Jentic?

Run pip install jentic, search for "create hubspot event definition", load the schema for POST /events/v3/event-definitions, and execute with eventName and a property array. Get started with Jentic One, the self-hosted execution layer.

### What happens to existing occurrences when I delete an event definition?

Deleting a definition removes the schema and detaches the event from new reporting, but historical occurrences may remain in the events store for a retention window. Confirm with HubSpot's current docs before removing definitions in active use.

### Can I limit what my agent is allowed to do with the HubSpot Event Definitions API?

Yes. Jentic One is self-hosted by you, so your own rules decide which operations and credentials the agent may use. Because the event name sits in the URL path (/events/v3/event-definitions/{eventName}), you can pin the agent to a single event definition and its properties, and you choose which operations it may call, so destructive calls like DELETE /events/v3/event-definitions/{eventName} or removing a property are excluded unless you add them. Your HubSpot access token is held encrypted by your own instance and injected only at execution time, never reaching the agent's prompt or logs.
