Files

Files are documents of any kind (images, spreadsheets, text files, etc.) that are uploaded to Pipedrive, and usually associated with a particular deal, person, organization, product, note or activity. Remote files can only be associated with a particular deal, person or organization. Note that the API currently does not support downloading files although it lets you retrieve a file’s meta-info along with a URL which can be used to download the file by using a standard HTTP GET request.

Get all files

Copy link
Copy to clipboard
GET

/v1/files

Returns data about all files.

Query parameters

start

integer

Pagination start

Default

0

limit

integer

Items shown per page

include_deleted_files

number

When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.

Values

0

1

sort

string

The field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment.

Response
200

OK

Expand all
Copy code
    • true
    • [ ... ]
      • { ... }

      Get one file

      Copy link
      Copy to clipboard
      GET

      /v1/files/{id}

      Returns data about a specific file.

      Path parameters

      id

      integer

      required

      The ID of the file

      Response
      200

      OK

      Expand all
      Copy code
        • true
        • { ... }

        Download one file

        Copy link
        Copy to clipboard
        GET

        /v1/files/{id}/download

        Initializes a file download.

        Path parameters

        id

        integer

        required

        The ID of the file

        Response
        200

        OK

        Add file

        Copy link
        Copy to clipboard
        POST

        /v1/files

        Lets you upload a file and associate it with a deal, person, organization, activity or product. For more information, see the tutorial for adding a file.

        Body parameters

        multipart/form-data

        file

        string

        required

        A single file, supplied in the multipart/form-data encoding and contained within the given boundaries

        Format

        binary

        deal_id

        integer

        The ID of the deal to associate file(s) with

        person_id

        integer

        The ID of the person to associate file(s) with

        org_id

        integer

        The ID of the organization to associate file(s) with

        product_id

        integer

        The ID of the product to associate file(s) with

        activity_id

        integer

        The ID of the activity to associate file(s) with

        Response
        200

        OK

        Expand all
        Copy code
          • true
          • { ... }

          Create a remote file and link it to an item

          Copy link
          Copy to clipboard
          POST

          /v1/files/remote

          Creates a new empty file in the remote location (googledrive) that will be linked to the item you supply. For more information, see the tutorial for adding a remote file.

          Body parameters

          application/x-www-form-urlencoded

          file_type

          string

          required

          The file type

          Values

          gdoc

          gslides

          gsheet

          gform

          gdraw

          title

          string

          required

          The title of the file

          item_type

          string

          required

          The item type

          Values

          deal

          organization

          person

          item_id

          integer

          required

          The ID of the item to associate the file with

          remote_location

          string

          required

          The location type to send the file to. Only googledrive is supported at the moment.

          Values

          googledrive

          Response
          200

          OK

          Expand all
          Copy code
            • true
            • { ... }

            Link a remote file to an item

            Copy link
            Copy to clipboard
            POST

            /v1/files/remoteLink

            Links an existing remote file (googledrive) to the item you supply. For more information, see the tutorial for adding a remote file.

            Body parameters

            application/x-www-form-urlencoded

            item_type

            string

            required

            The item type

            Values

            deal

            organization

            person

            item_id

            integer

            required

            The ID of the item to associate the file with

            remote_id

            string

            required

            The remote item ID

            remote_location

            string

            required

            The location type to send the file to. Only googledrive is supported at the moment.

            Values

            googledrive

            Response
            200

            OK

            Expand all
            Copy code
              • true
              • { ... }

              Update file details

              Copy link
              Copy to clipboard
              PUT

              /v1/files/{id}

              Updates the properties of a file.

              Path parameters

              id

              integer

              required

              The ID of the file

              Body parameters

              application/x-www-form-urlencoded

              name

              string

              The visible name of the file

              description

              string

              The description of the file

              Response
              200

              OK

              Expand all
              Copy code
                • true
                • { ... }

                Delete a file

                Copy link
                Copy to clipboard
                DELETE

                /v1/files/{id}

                Marks a file as deleted.

                Path parameters

                id

                integer

                required

                The ID of the file

                Response
                200

                OK

                Expand all
                Copy code
                  • true
                  • { ... }

                  Subscribe to Pipedrive’s Developer Newsletter