openapi: 3.0.1
servers:
  - url: https://api.hubapi.com
x-hasEquivalentPaths: true
info:
  description: Upload and manage files.
  title: Files Files
  version: v3
  x-hubspot-api-use-case: When launching a company rebrand, upload a new set of branded images and assets to the file manager so that marketing and sales teams can update their assets accordingly.
  x-hubspot-documentation-banner: NONE
  x-hubspot-introduction: Use the files API to manage and store files in HubSpot's file manager tool. Files can be used throughout other HubSpot tools, such as inserting image files into emails.
  x-hubspot-product-tier-requirements:
    cms: STARTER
    marketing: FREE
    sales: FREE
    service: FREE
  x-hubspot-related-documentation:
    - name: Files Guide
      url: https://hubspot.dev/guides/api/files/files
  x-logo:
    url: https://developers.hubspot.com/hubfs/assets/hubspot.com/buzz/HubSpotOpenGraph.png
  x-origin:
    - format: openapi
      url: https://api.hubspot.com/api-catalog-public/v1/apis/files/v3/files
      version: "3.0"
  x-providerName: hubapi.com
  x-serviceName: files
tags:
  - name: Files
  - name: Folders
paths:
  /files/v3/files:
    post:
      description: Upload a single file with content specified in request body.
      operationId: post-/files/v3/files_upload
      parameters: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                charsetHunch:
                  description: Character set of the uploaded file.
                  type: string
                file:
                  description: File to be uploaded.
                  format: binary
                  type: string
                fileName:
                  description: Desired name for the uploaded file.
                  type: string
                folderId:
                  description: Either 'folderId' or 'folderPath' is required. folderId is the ID of the folder the file will be uploaded to.
                  type: string
                folderPath:
                  description: Either 'folderPath' or 'folderId' is required. This field represents the destination folder path for the uploaded file. If a path doesn't exist, the system will try to create one.
                  type: string
                options:
                  description: JSON string representing FileUploadOptions.
                  type: string
              type: object
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Upload file
      tags:
        - Files
  /files/v3/files/import-from-url/async:
    post:
      description: Asynchronously imports the file at the given URL into the file manager.
      operationId: post-/files/v3/files/import-from-url/async_importFromUrl
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ImportFromUrlInput"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ImportFromUrlTaskLocator"
          description: accepted
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Import a file from a URL into the file manager.
      tags:
        - Files
  /files/v3/files/import-from-url/async/tasks/{taskId}/status:
    get:
      description: Check the status of requested import.
      operationId: get-/files/v3/files/import-from-url/async/tasks/{taskId}/status_checkImport
      parameters:
        - description: Import by URL task ID
          explode: false
          in: path
          name: taskId
          required: true
          schema:
            type: string
          style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileActionResponse"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Check import status.
      tags:
        - Files
  /files/v3/files/search:
    get:
      description: Search through files in the file manager. Does not display hidden or archived files.
      operationId: get-/files/v3/files/search_doSearch
      parameters:
        - description: Desired file properties in the return object.
          explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - description: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit.
          explode: true
          in: query
          name: after
          required: false
          schema:
            type: string
          style: form
        - explode: true
          in: query
          name: before
          required: false
          schema:
            type: string
          style: form
        - description: Number of items to return. Maximum limit is 100.
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: Sort files by a given field.
          explode: true
          in: query
          name: sort
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - description: Search files by given ID.
          explode: true
          in: query
          name: id
          required: false
          schema:
            type: string
          style: form
        - description: Search files by time of creation.
          explode: true
          in: query
          name: createdAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: createdAtLte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: createdAtGte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Search files by time of latest updated.
          explode: true
          in: query
          name: updatedAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: updatedAtLte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: updatedAtGte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Search for files containing the given name.
          explode: true
          in: query
          name: name
          required: false
          schema:
            type: string
          style: form
        - description: Search files by path.
          explode: true
          in: query
          name: path
          required: false
          schema:
            type: string
          style: form
        - description: Search files within given folderId.
          explode: true
          in: query
          name: parentFolderId
          required: false
          schema:
            format: int64
            type: integer
          style: form
        - description: Query by file size.
          explode: true
          in: query
          name: size
          required: false
          schema:
            format: int64
            type: integer
          style: form
        - description: Search files by height of image or video.
          explode: true
          in: query
          name: height
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: Search files by width of image or video.
          explode: true
          in: query
          name: width
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: Search files with specified encoding.
          explode: true
          in: query
          name: encoding
          required: false
          schema:
            type: string
          style: form
        - description: Filter by provided file type.
          explode: true
          in: query
          name: type
          required: false
          schema:
            type: string
          style: form
        - description: Search files by given extension.
          explode: true
          in: query
          name: extension
          required: false
          schema:
            type: string
          style: form
        - description: Search for given URL
          explode: true
          in: query
          name: url
          required: false
          schema:
            type: string
          style: form
        - description: If true shows files that have been marked to be used in new content. It false shows files that should not be used in new content.
          explode: true
          in: query
          name: isUsableInContent
          required: false
          schema:
            type: boolean
          style: form
        - description: If 'true' will show private files; if 'false' will show public files
          explode: true
          in: query
          name: allowsAnonymousAccess
          required: false
          schema:
            type: boolean
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionResponseFile"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Search files
      tags:
        - Files
  /files/v3/files/stat/{path}:
    get:
      operationId: get-/files/v3/files/stat/{path}_getMetadata
      parameters:
        - explode: false
          in: path
          name: path
          required: true
          schema:
            pattern: .+
            type: string
          style: simple
        - explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileStat"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      tags:
        - Files
  /files/v3/files/{fileId}:
    delete:
      description: Delete file by ID
      operationId: delete-/files/v3/files/{fileId}_archive
      parameters:
        - description: FileId to delete
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Delete file
      tags:
        - Files
    get:
      description: Get file by ID.
      operationId: get-/files/v3/files/{fileId}_getById
      parameters:
        - description: ID of the desired file.
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
        - explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Get file.
      tags:
        - Files
    patch:
      description: Update properties of file by ID.
      operationId: patch-/files/v3/files/{fileId}_updateProperties
      parameters:
        - description: ID of file to update
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FileUpdateInput"
        description: Options to update.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: update file properties
      tags:
        - Files
    put:
      description: Replace existing file data with new file data. Can be used to change image content without having to upload a new file and update all references.
      operationId: put-/files/v3/files/{fileId}_replace
      parameters:
        - description: ID of the desired file.
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                charsetHunch:
                  description: Character set of given file data.
                  type: string
                file:
                  description: File data that will replace existing file in the file manager.
                  format: binary
                  type: string
                options:
                  description: JSON String representing FileReplaceOptions
                  type: string
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Replace file.
      tags:
        - Files
  /files/v3/files/{fileId}/gdpr-delete:
    delete:
      description: GDRP delete file
      operationId: delete-/files/v3/files/{fileId}/gdpr-delete_archiveGDPR
      parameters:
        - description: ID of file to GDPR delete
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: GDPR delete
      tags:
        - Files
  /files/v3/files/{fileId}/signed-url:
    get:
      description: Generates signed URL that allows temporary access to a private file.
      operationId: get-/files/v3/files/{fileId}/signed-url_getSignedUrl
      parameters:
        - description: ID of file.
          explode: false
          in: path
          name: fileId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
        - description: For image files. This will resize the image to the desired size before sharing. Does not affect the original file, just the file served by this signed URL.
          explode: true
          in: query
          name: size
          required: false
          schema:
            enum:
              - thumb
              - icon
              - medium
              - preview
            type: string
          style: form
        - description: How long in seconds the link will provide access to the file.
          explode: true
          in: query
          name: expirationSeconds
          required: false
          schema:
            format: int64
            type: integer
          style: form
        - description: If size is provided, this will upscale the image to fit the size dimensions.
          explode: true
          in: query
          name: upscale
          required: false
          schema:
            type: boolean
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SignedUrl"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Get signed URL to access private file.
      tags:
        - Files
  /files/v3/folders:
    post:
      description: Creates a folder.
      operationId: post-/files/v3/folders_create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FolderInput"
        description: Folder creation options
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Folder"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Create folder.
      tags:
        - Folders
  /files/v3/folders/search:
    get:
      description: Search for folders. Does not contain hidden or archived folders.
      operationId: get-/files/v3/folders/search_doSearch
      parameters:
        - description: Properties that should be included in the returned folders.
          explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - description: The maximum offset of items for a given search is 10000. Narrow your search down if you are reaching this limit.
          explode: true
          in: query
          name: after
          required: false
          schema:
            type: string
          style: form
        - explode: true
          in: query
          name: before
          required: false
          schema:
            type: string
          style: form
        - description: Limit of results to return. Max limit is 100.
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: Sort results by given property. For example -name sorts by name field descending, name sorts by name field ascending.
          explode: true
          in: query
          name: sort
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - description: Search folder by given ID.
          explode: true
          in: query
          name: id
          required: false
          schema:
            type: string
          style: form
        - description: Search for folders with the given creation timestamp.
          explode: true
          in: query
          name: createdAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: createdAtLte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: createdAtGte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Search for folder at given update timestamp.
          explode: true
          in: query
          name: updatedAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: updatedAtLte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: updatedAtGte
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Search for folders containing the specified name.
          explode: true
          in: query
          name: name
          required: false
          schema:
            type: string
          style: form
        - description: Search for folders by path.
          explode: true
          in: query
          name: path
          required: false
          schema:
            type: string
          style: form
        - description: Search for folders with the given parent folderId.
          explode: true
          in: query
          name: parentFolderId
          required: false
          schema:
            format: int64
            type: integer
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionResponseFolder"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Search folders
      tags:
        - Folders
  /files/v3/folders/update/async:
    post:
      description: Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well.
      operationId: post-/files/v3/folders/update/async_updateProperties
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FolderUpdateInput"
        description: Properties to change in the folder
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FolderUpdateTaskLocator"
          description: accepted
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Update folder properties
      tags:
        - Folders
  /files/v3/folders/update/async/tasks/{taskId}/status:
    get:
      description: Check status of folder update. Folder updates happen asynchronously.
      operationId: get-/files/v3/folders/update/async/tasks/{taskId}/status_checkUpdateStatus
      parameters:
        - description: TaskId of folder update
          explode: false
          in: path
          name: taskId
          required: true
          schema:
            type: string
          style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FolderActionResponse"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Check folder update status.
      tags:
        - Folders
  /files/v3/folders/{folderId}:
    delete:
      description: Delete folder by ID.
      operationId: delete-/files/v3/folders/{folderId}_archive
      parameters:
        - description: ID of folder to delete.
          explode: false
          in: path
          name: folderId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Delete folder.
      tags:
        - Folders
    get:
      description: Get folder by ID
      operationId: get-/files/v3/folders/{folderId}_getById
      parameters:
        - description: ID of desired folder
          explode: false
          in: path
          name: folderId
          required: true
          schema:
            pattern: \d+
            type: string
          style: simple
        - description: Properties to set on returned folder.
          explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Folder"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Get folder
      tags:
        - Folders
  /files/v3/folders/{folderPath}:
    delete:
      description: Delete folder by path.
      operationId: delete-/files/v3/folders/{folderPath}_archiveByPath
      parameters:
        - description: Path of folder to delete
          explode: false
          in: path
          name: folderPath
          required: true
          schema:
            pattern: .+
            type: string
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Delete folder.
      tags:
        - Folders
    get:
      description: Get folder by path.
      operationId: get-/files/v3/folders/{folderPath}_getByPath
      parameters:
        - description: Path of desired folder.
          explode: false
          in: path
          name: folderPath
          required: true
          schema:
            pattern: .+
            type: string
          style: simple
        - description: Properties to set on returned folder.
          explode: true
          in: query
          name: properties
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Folder"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2_legacy:
            - files.ui_hidden.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Get folder.
      tags:
        - Folders
