---
title: "Batch set account flag state"
method: POST
path: "/feature-flags/2026-03/{appId}/flags/{flagName}/portals/batch/upsert"
tags: ["Batch"]
---

# Batch set account flag state

`POST /feature-flags/2026-03/{appId}/flags/{flagName}/portals/batch/upsert`

## Request

- Base URL: `https://api.hubapi.com`
- URL: `https://api.hubapi.com/feature-flags/2026-03/{appId}/flags/{flagName}/portals/batch/upsert`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `hapikey`
  - none

Set the portal flag state for multiple HubSpot accounts at once. Use this endpoint to manage flag exposure for groups of HubSpot accounts.

## Path parameters

- `appId` integer, required
- `flagName` string, required

## Request body

- CrmFeatureFlagsPortalFlagStateBatchPutRequest
  - `portalStates` CrmFeatureFlagsBatchPortalEntry[], required
    - `flagState` 'ABSENT' | 'OFF' | 'ON', required: The flag state for this portal (e.g. ON or OFF)
    - `portalId` integer, required: The ID of the portal

## Response `200`

successful operation

- CrmFeatureFlagsPortalFlagStateBatchResponse
  - `portalFlagStates` CrmFeatureFlagsPortalFlagStateResponse[], required
    - `appId` integer, required: The ID of the app
    - `flagName` string, required: The name of the flag
    - `flagState` 'ABSENT' | 'OFF' | 'ON', required: The state of the flag for this portal
    - `portalId` integer, required: The ID of the portal

## Other responses

- `default`: An error occurred.

## Changes

> 14 revisions in range; 1 not diffed, 2 could not be searched.

- **2026-03-30** `dc2fdad57f7f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hubspot/apis/hubspot-api-specification/changes/feature-flags/2026-03/:appId/flags/:flagName/portals/batch/upsert/post.md)

---

[API](https://skmtc.dev/hubspot/apis/hubspot-api-specification.md) - [All operations](https://skmtc.dev/hubspot/apis/hubspot-api-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/hubspot/apis/hubspot-api-specification/revisions/f9c7181056c5?raw)
