openapi: 3.1.0 info: title: HubSpot Analytics Events Access Tokens File Content API description: "The HubSpot Analytics Events API allows you to retrieve event completion data \nfrom your HubSpot account. Use this API to query event instances associated with \nCRM objects, filter by event types, and analyze user behavior and engagement patterns.\n\n## Key Features\n- Retrieve event instances for CRM objects\n- Filter events by type, date range, and object\n- Paginate through large result sets\n- Query available event types\n" 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: File Content description: Operations for downloading, creating, updating, and deleting source code files paths: /cms/v3/source-code/{environment}/content/{path}: get: tags: - File Content summary: Hubspot Download a Source Code File description: 'Downloads the byte contents of a file at the specified path in the specified environment. Use ''draft'' for unpublished changes or ''published'' for live content. ' operationId: downloadSourceCodeFile x-microcks-operation: dispatcher: SCRIPT dispatcherRules: 'def result = "FileContentSuccessExample" return result ' parameters: - $ref: '#/components/parameters/EnvironmentPath' example: example-value - $ref: '#/components/parameters/FilePathPath' example: example-value responses: '200': description: Successfully downloaded file content content: application/octet-stream: schema: type: string format: binary examples: FileContentSuccessExample: $ref: '#/components/examples/FileContentSuccessExample' text/html: schema: type: string examples: HtmlFileContentExample: $ref: '#/components/examples/HtmlFileContentExample' text/css: schema: type: string examples: CssFileContentExample: $ref: '#/components/examples/CssFileContentExample' application/javascript: schema: type: string examples: JsFileContentExample: $ref: '#/components/examples/JsFileContentExample' default: $ref: '#/components/responses/ErrorResponse' security: - privateApps: - content - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly put: tags: - File Content summary: Hubspot Create or Update a Source Code File description: 'Creates a new file or updates an existing file at the specified path in the specified environment. This upsert operation accepts multipart/form-data content type with the file as the payload. ' operationId: upsertSourceCodeFile x-microcks-operation: dispatcher: SCRIPT dispatcherRules: 'def result = "AssetFileMetadataSuccessExample" return result ' parameters: - $ref: '#/components/parameters/EnvironmentPath' example: example-value - $ref: '#/components/parameters/FilePathPath' example: example-value requestBody: description: The file content to upload required: true content: multipart/form-data: schema: $ref: '#/components/schemas/FileUploadRequest' examples: FileUploadExample: $ref: '#/components/examples/FileUploadExample' responses: '200': description: Successfully created or updated file content: application/json: schema: $ref: '#/components/schemas/AssetFileMetadata' examples: AssetFileMetadataSuccessExample: $ref: '#/components/examples/AssetFileMetadataSuccessExample' default: $ref: '#/components/responses/ErrorResponse' security: - privateApps: - content - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly post: tags: - File Content summary: Hubspot Create a New Source Code File description: 'Creates a new file at the specified path in the specified environment. Returns an error if a file already exists at the path. For upsert behavior, use PUT instead. ' operationId: createSourceCodeFile deprecated: true x-microcks-operation: dispatcher: SCRIPT dispatcherRules: 'def result = "AssetFileMetadataSuccessExample" return result ' parameters: - $ref: '#/components/parameters/EnvironmentPath' example: example-value - $ref: '#/components/parameters/FilePathPath' example: example-value requestBody: description: The file content to upload required: true content: multipart/form-data: schema: $ref: '#/components/schemas/FileUploadRequest' examples: FileUploadExample: $ref: '#/components/examples/FileUploadExample' responses: '200': description: Successfully created file content: application/json: schema: $ref: '#/components/schemas/AssetFileMetadata' examples: AssetFileMetadataSuccessExample: $ref: '#/components/examples/AssetFileMetadataSuccessExample' default: $ref: '#/components/responses/ErrorResponse' security: - privateApps: - content - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly delete: tags: - File Content summary: Hubspot Delete a Source Code File description: 'Permanently deletes a file at the specified path in the specified environment. This action cannot be undone. ' operationId: deleteSourceCodeFile x-microcks-operation: dispatcher: SCRIPT dispatcherRules: 'def result = "NoContentExample" return result ' parameters: - $ref: '#/components/parameters/EnvironmentPath' example: example-value - $ref: '#/components/parameters/FilePathPath' example: example-value responses: '204': description: File successfully deleted default: $ref: '#/components/responses/ErrorResponse' security: - privateApps: - content - oauth2: - content x-hubspot-rate-limit-exemptions: - ten-secondly components: parameters: FilePathPath: name: path in: path required: true description: The file system path to the file or folder schema: type: string pattern: .+ example: templates/blog/post.html EnvironmentPath: name: environment in: path required: true description: The target environment for the operation (draft or published) schema: type: string enum: - draft - published example: draft schemas: ErrorDetail: type: object description: Detailed error information required: - message properties: message: type: string description: Error message example: Required property 'path' is missing code: type: string description: Error code example: MISSING_REQUIRED_PROPERTY subCategory: type: string description: Error subcategory example: standard in: type: string description: Location of the error example: body context: type: object description: Additional context additionalProperties: type: array items: type: string example: missingScopes: - scope1 - scope2 Error: type: object description: Standard error response required: - category - correlationId - message properties: category: type: string description: Error category example: VALIDATION_ERROR correlationId: type: string format: uuid description: Unique identifier for error tracking example: aeb5f871-7f07-4993-9211-075dc63e7cbf message: type: string description: Human-readable error message example: Invalid input (details will vary based on the error) subCategory: type: string description: Specific error subcategory example: standard context: type: object description: Additional error context additionalProperties: type: array items: type: string example: missingScopes: - scope1 - scope2 invalidPropertyName: - propertyValue links: type: object description: Links to relevant documentation additionalProperties: type: string example: knowledge-base: https://www.hubspot.com/products/service/knowledge-base errors: type: array description: Detailed error information items: $ref: '#/components/schemas/ErrorDetail' example: - message: Required property 'path' is missing code: MISSING_REQUIRED_PROPERTY subCategory: standard in: body context: missingScopes: - scope1 - scope2 FileUploadRequest: type: object description: Request body for file upload operations required: - file properties: file: type: string format: binary description: The file content to upload example: example-value AssetFileMetadata: type: object description: Metadata for a file or folder in the CMS Developer File System required: - id - name - folder - createdAt - updatedAt properties: id: type: string description: The full path of the file in the CMS Developer File System example: templates/blog/post.html name: type: string description: The name of the file or folder example: post.html folder: type: boolean description: Whether this path represents a folder (true) or file (false) example: false children: type: array description: List of child files and folders (only present for folders) items: type: string example: - header.html - footer.html - sidebar.html hash: type: string description: Content hash for change detection example: a1b2c3d4e5f6 createdAt: type: integer format: int64 description: Unix timestamp when the file was created example: 1705312200000 updatedAt: type: integer format: int64 description: Unix timestamp when the file was last updated example: 1705398600000 archivedAt: type: integer format: int64 description: Unix timestamp when the file was archived (if applicable) example: 0 responses: ErrorResponse: description: An error occurred content: application/json: schema: $ref: '#/components/schemas/Error' examples: ValidationErrorExample: $ref: '#/components/examples/ValidationErrorResponseExample' NotFoundErrorExample: $ref: '#/components/examples/NotFoundErrorExample' examples: CssFileContentExample: summary: CSS file content description: Example CSS stylesheet content value: ".blog-post {\n max-width: 800px;\n margin: 0 auto;\n padding: 2rem;\n}\n.blog-post h1 {\n font-size: 2.5rem;\n margin-bottom: 1rem;\n}\n" FileContentSuccessExample: summary: Binary file content description: Example binary file download response value: HtmlFileContentExample: summary: HTML template content description: Example HTML template file content value: "{% extends \"templates/layouts/base.html\" %}\n{% block content %}\n
\n

