HubSpot CRM Feature Flags API

The feature flags API allows public app developers to manage feature flags for their HubSpot app installations. Feature flags can be used to control the rollout of new functionality to specific accounts or user segments.

Documentation

Specifications

Code Examples

💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-delete-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-delete-input-item-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-error-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-portal-flag-state-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-portal-flag-state-input-item-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-portal-flag-state-response-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-batch-portal-flag-state-response-with-errors-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-feature-flag-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-feature-flag-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-flag-state-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-paging-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-paging-next-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-portal-flag-state-collection-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-portal-flag-state-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/crm-feature-flags-api-portal-flag-state-input-example.json

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-delete-input-item-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-delete-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-error-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-portal-flag-state-input-item-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-portal-flag-state-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-portal-flag-state-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-batch-portal-flag-state-response-with-errors-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-feature-flag-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-feature-flag-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-flag-state-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-paging-next-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-paging-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-portal-flag-state-collection-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-portal-flag-state-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/crm-feature-flags-api-portal-flag-state-schema.json
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure

OpenAPI Specification

hubspot-crm-feature-flags-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: HubSpot CRM Feature Flags API
  description: |
    The HubSpot CRM Feature Flags API allows you to manage feature flags for your HubSpot applications.

    ## Overview
    Feature flags enable you to control feature rollouts at both the application and portal (account) level. This API provides:
    - Application-level feature flag management with configurable default states
    - Portal-specific flag state overrides for targeted feature enablement
    - Batch operations for efficient bulk management of flag states
    - Support for gradual rollouts, A/B testing, and controlled feature releases

    ## Flag States
    - **ON**: Feature is enabled
    - **OFF**: Feature is disabled
    - **ABSENT**: No explicit state set (uses default)

    ## Authentication
    This API requires API key authentication via the `hapikey` query parameter.

    ## Rate Limits
    Standard HubSpot API rate limits apply. See HubSpot documentation for details.
  version: 3.0.0
  contact:
    name: HubSpot Developer Support
    url: https://developers.hubspot.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT

servers:
- url: https://api.hubapi.com
  description: HubSpot Production API Server

tags:
- name: Application Feature Flags
  description: Manage feature flag configurations at the application level
- name: Batch Portal Operations
  description: Perform bulk operations on portal flag states

- name: Portal Flag States
  description: Manage feature flag states for specific portals (HubSpot accounts)
