openapi: 3.0.1
servers:
  - url: https://api.hubapi.com/
x-hasEquivalentPaths: true
info:
  description: Upload and manage files.
  title: Files
  version: v3
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/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:
  - description: Operations to upload and edit files.
    name: Files
  - description: Operations to create and edit folders.
    name: Folders
paths:
  /files/v3/files:
    post:
      description: Upload a single file with content specified in request body.
      operationId: post-/files/v3/files_upload
      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
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - hapikey: []
        - 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
      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:
        - hapikey: []
        - 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
        - hapikey: []
        - 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 folder ID.
          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
        - hapikey: []
        - private_apps_legacy: []
        - oauth2_legacy:
            - files
      summary: Search files
      tags:
        - Files
  "/files/v3/files/{fileId}":
    delete:
      description: Delete file by ID
      operationId: delete-/files/v3/files/{fileId}_archive
      parameters:
        - description: File ID 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:
        - hapikey: []
        - 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
        - hapikey: []
        - 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:
        - hapikey: []
        - 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
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - hapikey: []
        - 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:
        - hapikey: []
        - 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
        - hapikey: []
        - 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
      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:
        - hapikey: []
        - 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 folder ID.
          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
        - hapikey: []
        - 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
      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:
        - hapikey: []
        - 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: Task ID 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:
        - hapikey: []
        - 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:
        - hapikey: []
        - 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
        - hapikey: []
        - 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:
        - hapikey: []
        - 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
        - hapikey: []
        - 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:
          items:
            $ref: "#/components/schemas/File"
          type: array
      required:
        - results
      type: object
    CollectionResponseFolder:
      properties:
        paging:
          $ref: "#/components/schemas/Paging"
        results:
          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
          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
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: An error occurred
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorCategory:
      properties:
        httpStatus:
          enum:
            - CONTINUE
            - SWITCHING_PROTOCOLS
            - PROCESSING
            - OK
            - CREATED
            - ACCEPTED
            - NON_AUTHORITATIVE_INFORMATION
            - NO_CONTENT
            - RESET_CONTENT
            - PARTIAL_CONTENT
            - MULTI_STATUS
            - ALREADY_REPORTED
            - IM_USED
            - MULTIPLE_CHOICES
            - MOVED_PERMANENTLY
            - FOUND
            - SEE_OTHER
            - NOT_MODIFIED
            - USE_PROXY
            - TEMPORARY_REDIRECT
            - PERMANENT_REDIRECT
            - BAD_REQUEST
            - UNAUTHORIZED
            - PAYMENT_REQUIRED
            - FORBIDDEN
            - NOT_FOUND
            - METHOD_NOT_ALLOWED
            - NOT_ACCEPTABLE
            - PROXY_AUTHENTICATION_REQUIRED
            - REQUEST_TIMEOUT
            - CONFLICT
            - GONE
            - LENGTH_REQUIRED
            - PRECONDITION_FAILED
            - REQUEST_ENTITY_TOO_LARGE
            - REQUEST_URI_TOO_LONG
            - UNSUPPORTED_MEDIA_TYPE
            - REQUESTED_RANGE_NOT_SATISFIABLE
            - EXPECTATION_FAILED
            - IM_A_TEAPOT
            - MISDIRECTED_REQUEST
            - UNPROCESSABLE_ENTITY
            - LOCKED
            - FAILED_DEPENDENCY
            - UPGRADE_REQUIRED
            - PRECONDITION_REQUIRED
            - TOO_MANY_REQUESTS
            - REQUEST_HEADERS_FIELDS_TOO_LARGE
            - INTERNAL_STALE_SERVICE_DISCOVERY
            - UNAVAILABLE_FOR_LEGAL_REASONS
            - INTERNAL_SERVER_ERROR
            - NOT_IMPLEMENTED
            - BAD_GATEWAY
            - SERVICE_UNAVAILABLE
            - GATEWAY_TIMEOUT
            - HTTP_VERSION_NOT_SUPPORTED
            - VARIANT_ALSO_NEGOTIATES
            - INSUFFICIENT_STORAGE
            - LOOP_DETECTED
            - NOT_EXTENDED
            - NETWORK_AUTHENTICATION_REQUIRED
          type: string
        name:
          type: string
      required:
        - httpStatus
        - name
      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
        extension:
          description: Extension of the file. For example png.
          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 in bytes of the file.
          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: If of the requested task.
          type: string
      required:
        - completedAt
        - startedAt
        - status
        - taskId
      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
        isUsableInContent:
          description: Mark weather the file should be used in new content or not.
          type: boolean
        name:
          description: New name for the file.
          type: string
        parentFolderId:
          description: Folder ID where the file should be moved to.  folderId and folderPath cannot be set at the same time.
          type: string
        parentFolderPath:
          description: Folder path where the file should be moved to. folderId and folderPath cannot be set at the same time.
          type: string
      type: object
    Folder:
      properties:
        archived:
          description: Marks weather 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: Folder ID 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 folder ID. 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: The ID of the task
          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.
          type: object
      required:
        - id
      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 folder ID 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, it will overwrite existing files if a file with the same name exists in the given folder.
          type: boolean
        ttl:
          description: Time to live. If specified the file will be deleted after the given time frame.
          type: string
        url:
          description: URL to download the new file from.
          type: string
      required:
        - access
        - duplicateValidationScope
        - duplicateValidationStrategy
        - overwrite
        - 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: The ID of the task
          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.
          type: object
      required:
        - id
      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:
      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:
          $ref: "#/components/schemas/ErrorCategory"
        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:
    hapikey:
      in: query
      name: hapikey
      type: apiKey
    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
  - Python
  - Ruby
