canonical: https://jentic.com/apis/hubspot.com/hubspot-crm-public-app-feature-flags-v3

# HubSpot Public App Feature Flags V3

The HubSpot Public App Feature Flags V3 API lets developers of HubSpot public apps roll out features gradually by toggling per-account flag states. Developers define a feature flag at the app level and then enable, disable, or query the flag state for individual HubSpot portals (accounts) using the app. The API supports single-portal updates, batch upserts, batch deletes, and lookups across all portals where a flag has been set, making it suitable for staged rollouts, A/B experiments, and emergency feature kill switches.

## For AI agents

Toggle and query HubSpot public app feature flags per portal so an agent can roll a feature out to specific accounts, batch-update many portals, or check whether a feature is enabled for a given customer.

## Scope

Does not handle CRM records, marketing campaigns, or end-user feature targeting rules - use for per-portal app feature flag toggling only.

## Capabilities

- Set a feature flag state for a single HubSpot portal using PUT /feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}
- Roll out a feature to many accounts in one call with POST /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert
- Roll back a feature for many portals at once via POST /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/delete
- Look up which portals currently have a feature flag set via GET /feature-flags/v3/{appId}/flags/{flagName}/portals
- Check whether a specific portal has a flag enabled before serving feature-gated functionality
- Create or remove an app-level feature flag definition using PUT and DELETE on /feature-flags/v3/{appId}/flags/{flagName}
- Inspect the current configuration of an app feature flag with GET /feature-flags/v3/{appId}/flags/{flagName}

## Use cases

### Staged Feature Rollout for HubSpot App

Gradually expose a new feature in a HubSpot public app to a controlled subset of customer portals before enabling it for everyone. Developers create a flag at the app level, then use the batch upsert endpoint to enable it for an initial cohort of portal IDs and expand the cohort over time. Feature gating happens server-side by checking the flag state for the calling portal on each request, so customers in the cohort see the feature immediately while others continue with the existing experience.

Example prompt: Call POST /feature-flags/v3/{appId}/flags/new_dashboard/portals/batch/upsert with portal IDs [12345,67890,11111] and enabled=true, then verify each via GET /feature-flags/v3/{appId}/flags/new_dashboard/portals/{portalId}.

### Emergency Feature Kill Switch

When a newly released feature causes problems for a subset of customers, support engineers need to disable it quickly without redeploying the app. The Public App Feature Flags V3 API makes this possible via the batch delete endpoint, which removes the flag state for many portals in one call so they fall back to the default behaviour. The same flag can later be re-enabled selectively after a fix ships.

Example prompt: Call POST /feature-flags/v3/{appId}/flags/risky_feature/portals/batch/delete with the list of impacted portal IDs to immediately revert them to default behaviour.

### Per-Portal Feature Gating Lookup

On every inbound webhook or API call from a HubSpot portal, a public app needs to know whether to serve the new code path or the legacy one. By calling the per-portal flag state endpoint (cached locally), the app can route the request appropriately. The flag store is the single source of truth for which portals are in which experiment, removing the need for ad-hoc allowlists in app code.

Example prompt: Call GET /feature-flags/v3/{appId}/flags/new_dashboard/portals/{portalId} for portal 12345 and branch the request handler based on the returned enabled state.

### AI Agent Coordinated Rollout

An AI agent managing a HubSpot app release workflow uses Jentic to discover the Public App Feature Flags V3 operations, then orchestrates a multi-day rollout: enable the flag for 10 portals on day one, query their support tickets, decide whether to expand the cohort, and either grow it or roll back. Jentic handles the developer hapikey credential, scopes access tokens, and gives the agent typed inputs for each call so the agent never sees the raw key.

