{ "openapi" : "3.0.1", "info" : { "title" : "CRM Public App Feature Flags V3", "description" : "Basepom for all HubSpot Projects", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" }, "x-hubspot-related-documentation" : [ { "name" : "Migrate a public app to the developer projects framework (BETA)", "url" : "https://developers.hubspot.com/docs/guides/crm/public-apps/migrate-a-public-app-to-projects" } ] }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Basic" }, { "name" : "Batch" } ], "paths" : { "/feature-flags/v3/{appId}/flags/all" : { "get" : { "tags" : [ "Basic" ], "operationId" : "get-/feature-flags/v3/{appId}/flags/all_/feature-flags/v3/{appId}/flags/all", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/FlagsForAppResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-read" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-read" ] }, { "oauth2" : [ "developers-read" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/feature-flags/v3/{appId}/flags/{flagName}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve an app's feature flags", "description" : "Retrieve the current status of the app's feature flags. No request body is included.", "operationId" : "get-/feature-flags/v3/{appId}/flags/{flagName}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/FlagResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-read" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-read" ] }, { "oauth2" : [ "developers-read" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" }, "put" : { "tags" : [ "Basic" ], "summary" : "Set an app's feature flag", "description" : "Set a feature flag for an app. For example, update the `hs-hide-crm-cards` flag's `defaultState` to `ON` to hide classic CRM cards from new installs.", "operationId" : "put-/feature-flags/v3/{appId}/flags/{flagName}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/FlagPutRequest" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/FlagResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" }, "delete" : { "tags" : [ "Basic" ], "summary" : "Delete an app's feature flag", "description" : "Delete a feature flag in an app. For example, delete the `hs-release-app-cards` flag after all accounts have been migrated.", "operationId" : "delete-/feature-flags/v3/{appId}/flags/{flagName}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/FlagResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/feature-flags/v3/{appId}/flags/{flagName}/portals" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve accounts with a set flag state", "description" : "Retrieve a list of HubSpot accounts with an account-level flag setting for the specified app. No request body is included.", "operationId" : "get-/feature-flags/v3/{appId}/flags/{flagName}/portals", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "limit", "in" : "query", "description" : "The maximum number of results to display per page.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "startPortalId", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "integer", "format" : "int32", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateBatchResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-read" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-read" ] }, { "oauth2" : [ "developers-read" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/feature-flags/v3/{appId}/flags/{flagName}/portals/batch/delete" : { "post" : { "tags" : [ "Batch" ], "summary" : "Batch delete account flag state", "description" : "Delete an account-level flag state for multiple HubSpot accounts at once. Use this endpoint to manage flag exposure for groups of HubSpot accounts.", "operationId" : "post-/feature-flags/v3/{appId}/flags/{flagName}/portals/batch/delete", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateBatchDeleteRequest" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateBatchResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert" : { "post" : { "tags" : [ "Batch" ], "summary" : "Batch set account flag state", "description" : "Set the portal flag state for multiple HubSpot accounts at once. Use this endpoint to manage flag exposure for groups of HubSpot accounts.", "operationId" : "post-/feature-flags/v3/{appId}/flags/{flagName}/portals/batch/upsert", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateBatchPutRequest" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateBatchResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve account flag state", "description" : "Retrieve the account-level flag state of a specific HubSpot account.", "operationId" : "get-/feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "portalId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-read" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-read" ] }, { "oauth2" : [ "developers-read" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" }, "put" : { "tags" : [ "Basic" ], "summary" : "Set an account flag state", "description" : "Specify an account-level flag state for a specific HubSpot account.", "operationId" : "put-/feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "portalId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStatePutRequest" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" }, "delete" : { "tags" : [ "Basic" ], "summary" : "Delete an account flag state", "description" : "Delete an account-level flag state for a specific HubSpot account. No request body is included.", "operationId" : "delete-/feature-flags/v3/{appId}/flags/{flagName}/portals/{portalId}", "parameters" : [ { "name" : "appId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } }, { "name" : "flagName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "portalId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "integer", "format" : "int32", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PortalFlagStateResponse" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "developers-write" ] }, { "developer_hapikey" : [ ] }, { "internal_cookie" : [ "developers-write" ] }, { "oauth2" : [ "developers-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } } }, "components" : { "schemas" : { "ErrorDetail" : { "required" : [ "message" ], "type" : "object", "properties" : { "code" : { "type" : "string", "description" : "The status code associated with the error detail", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{missingScopes=[scope1, scope2]}" }, "in" : { "type" : "string", "description" : "The name of the field or parameter in which the error was found.", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : null }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : null }, "PortalFlagStateBatchResponse" : { "required" : [ "portalFlagStates" ], "type" : "object", "properties" : { "portalFlagStates" : { "type" : "array", "example" : null, "items" : { "$ref" : "#/components/schemas/PortalFlagStateResponse" } } }, "example" : null }, "FlagResponse" : { "required" : [ "appId", "defaultState", "flagName" ], "type" : "object", "properties" : { "appId" : { "type" : "integer", "description" : "The ID of the app", "format" : "int32", "example" : null }, "defaultState" : { "type" : "string", "description" : "The flag state for any portal that doesn't have an override value", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] }, "flagName" : { "type" : "string", "description" : "The name of the flag", "example" : null }, "overrideState" : { "type" : "string", "description" : "An optional flag value that overrides all others for this flag name and app, including portal-level values", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] } }, "example" : null }, "BatchPortalEntry" : { "required" : [ "flagState", "portalId" ], "type" : "object", "properties" : { "flagState" : { "type" : "string", "description" : "The flag state for this portal (e.g. ON or OFF)", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] }, "portalId" : { "type" : "integer", "description" : "The ID of the portal", "format" : "int32", "example" : null } }, "example" : null }, "PortalFlagStatePutRequest" : { "required" : [ "flagState" ], "type" : "object", "properties" : { "flagState" : { "type" : "string", "description" : "The state that the given flag should be in for this portal", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] } }, "example" : null }, "PortalFlagStateResponse" : { "required" : [ "appId", "flagName", "flagState", "portalId" ], "type" : "object", "properties" : { "appId" : { "type" : "integer", "description" : "The ID of the app", "format" : "int32", "example" : null }, "flagName" : { "type" : "string", "description" : "The name of the flag", "example" : null }, "flagState" : { "type" : "string", "description" : "The state of the flag for this portal", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] }, "portalId" : { "type" : "integer", "description" : "The ID of the portal", "format" : "int32", "example" : null } }, "example" : null }, "FlagPutRequest" : { "required" : [ "defaultState" ], "type" : "object", "properties" : { "defaultState" : { "type" : "string", "description" : "The state that the flag should have if there are no overrides for a particular portal", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] }, "overrideState" : { "type" : "string", "description" : "A flag value that supercedes all other overrides, including portal-level values. Mostly used for things like emergency overrides", "example" : null, "enum" : [ "ABSENT", "OFF", "ON" ] } }, "example" : null }, "FlagsForAppResponse" : { "required" : [ "flagsForApp" ], "type" : "object", "properties" : { "flagsForApp" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } } }, "example" : null }, "Error" : { "required" : [ "category", "correlationId", "message" ], "type" : "object", "properties" : { "category" : { "type" : "string", "description" : "The error category", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}" }, "correlationId" : { "type" : "string", "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", "format" : "uuid", "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" }, "errors" : { "type" : "array", "description" : "further information about the error", "example" : null, "items" : { "$ref" : "#/components/schemas/ErrorDetail" } }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string", "example" : null }, "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : "An error occurred" }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : { "message" : "Invalid input (details will vary based on the error)", "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", "category" : "VALIDATION_ERROR", "links" : { "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } } }, "PortalFlagStateBatchPutRequest" : { "required" : [ "portalStates" ], "type" : "object", "properties" : { "portalStates" : { "type" : "array", "example" : null, "items" : { "$ref" : "#/components/schemas/BatchPortalEntry" } } }, "example" : null }, "PortalFlagStateBatchDeleteRequest" : { "required" : [ "portalIds" ], "type" : "object", "properties" : { "portalIds" : { "type" : "array", "example" : null, "items" : { "type" : "integer", "format" : "int32", "example" : null } } }, "example" : null } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" }, "example" : null } } } }, "securitySchemes" : { "hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "developer_hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "oauth2" : { "type" : "oauth2", "flows" : { "authorizationCode" : { "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", "scopes" : { "developers-read" : "", "developers-write" : "" } } } }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" }, "private_apps" : { "type" : "apiKey", "name" : "private-app", "in" : "header" } } }, "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" } }