openapi: 3.0.1 info: title: HubSpot CMS Source Code description: Basepom for all HubSpot Projects version: 2026-09 x-hubspot-product-tier-requirements: marketing: FREE sales: FREE service: FREE cms: STARTER commerce: FREE crmHub: FREE dataHub: FREE servers: - url: https://api.hubapi.com tags: - name: Advanced - name: Basic paths: /cms/source-code/2026-09/extract/async: post: tags: - Advanced summary: Extract a zip file description: Extract a zip file in the developer file system. Extraction status can be checked with the `/extract/async/tasks/taskId/status` endpoint below. operationId: post-/cms/source-code/2026-09/extract/async_doAsync parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/FileExtractRequest' required: true responses: '202': description: accepted content: application/json: schema: $ref: '#/components/schemas/TaskLocator' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content /cms/source-code/2026-09/extract/async/tasks/{taskId}/status: get: tags: - Advanced summary: Get extraction status description: Get the status of an extraction by the `taskId` returned from the initial `extract/async` request. operationId: get-/cms/source-code/2026-09/extract/async/tasks/{taskId}/status_getAsyncStatus parameters: - name: taskId in: path description: '' required: true style: simple explode: false schema: type: integer format: int32 responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/ActionResponse' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content /cms/source-code/2026-09/{environment}/content/{path}: get: tags: - Basic summary: Download a file description: Downloads the byte contents of the file at the specified path in the specified environment. operationId: get-/cms/source-code/2026-09/{environment}/content/{path}_download parameters: - name: environment in: path description: '' required: true style: simple explode: false schema: type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string responses: default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly put: tags: - Advanced summary: Create or update a file description: Upserts a file at the specified path in the specified environment. Accepts multipart/form-data content type. operationId: put-/cms/source-code/2026-09/{environment}/content/{path}_createOrUpdate parameters: - name: environment in: path description: '' required: true style: simple explode: false schema: type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AssetFileMetadata' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly post: tags: - Advanced summary: Create a file description: Creates a file at the specified path in the specified environment. Accepts multipart/form-data content type. Throws an error if a file already exists at the specified path. operationId: post-/cms/source-code/2026-09/{environment}/content/{path}_create parameters: - name: environment in: path description: '' required: true style: simple explode: false schema: type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AssetFileMetadata' default: description: '' $ref: '#/components/responses/Error' deprecated: true security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly delete: tags: - Basic summary: Delete a file description: Deletes the file at the specified path in the specified environment. operationId: delete-/cms/source-code/2026-09/{environment}/content/{path}_archive parameters: - name: environment in: path description: '' required: true style: simple explode: false schema: type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string responses: '204': description: No content content: {} default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly /cms/source-code/2026-09/{environment}/metadata/{path}: get: tags: - Basic summary: Get the metadata for a file description: Gets the metadata object for the file at the specified path in the specified environment. operationId: get-/cms/source-code/2026-09/{environment}/metadata/{path}_get parameters: - name: environment in: path description: '' required: true style: simple explode: false schema: type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string - name: properties in: query description: '' required: false style: form explode: true schema: type: string responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AssetFileMetadata' default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly /cms/source-code/2026-09/{environment}/validate/{path}: post: tags: - Advanced summary: Validate the contents of a file description: Validates the file contents passed to the endpoint given a specified path and environment. Accepts multipart/form-data content type. operationId: post-/cms/source-code/2026-09/{environment}/validate/{path}_doValidate parameters: - name: environment in: path required: true schema: pattern: .+ type: string - name: path in: path description: '' required: true style: simple explode: false schema: pattern: .+ type: string requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary responses: default: description: '' $ref: '#/components/responses/Error' security: - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly components: schemas: ActionResponse: required: - completedAt - startedAt - status type: object properties: completedAt: type: string description: The timestamp indicating when the action was completed. format: date-time links: type: object additionalProperties: type: string description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps requestedAt: type: string description: The timestamp indicating when the action was requested. format: date-time startedAt: type: string description: The timestamp indicating when the action was started. format: date-time status: type: string description: 'The current status of the action, with possible values: CANCELED, COMPLETE, PENDING, PROCESSING.' enum: - CANCELED - COMPLETE - PENDING - PROCESSING AssetFileMetadata: required: - createdAt - folder - id - name - updatedAt type: object properties: archivedAt: type: integer description: Timestamp of when the object was archived (deleted). format: int64 children: type: array description: If the object is a folder, contains the filenames of the files within the folder. items: type: string createdAt: type: integer description: Timestamp of when the object was first created. format: int64 folder: type: boolean description: Determines whether or not this path points to a folder. hash: type: string description: A unique identifier for the file's content, used to verify data integrity. id: type: string description: The path of the file in the CMS Developer File System. name: type: string description: The name of the file. updatedAt: type: integer description: Timestamp of when the object was last updated. format: int64 Error: required: - category - correlationId - message type: object properties: category: type: string description: The error category context: type: object additionalProperties: type: array items: type: string 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 items: $ref: '#/components/schemas/ErrorDetail' links: type: object additionalProperties: type: string description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps 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 description: Represents an error response returned by the API when an operation fails. This component is used in various endpoints to provide detailed information about the error encountered. 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 ErrorDetail: required: - message type: object properties: code: type: string description: The status code associated with the error detail context: type: object additionalProperties: type: array items: type: string 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. message: type: string description: A human readable message describing the error along with remediation steps where appropriate subCategory: type: string description: A specific category that contains more specific detail about the error description: Represents detailed information about an error that occurred in the API. This component is used to provide additional context and specifics about errors, typically as part of an error response. FileExtractRequest: required: - path type: object properties: path: type: string description: The file system location where the zip file is to be extracted. TaskLocator: required: - id type: object properties: id: type: string description: The unique identifier for the task. links: type: object additionalProperties: type: string description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps responses: Error: description: An error occurred. content: '*/*': schema: $ref: '#/components/schemas/Error' securitySchemes: 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: content: '' private_apps: type: apiKey name: private-app in: header private_apps_legacy: type: apiKey name: private-app-legacy in: header x-hubspot-available-client-libraries: - Node - Python - Ruby - PHP x-hubspot-product-tier-requirements: marketing: FREE sales: FREE service: FREE cms: STARTER commerce: FREE crmHub: FREE dataHub: FREE