Example prompt: Search Jentic for 'enable hubspot feature flag for portal', load the upsert operation schema, and execute a batch upsert for the day-one cohort, then schedule a follow-up check after 24 hours.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| PUT | /feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId} | Enable or disable a flag for a single portal |
| POST | /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert | Batch upsert flag state for many portals |
| POST | /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/delete | Batch remove flag state from many portals |
| GET | /feature-flags/v3/{appId}/flags/{flagName}/portals | List all portals with a state set for a flag |
| GET | /feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId} | Read the flag state for one portal |
| PUT | /feature-flags/v3/{appId}/flags/{flagName} | Create or update an app-level flag definition |
| DELETE | /feature-flags/v3/{appId}/flags/{flagName} | Delete an app-level flag definition |

## Key resources

- **App Flags** — Define, retrieve, and delete feature flags scoped to a HubSpot public app.
- **Portal Flag States** — Set, retrieve, list, and delete flag states for individual HubSpot portals (accounts), with batch upsert and batch delete support.

## Why Jentic

- **Setup:** Wiring Public App Feature Flags V3 by hand means managing your HubSpot developer hapikey, appending it as a query parameter on every call to api.hubapi.com, and assembling the appId, flagName, and portalId path segments yourself. Through Jentic you install once, import Public App Feature Flags V3 from the API Directory, store the developer hapikey once, and your agent calls it.
- **Permission scoping:** This API puts the app id and flag name in the URL path (/feature-flags/v3/{appId}/flags/{flagName}/...), so a rule can pin your agent to one app: it can toggle that app's flags across portals and no other. You choose the operations it may call, so a destructive one like flag deletion is not included unless you add it.
- **Credential handling:** Your HubSpot developer hapikey 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 'enable a HubSpot feature flag for a portal', and Jentic returns the matching feature flag operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **LaunchDarkly API** — Dedicated feature flag platform with richer targeting, experimentation, and analytics than HubSpot's app-scoped flags.
- **Optimizely API** — Experimentation and feature management platform with A/B testing on top of feature flags.
- **HubSpot OAuth** — Manages OAuth tokens for HubSpot public apps that consume feature flag decisions.

## FAQ

### What authentication does the HubSpot Public App Feature Flags V3 API use?

It authenticates with a developer hapikey passed as the hapikey query parameter, scoped to the app account that owns the appId. Through Jentic, the developer hapikey is stored in the encrypted vault and never enters the agent's context - Jentic injects it server-side when executing the call.

### Can I roll out a feature flag to many HubSpot portals in one call with this API?

Yes. POST /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert accepts a list of portal IDs and their desired flag states in a single request, and POST /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/delete removes flag state from many portals at once.

### What are the rate limits for the Public App Feature Flags V3 API?

HubSpot applies its standard public app rate limits (100 requests per 10 seconds per app, plus daily quotas). Batch endpoints count as a single request, so prefer batch upsert and batch delete over per-portal calls for large rollouts.

### How do I check a feature flag for a specific portal through Jentic?

Search Jentic with the query 'check hubspot feature flag for portal', load the GET /feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId} operation, and execute it with your appId, flagName, and portalId. Jentic returns the typed response so your agent can branch on the enabled field.

### Is the Public App Feature Flags V3 API free to use?

Access is included with a HubSpot developer account; there is no separate charge for the feature flags endpoints. Standard public app rate limits and any plan-tier limits on the apps consuming the flags still apply.

### Can I define a feature flag programmatically before assigning portal states?

Yes. PUT /feature-flags/v3/{appId}/flags/{flagName} creates or updates the flag definition at the app level, and DELETE on the same path removes it. You typically create the flag once during release prep, then manage portal states with the per-portal and batch endpoints.

### Can I limit what my agent is allowed to do with the Public App Feature Flags V3 API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use. Since this API puts the app id and flag name in the URL path, you can pin the agent to a single HubSpot app so it toggles only that app's flags across portals and reaches no other. You also pick the exact operations it may call, so you can grant read and per-portal or batch upsert calls while withholding a destructive one like the DELETE flag definition, and your developer hapikey is injected at execution time rather than exposed to the agent.