components:
  responses:
    Error:
      content:
        "*/*":
          schema:
            $ref: "#/components/schemas/Error"
      description: An error occurred.
  schemas:
    CollectionResponseFile:
      description: Collections of files
      properties:
        paging:
          $ref: "#/components/schemas/Paging"
        results:
          description: ""
          items:
            $ref: "#/components/schemas/File"
          type: array
      required:
        - results
      type: object
    CollectionResponseFolder:
      properties:
        paging:
          $ref: "#/components/schemas/Paging"
        results:
          description: ""
          items:
            $ref: "#/components/schemas/Folder"
          type: array
      required:
        - results
      type: object
    Error:
      example:
        category: VALIDATION_ERROR
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
        message: Invalid input (details will vary based on the error)
      properties:
        category:
          description: The error category
          example: VALIDATION_ERROR
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            invalidPropertyName:
              - propertyValue
            missingScopes:
              - scope1
              - scope2
          type: object
        correlationId:
          description: A unique identifier for the request. Include this value with any error reports or support tickets
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
          format: uuid
          type: string
        errors:
          description: further information about the error
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        links:
          additionalProperties:
            type: string
          description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps
          example:
            knowledge-base: https://www.hubspot.com/products/service/knowledge-base
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: Invalid input (details will vary based on the error)
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: The status code associated with the error detail
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            missingScopes:
              - scope1
              - scope2
          type: object
        in:
          description: The name of the field or parameter in which the error was found.
          type: string
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - message
      type: object
    File:
      description: File
      properties:
        access:
          description: File access. Can be PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE.
          enum:
            - PUBLIC_INDEXABLE
            - PUBLIC_NOT_INDEXABLE
            - HIDDEN_INDEXABLE
            - HIDDEN_NOT_INDEXABLE
            - HIDDEN_PRIVATE
            - PRIVATE
          type: string
        archived:
          description: If the file is deleted.
          type: boolean
        archivedAt:
          description: Deletion time of the file object.
          format: date-time
          type: string
        createdAt:
          description: Creation time of the file object.
          format: date-time
          type: string
        defaultHostingUrl:
          description: Default hosting URL of the file. This will use one of HubSpot's provided URLs to serve the file.
          type: string
        encoding:
          description: Encoding of the file.
          type: string
        expiresAt:
          format: int64
          type: integer
        extension:
          description: "Extension of the file. ex: .jpg, .png, .gif, .pdf, etc."
          type: string
        height:
          description: For image and video files, the height of the content.
          format: int32
          type: integer
        id:
          description: File ID.
          type: string
        isUsableInContent:
          description: Previously "archied". Indicates if the file should be used when creating new content like web pages.
          type: boolean
        name:
          description: Name of the file.
          type: string
        parentFolderId:
          description: ID of the folder the file is in.
          type: string
        path:
          description: Path of the file in the file manager.
          type: string
        size:
          description: Size of the file in bytes.
          format: int64
          type: integer
        type:
          description: Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.
          type: string
        updatedAt:
          description: Timestamp of the latest update to the file.
          format: date-time
          type: string
        url:
          description: URL of the given file. This URL can change depending on the domain settings of the account. Will use the select file hosting domain.
          type: string
        width:
          description: For image and video files, the width of the content.
          format: int32
          type: integer
      required:
        - access
        - archived
        - createdAt
        - id
        - updatedAt
      type: object
    FileActionResponse:
      properties:
        completedAt:
          description: Time of completion of task.
          format: date-time
          type: string
        errors:
          description: Descriptive error messages.
          items:
            $ref: "#/components/schemas/StandardError"
          type: array
        links:
          additionalProperties:
            type: string
          description: Link to check the status of the requested task.
          type: object
        numErrors:
          description: Number of errors resulting from the task.
          format: int32
          type: integer
        requestedAt:
          description: Timestamp of when the task was requested.
          format: date-time
          type: string
        result:
          $ref: "#/components/schemas/File"
        startedAt:
          description: Timestamp of when the task was started.
          format: date-time
          type: string
        status:
          description: Current status of the task.
          enum:
            - PENDING
            - PROCESSING
            - CANCELED
            - COMPLETE
          type: string
        taskId:
          description: ID of the requested task.
          type: string
      required:
        - completedAt
        - startedAt
        - status
        - taskId
      type: object
    FileStat:
      properties:
        file:
          $ref: "#/components/schemas/File"
        folder:
          $ref: "#/components/schemas/Folder"
      type: object
    FileUpdateInput:
      description: Object for updating files.
      properties:
        access:
          description: |
            NONE: Do not run any duplicate validation. REJECT: Reject the upload if a duplicate is found. RETURN_EXISTING: If a duplicate file is found, do not upload a new file and return the found duplicate instead.
          enum:
            - PUBLIC_INDEXABLE
            - PUBLIC_NOT_INDEXABLE
            - HIDDEN_INDEXABLE
            - HIDDEN_NOT_INDEXABLE
            - HIDDEN_PRIVATE
            - PRIVATE
          type: string
        expiresAt:
          format: int64
          type: integer
        isUsableInContent:
          description: Mark whether the file should be used in new content or not.
          type: boolean
        name:
          description: New name for the file.
          type: string
        parentFolderId:
          description: FolderId where the file should be moved to. folderId and folderPath parameters cannot be set at the same time.
          type: string
        parentFolderPath:
          description: Folder path where the file should be moved to. folderId and folderPath parameters cannot be set at the same time.
          type: string
      type: object
    Folder:
      properties:
        archived:
          description: Marks whether the folder is deleted or not.
          type: boolean
        archivedAt:
          description: Timestamp of folder deletion.
          format: date-time
          type: string
        createdAt:
          description: Timestamp of folder creation.
          format: date-time
          type: string
        id:
          description: ID of the folder.
          type: string
        name:
          description: Name of the folder.
          type: string
        parentFolderId:
          description: ID of the parent folder.
          type: string
        path:
          description: Path of the folder in the file manager.
          type: string
        updatedAt:
          description: Timestamp of the latest update to the folder.
          format: date-time
          type: string
      required:
        - archived
        - createdAt
        - id
        - updatedAt
      type: object
    FolderActionResponse:
      properties:
        completedAt:
          description: When the requested changes have been completed.
          format: date-time
          type: string
        errors:
          description: Detailed errors resulting from the task.
          items:
            $ref: "#/components/schemas/StandardError"
          type: array
        links:
          additionalProperties:
            type: string
          description: Link to check the status of the task.
          type: object
        numErrors:
          description: Number of errors resulting from the requested changes.
          format: int32
          type: integer
        requestedAt:
          description: Timestamp representing when the task was requested.
          format: date-time
          type: string
        result:
          $ref: "#/components/schemas/Folder"
        startedAt:
          description: Timestamp representing when the task was started at.
          format: date-time
          type: string
        status:
          description: Current status of the task.
          enum:
            - PENDING
            - PROCESSING
            - CANCELED
            - COMPLETE
          type: string
        taskId:
          description: ID of the task.
          type: string
      required:
        - completedAt
        - startedAt
        - status
        - taskId
      type: object
    FolderInput:
      description: Object for creating a folder.
      properties:
        name:
          description: Desired name for the folder.
          type: string
        parentFolderId:
          description: FolderId of the parent of the created folder. If not specified, the folder will be created at the root level. parentFolderId and parentFolderPath cannot be set at the same time.
          type: string
        parentPath:
          description: Path of the parent of the created folder. If not specified the folder will be created at the root level. parentFolderPath and parentFolderId cannot be set at the same time.
          type: string
      required:
        - name
      type: object
    FolderUpdateInput:
      description: Object for updating folders.
      properties:
        id:
          description: ID of the folder to change.
          type: string
        name:
          description: New name. If specified the folder's name and fullPath will change. All children of the folder will be updated accordingly.
          type: string
        parentFolderId:
          description: New parent folderId. If changed, the folder and all it's children will be moved into the specified folder. parentFolderId and parentFolderPath cannot be specified at the same time.
          format: int64
          type: integer
      required:
        - id
      type: object
    FolderUpdateTaskLocator:
      description: Information on the task that has been started, and where to check it's status.
      example:
        id: 57122e26-59f8-4cfc-ba53-96e30c816762
        links:
          - status: https://api.hubspot.com/files/v3/folders/update/async/tasks/57122e26-59f8-4cfc-ba53-96e30c816762/status
      properties:
        id:
          description: ID of the task
          example: 57122e26-59f8-4cfc-ba53-96e30c816762
          type: string
        links:
          additionalProperties:
            type: string
          description: Links for where to check information related to the task. The `status` link gives the URL for where to check the status of the task.
          example:
            - status: https://api.hubspot.com/files/v3/folders/update/async/tasks/57122e26-59f8-4cfc-ba53-96e30c816762/status
          type: object
      required:
        - id
        - links
      type: object
    ImportFromUrlInput:
      properties:
        access:
          description: |
            PUBLIC_INDEXABLE: File is publicly accessible by anyone who has the URL. Search engines can index the file. PUBLIC_NOT_INDEXABLE: File is publicly accessible by anyone who has the URL. Search engines *can't* index the file. PRIVATE: File is NOT publicly accessible. Requires a signed URL to see content. Search engines *can't* index the file.
          enum:
            - PUBLIC_INDEXABLE
            - PUBLIC_NOT_INDEXABLE
            - HIDDEN_INDEXABLE
            - HIDDEN_NOT_INDEXABLE
            - HIDDEN_PRIVATE
            - PRIVATE
          type: string
        duplicateValidationScope:
          description: |
            ENTIRE_PORTAL: Look for a duplicate file in the entire account. EXACT_FOLDER: Look for a duplicate file in the provided folder.
          enum:
            - ENTIRE_PORTAL
            - EXACT_FOLDER
          type: string
        duplicateValidationStrategy:
          description: |
            NONE: Do not run any duplicate validation. REJECT: Reject the upload if a duplicate is found. RETURN_EXISTING: If a duplicate file is found, do not upload a new file and return the found duplicate instead.
          enum:
            - NONE
            - REJECT
            - RETURN_EXISTING
          type: string
        folderId:
          description: One of folderId or folderPath is required. Destination folderId for the uploaded file.
          type: string
        folderPath:
          description: One of folderPath or folderId is required. Destination folder path for the uploaded file. If the folder path does not exist, there will be an attempt to create the folder path.
          type: string
        name:
          description: Name to give the resulting file in the file manager.
          type: string
        overwrite:
          description: If true, will overwrite existing file if one with the same name and extension exists in the given folder. The overwritten file will be deleted and the uploaded file will take its place with a new ID. If unset or set as false, the new file's name will be updated to prevent colliding with existing file if one exists with the same path, name, and extension
          type: boolean
        ttl:
          description: Time to live. If specified the file will be deleted after the given time frame. If left unset, the file will exist indefinitely
          type: string
        url:
          description: URL to download the new file from.
          type: string
      required:
        - access
        - url
      type: object
    ImportFromUrlTaskLocator:
      description: Information on the task that has been started, and where to check it's status.
      example:
        id: 57122e26-59f8-4cfc-ba53-96e30c816762
        links:
          - status: https://api.hubspot.com/files/v3/files/import-from-url/async/tasks/57122e26-59f8-4cfc-ba53-96e30c816762/status
      properties:
        id:
          description: ID of the task
          example: 57122e26-59f8-4cfc-ba53-96e30c816762
          type: string
        links:
          additionalProperties:
            type: string
          description: Links for where to check information related to the task. The `status` link gives the URL for where to check the status of the task.
          example:
            - status: https://api.hubspot.com/files/v3/files/import-from-url/async/tasks/57122e26-59f8-4cfc-ba53-96e30c816762/status
          type: object
      required:
        - id
        - links
      type: object
    NextPage:
      properties:
        after:
          type: string
        link:
          type: string
      required:
        - after
      type: object
    Paging:
      properties:
        next:
          $ref: "#/components/schemas/NextPage"
        prev:
          $ref: "#/components/schemas/PreviousPage"
      type: object
    PreviousPage:
      properties:
        before:
          type: string
        link:
          type: string
      required:
        - before
      type: object
    SignedUrl:
      description: Signed Url object with optional ancillary metadata of requested file
      properties:
        expiresAt:
          description: Timestamp of when the URL will no longer grant access to the file.
          format: date-time
          type: string
        extension:
          description: Extension of the requested file.
          type: string
        height:
          description: For image and video files. The height of the file.
          format: int32
          type: integer
        name:
          description: Name of the requested file.
          type: string
        size:
          description: Size in bytes of the requested file.
          format: int32
          type: integer
        type:
          description: Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.
          type: string
        url:
          description: Signed URL with access to the specified file. Anyone with this URL will be able to access the file until it expires.
          type: string
        width:
          description: For image and video files. The width of the file.
          format: int32
          type: integer
      required:
        - expiresAt
        - extension
        - name
        - size
        - type
        - url
      type: object
    StandardError:
      properties:
        category:
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
        errors:
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        id:
          type: string
        links:
          additionalProperties:
            type: string
          type: object
        message:
          type: string
        status:
          type: string
        subCategory:
          properties: {}
          type: object
      required:
        - category
        - context
        - errors
        - links
        - message
        - status
      type: object
  securitySchemes:
    oauth2_legacy:
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          scopes:
            files: Read from and write to my Files
            files.ui_hidden.read: View hidden files
          tokenUrl: https://api.hubapi.com/oauth/v1/token
      type: oauth2
    private_apps_legacy:
      in: header
      name: private-app-legacy
      type: apiKey
x-hubspot-available-client-libraries:
  - PHP
  - Node
  - Ruby
  - Python
x-hubspot-documentation-banner: NONE
x-hubspot-product-tier-requirements:
  cms: STARTER
  marketing: FREE
  sales: FREE
  service: FREE
