> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-pb-update-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getFile

> Get file



## OpenAPI

````yaml /files-openapi.json get /v1/files/{id}
openapi: 3.0.0
info:
  title: Botpress Files API
  description: API for Botpress Files
  version: 1.112.0
servers:
  - url: https://api.botpress.cloud
security:
  - BearerAuth: []
tags:
  - name: documented
paths:
  /v1/files/{id}:
    get:
      tags:
        - Endpoints
      description: Get file
      operationId: getFile
      parameters:
        - name: id
          in: path
          description: File ID or Key
          required: true
          schema:
            type: string
        - name: x-bot-id
          in: header
          description: Bot id
          required: true
          schema:
            type: string
        - name: x-integration-id
          in: header
          description: Integration id
          required: false
          schema:
            type: string
        - name: x-integration-alias
          in: header
          description: Integration alias
          required: false
          schema:
            type: string
        - name: x-integration-name
          in: header
          description: Integration name
          required: false
          schema:
            type: string
        - name: x-user-id
          in: header
          description: User Id
          required: false
          schema:
            type: string
        - name: x-user-role
          in: header
          description: User Role
          required: false
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/getFileResponse'
        default:
          $ref: '#/components/responses/getFileResponse'
components:
  responses:
    getFileResponse:
      description: An object containing the file metadata and URL
      content:
        application/json:
          schema:
            type: object
            properties:
              file:
                type: object
                properties:
                  id:
                    type: string
                    description: File ID
                  botId:
                    type: string
                    description: The ID of the bot the file belongs to
                  key:
                    type: string
                    description: >-
                      Unique key for the file. Must be unique across the bot
                      (and the integration, when applicable).
                  url:
                    type: string
                    description: >-
                      URL to retrieve the file content. This URL will be ready
                      to use once the file is uploaded.


                      If the file has a `public_content` policy, this will
                      contain the permanent public URL to retrieve the file,
                      otherwise this will contain a temporary pre-signed URL to
                      download the file which should be used shortly after
                      retrieving and should not be stored long-term as the URL
                      will expire after a short timeframe.
                  size:
                    type: number
                    description: >-
                      File size in bytes. Non-null if file upload status is
                      "COMPLETE".
                    nullable: true
                  contentType:
                    type: string
                    description: MIME type of the file's content
                  tags:
                    type: object
                    additionalProperties:
                      type: string
                      maxLength: 1000
                    description: The tags of the file as an object of key/value pairs
                  metadata:
                    type: object
                    additionalProperties:
                      nullable: true
                    description: >-
                      Metadata of the file as an object of key/value pairs. The
                      values can be of any type.
                  createdAt:
                    type: string
                    description: File creation timestamp in ISO 8601 format
                  updatedAt:
                    type: string
                    description: File last update timestamp in ISO 8601 format
                  accessPolicies:
                    type: array
                    items:
                      type: string
                      enum:
                        - integrations
                        - public_content
                    description: Access policies configured for the file.
                  index:
                    type: boolean
                    description: >-
                      Whether the file was requested to be indexed for search or
                      not.
                  status:
                    type: string
                    enum:
                      - upload_pending
                      - upload_failed
                      - upload_completed
                      - indexing_pending
                      - indexing_failed
                      - indexing_completed
                    description: >-
                      Status of the file. If the status is `upload_pending`, the
                      file content has not been uploaded yet. The status will be
                      set to `upload_completed` once the file content has been
                      uploaded successfully.


                      If the upload failed for any reason (e.g. exceeding the
                      storage quota or the maximum file size limit) the status
                      will be set to `upload_failed` and the reason for the
                      failure will be available in the `failedStatusReason`
                      field of the file.


                      However, if the file has been uploaded and the `index`
                      attribute was set to `true` on the file, the status will
                      immediately transition to the `indexing_pending` status
                      (the `upload_completed` status step will be skipped).


                      Once the indexing is completed and the file is ready to be
                      used for searching its status will be set to
                      `indexing_completed`. If the indexing failed the status
                      will be set to `indexing_failed` and the reason for the
                      failure will be available in the `failedStatusReason`
                      field.
                  failedStatusReason:
                    type: string
                    description: >-
                      If the file status is `upload_failed` or `indexing_failed`
                      this will contain the reason of the failure.
                  expiresAt:
                    type: string
                    description: File expiry timestamp in ISO 8601 format
                  owner:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - bot
                          - integration
                          - user
                      id:
                        type: string
                        description: >-
                          This field is present if `type` is "user" or "bot". If
                          `type` is "user", this is the user ID. If `type` is
                          "bot", this is the bot ID.
                      name:
                        type: string
                        description: >-
                          This field is present if the `type` is "integration".
                          If `type` is "integration", this is the integration
                          name.
                      alias:
                        type: string
                        description: >-
                          This field is present if the `type` is "integration".
                          If `type` is "integration", this is the integration
                          instance alias.
                    required:
                      - type
                    additionalProperties: false
                  indexingStack:
                    type: string
                    enum:
                      - v1
                      - v2
                    description: >-
                      Indicates the indexing stack used to index this file.
                      Present only when file has been successfully indexed. A
                      value of "v2" denotes the latest stack, "v1" denotes the
                      legacy stack.
                required:
                  - id
                  - botId
                  - key
                  - url
                  - size
                  - contentType
                  - tags
                  - metadata
                  - createdAt
                  - updatedAt
                  - accessPolicies
                  - index
                  - status
                  - owner
                additionalProperties: false
            required:
              - file
            title: getFileResponse
            additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````