{{ content.title }}

\n
\n {{ content.post_body }}\n
\n
\n{% endblock %}\n" NotFoundErrorExample: summary: Not found error response description: Example error response when file is not found value: category: OBJECT_NOT_FOUND correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf message: 'File not found at path: templates/missing.html' links: knowledge-base: https://www.hubspot.com/products/service/knowledge-base JsFileContentExample: summary: JavaScript file content description: Example JavaScript file content value: "document.addEventListener('DOMContentLoaded', function() {\n const posts = document.querySelectorAll('.blog-post');\n posts.forEach(post => {\n post.classList.add('loaded');\n });\n});\n" AssetFileMetadataSuccessExample: summary: Successful file metadata response description: Example metadata for a template file value: id: templates/blog/post.html name: post.html folder: false hash: a1b2c3d4e5f6 createdAt: 1705312200000 updatedAt: 1705398600000 FileUploadExample: summary: File upload request description: Example multipart form data for file upload value: file: ValidationErrorResponseExample: summary: Validation error response description: Example error response for invalid input value: category: VALIDATION_ERROR correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf message: Invalid input (details will vary based on the error) context: missingScopes: - scope1 - scope2 links: knowledge-base: https://www.hubspot.com/products/service/knowledge-base securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://app.hubspot.com/oauth/authorize tokenUrl: https://api.hubapi.com/oauth/v1/token scopes: analytics.read: Read analytics data