paths:
  /feature-flags/v3/{appId}/flags/{flagName}:
    get:
      tags:
      - Application Feature Flags
      summary: Hubspot Retrieve a Feature Flag Configuration
      description: |
        Retrieves the configuration for a specific feature flag associated with an application.
        Returns the flag name, default state, and any override state configured.
      operationId: getApplicationFeatureFlag
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("FeatureFlagExample")
          return "FeatureFlagExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      responses:
        '200':
          description: Successfully retrieved the feature flag configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
              examples:
                FeatureFlagExample:
                  $ref: '#/components/examples/FeatureFlagExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                ErrorExample:
                  $ref: '#/components/examples/ErrorExample'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getapplicationfeatureflag401Example:
                  summary: Default getApplicationFeatureFlag 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: &id001
                      key: value
                    links: &id002
                      key: value
                    errors: &id003
                    - message: "flagState is required"
                      code: "REQUIRED_FIELD"
                      subCategory: "MISSING_FIELD"
                      in: "body"
                      context:
                        key: value
        '404':
          description: Feature flag not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getapplicationfeatureflag404Example:
                  summary: Default getApplicationFeatureFlag 404 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Getapplicationfeatureflag500Example:
                  summary: Default getApplicationFeatureFlag 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
    put:
      tags:
      - Application Feature Flags
      summary: Hubspot Create or Update a Feature Flag
      description: |
        Creates or updates a feature flag configuration for an application.
        Set the default state that will apply to all portals unless overridden.
      operationId: upsertApplicationFeatureFlag
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("FeatureFlagExample")
          return "FeatureFlagExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      requestBody:
        required: true
        description: Feature flag configuration to set
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureFlagInput'
            examples:
              FeatureFlagInputExample:
                $ref: '#/components/examples/FeatureFlagInputExample'
      responses:
        '200':
          description: Successfully created or updated the feature flag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
              examples:
                FeatureFlagExample:
                  $ref: '#/components/examples/FeatureFlagExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Upsertapplicationfeatureflag400Example:
                  summary: Default upsertApplicationFeatureFlag 400 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Upsertapplicationfeatureflag401Example:
                  summary: Default upsertApplicationFeatureFlag 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Upsertapplicationfeatureflag500Example:
                  summary: Default upsertApplicationFeatureFlag 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
    delete:
      tags:
      - Application Feature Flags
      summary: Hubspot Delete a Feature Flag
      description: |
        Deletes a feature flag from an application.
        This will also remove all portal-level flag state overrides associated with this flag.
      operationId: deleteApplicationFeatureFlag
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("FeatureFlagExample")
          return "FeatureFlagExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      responses:
        '200':
          description: Successfully deleted the feature flag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
              examples:
                FeatureFlagExample:
                  $ref: '#/components/examples/FeatureFlagExample'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleteapplicationfeatureflag401Example:
                  summary: Default deleteApplicationFeatureFlag 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '404':
          description: Feature flag not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleteapplicationfeatureflag404Example:
                  summary: Default deleteApplicationFeatureFlag 404 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Deleteapplicationfeatureflag500Example:
                  summary: Default deleteApplicationFeatureFlag 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
  /feature-flags/v3/{appId}/flags/{flagName}/portals:
    get:
      tags:
      - Portal Flag States
      summary: Hubspot List Portal Flag States
      description: |
        Retrieves a paginated list of portal (account) flag states for a specific feature flag.
        Returns all portals that have an explicit flag state override set.
      operationId: listPortalFlagStates
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("PortalFlagStateCollectionExample")
          return "PortalFlagStateCollectionExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      - name: limit
        in: query
        description: Maximum number of results to return per page
        schema:
          type: integer
          default: 100
          maximum: 500
        example: 100
      - name: after
        in: query
        description: Pagination cursor for fetching the next page of results
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Successfully retrieved portal flag states
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalFlagStateCollection'
              examples:
                PortalFlagStateCollectionExample:
                  $ref: '#/components/examples/PortalFlagStateCollectionExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Listportalflagstates400Example:
                  summary: Default listPortalFlagStates 400 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Listportalflagstates401Example:
                  summary: Default listPortalFlagStates 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '404':
          description: Feature flag not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Listportalflagstates404Example:
                  summary: Default listPortalFlagStates 404 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Listportalflagstates500Example:
                  summary: Default listPortalFlagStates 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
  /feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}:
    get:
      tags:
      - Portal Flag States
      summary: Hubspot Retrieve a Portal Flag State
      description: |
        Retrieves the flag state for a specific portal (account).
        Returns the current flag state override for the specified portal.
      operationId: getPortalFlagState
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("PortalFlagStateExample")
          return "PortalFlagStateExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      - $ref: '#/components/parameters/PortalIdPath'
        example: example-value
      responses:
        '200':
          description: Successfully retrieved the portal flag state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalFlagState'
              examples:
                PortalFlagStateExample:
                  $ref: '#/components/examples/PortalFlagStateExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getportalflagstate400Example:
                  summary: Default getPortalFlagState 400 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getportalflagstate401Example:
                  summary: Default getPortalFlagState 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '404':
          description: Portal flag state not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getportalflagstate404Example:
                  summary: Default getPortalFlagState 404 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Getportalflagstate500Example:
                  summary: Default getPortalFlagState 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
    put:
      tags:
      - Portal Flag States
      summary: Hubspot Set a Portal Flag State
      description: |
        Sets the flag state override for a specific portal (account).
        This overrides the application-level default state for this portal only.
      operationId: setPortalFlagState
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("PortalFlagStateExample")
          return "PortalFlagStateExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      - $ref: '#/components/parameters/PortalIdPath'
        example: example-value
      requestBody:
        required: true
        description: Flag state to set for the portal
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PortalFlagStateInput'
            examples:
              PortalFlagStateInputExample:
                $ref: '#/components/examples/PortalFlagStateInputExample'
      responses:
        '200':
          description: Successfully set the portal flag state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalFlagState'
              examples:
                PortalFlagStateExample:
                  $ref: '#/components/examples/PortalFlagStateExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Setportalflagstate400Example:
                  summary: Default setPortalFlagState 400 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Setportalflagstate401Example:
                  summary: Default setPortalFlagState 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Setportalflagstate500Example:
                  summary: Default setPortalFlagState 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
    delete:
      tags:
      - Portal Flag States
      summary: Hubspot Delete a Portal Flag State
      description: |
        Removes the flag state override for a specific portal (account).
        The portal will revert to using the application-level default flag state.
      operationId: deletePortalFlagState
      x-microcks-operation:
        delay: 100
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("PortalFlagStateExample")
          return "PortalFlagStateExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      - $ref: '#/components/parameters/PortalIdPath'
        example: example-value
      responses:
        '200':
          description: Successfully deleted the portal flag state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalFlagState'
              examples:
                PortalFlagStateExample:
                  $ref: '#/components/examples/PortalFlagStateExample'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleteportalflagstate401Example:
                  summary: Default deletePortalFlagState 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '404':
          description: Portal flag state not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleteportalflagstate404Example:
                  summary: Default deletePortalFlagState 404 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Deleteportalflagstate500Example:
                  summary: Default deletePortalFlagState 500 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
  /feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert:
    post:
      tags:
      - Batch Portal Operations
      summary: Hubspot Batch Create or Update Portal Flag States
      description: |
        Sets flag states for multiple portals (accounts) in a single request.
        Efficiently enables or disables features for multiple accounts at once.
      operationId: batchUpsertPortalFlagStates
      x-microcks-operation:
        delay: 150
        dispatcher: SCRIPT
        dispatcherRules: |
          def mockResponse = mockRequest.getResponseByDispatchCriteria("BatchPortalFlagStateResponseExample")
          return "BatchPortalFlagStateResponseExample"
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/AppIdPath'
        example: example-value
      - $ref: '#/components/parameters/FlagNamePath'
        example: example-value
      requestBody:
        required: true
        description: List of portal flag states to create or update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchPortalFlagStateInput'
            examples:
              BatchPortalFlagStateInputExample:
                $ref: '#/components/examples/BatchPortalFlagStateInputExample'
      responses:
        '200':
          description: Successfully processed all batch portal flag state updates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchPortalFlagStateResponse'
              examples:
                BatchPortalFlagStateResponseExample:
                  $ref: '#/components/examples/BatchPortalFlagStateResponseExample'
        '207':
          description: Multi-status - Some operations succeeded while others failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchPortalFlagStateResponseWithErrors'
              examples:
                BatchPortalFlagStateResponseWithErrorsExample:
                  $ref: '#/components/examples/BatchPortalFlagStateResponseWithErrorsExample'
        '400':
          description: Bad request - Invalid parameters provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Batchupsertportalflagstates400Example:
                  summary: Default batchUpsertPortalFlagStates 400 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Batchupsertportalflagstates401Example:
                  summary: Default batchUpsertPortalFlagStates 401 response
                  x-microcks-default: true
                  value:
                    category: VALIDATION_ERROR
                    correlationId: "aeb5f871-7f07-4993-9211-075dc63e7cbf"
                    message: "Invalid input JSON"
                    subCategory: "INVALID_PARAMETER"
                    context: *id001
                    links: *id002
                    errors: *id003
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

              examples:
                Batchupsertportalflagstates500Example:
                  summary: Default batchUpsertPortalFlagStates 500 response
                  x-microcks-defau

# --- truncated at 32 KB (50 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/openapi/hubspot-crm-feature-flags-api-openapi.yml