Pipedrive Files API

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.

Documentation

📖
Documentation
https://developers.pipedrive.com/
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Deals
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Leads
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Persons
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Organizations
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Activities
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Pipelines
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Stages
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Products
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Notes
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Files
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Mailbox
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/CallLogs
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Users
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Roles
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Filters
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Goals
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Subscriptions
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Projects
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/DealFields
📖
APIReference
https://developers.pipedrive.com/docs/api/v1/Webhooks
📖
Documentation
https://pipedrive.readme.io/docs/guide-for-webhooks-v2
📖
Documentation
https://developers.pipedrive.com/docs/api/v1/oauth2

Specifications

Other Resources

OpenAPI Specification

pipedrive-files-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Pipedrive API v1 Activities Files API
  version: 1.0.0
  description: 'Activities are appointments/tasks/events on a calendar that can be associated with a deal, a lead, a person and an organization. Activities can be of different type (such as call, meeting, lunch or a custom type - see ActivityTypes object) and can be assigned to a particular user. Note that activities can also be created without a specific date/time.

    '
servers:
- url: https://api.pipedrive.com/v1
tags:
- name: Files
  description: '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.

    '
paths:
  /files:
    get:
      summary: Get all files
      description: Returns data about all files.
      x-token-cost: 20
      operationId: getFiles
      tags:
      - Files
      security:
      - api_key: []
      - oauth2:
        - deals:read
        - deals:full
        - activities:read
        - activities:full
        - contacts:read
        - contacts:full
      parameters:
      - in: query
        name: start
        description: Pagination start
        schema:
          type: integer
          default: 0
      - in: query
        name: limit
        description: Items shown per page. Please note that a maximum value of 100 is allowed.
        schema:
          type: integer
          maximum: 100
      - in: query
        name: sort
        schema:
          type: string
        description: 'Supported fields: `id`, `update_time`'
      responses:
        '200':
          description: Get data about all files uploaded to Pipedrive
          content:
            application/json:
              schema:
                title: GetFilesResponse
                type: object
                properties:
                  success:
                    type: boolean
                    description: If the request was successful or not
                  data:
                    type: array
                    items:
                      type: object
                      description: The file data
                      properties:
                        id:
                          type: integer
                          description: The ID of the file
                        user_id:
                          type: integer
                          description: The ID of the user to associate the file with
                        deal_id:
                          type: integer
                          description: The ID of the deal to associate the file with
                        person_id:
                          type: integer
                          description: The ID of the person to associate the file with
                        org_id:
                          type: integer
                          description: The ID of the organization to associate the file with
                        product_id:
                          type: integer
                          description: The ID of the product to associate the file with
                        activity_id:
                          type: integer
                          description: The ID of the activity to associate the file with
                        lead_id:
                          type: string
                          description: The ID of the lead to associate the file with
                          format: uuid
                        add_time:
                          type: string
                          description: 'The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS'
                        update_time:
                          type: string
                          description: 'The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS'
                        file_name:
                          type: string
                          description: The original name of the file
                        file_size:
                          type: integer
                          description: The size of the file
                        active_flag:
                          type: boolean
                          description: Whether the user is active or not. false = Not activated, true = Activated
                        inline_flag:
                          type: boolean
                          description: Whether the file was uploaded as inline or not
                        remote_location:
                          type: string
                          description: The location type to send the file to. Only googledrive is supported at the moment.
                        remote_id:
                          type: string
                          description: The ID of the remote item
                        cid:
                          type: string
                          description: The ID of the inline attachment
                        s3_bucket:
                          type: string
                          description: The location of the cloud storage
                        mail_message_id:
                          type: string
                          description: The ID of the mail message to associate the file with
                        mail_template_id:
                          type: string
                          description: The ID of the mail template to associate the file with
                        deal_name:
                          type: string
                          description: The name of the deal associated with the file
                        person_name:
                          type: string
                          description: The name of the person associated with the file
                        org_name:
                          type: string
                          description: The name of the organization associated with the file
                        product_name:
                          type: string
                          description: The name of the product associated with the file
                        lead_name:
                          type: string
                          description: The name of the lead associated with the file
                        url:
                          type: string
                          description: The URL of the download file
                        name:
                          type: string
                          description: The visible name of the file
                        description:
                          type: string
                          description: The description of the file
                    description: The array of all uploaded files
                  additional_data:
                    type: object
                    properties:
                      pagination:
                        title: paginationDetails
                        description: Pagination details of the list
                        type: object
                        allOf:
                        - description: The additional data of the list
                          type: object
                          properties:
                            start:
                              type: integer
                              description: Pagination start
                            limit:
                              type: integer
                              description: Items shown per page
                            more_items_in_collection:
                              type: boolean
                              description: If there are more list items in the collection than displayed or not
                        - type: object
                          properties:
                            next_start:
                              type: integer
                              description: Next pagination start
              example:
                success: true
                data:
                - id: 123
                  user_id: 456
                  deal_id: 1
                  person_id: 789
                  org_id: 1
                  product_id: 1
                  activity_id: 1
                  lead_id: adf21080-0e10-11eb-879b-05d71fb426ec
                  log_id: null
                  add_time: '2020-02-20 14:36:35'
                  update_time: '2020-02-20 14:57:33'
                  file_name: IMG_8189_52233498214699de9579e7b304a81b157b2eb2137e8062.jpg
                  file_type: img
                  file_size: 7801780
                  active_flag: true
                  inline_flag: false
                  remote_location: googledocs
                  remote_id: 1mT6jshiv6537IirwOExXJuG1jdR4F0FQ
                  cid: ''
                  s3_bucket: ''
                  mail_message_id: ''
                  mail_template_id: ''
                  deal_name: ''
                  person_name: Person
                  lead_name: Test lead name
                  org_name: ''
                  product_name: ''
                  url: https://2a7f.pipedrive.com/v1/files/123/download
                  name: test file name
                  description: test file description
                - id: 123321
                  user_id: 456
                  deal_id: 1
                  person_id: 789987
                  org_id: 1
                  product_id: 1
                  activity_id: 1
                  lead_id: adf21080-0e10-11eb-879b-05d71fb426ec
                  log_id: null
                  add_time: '2020-02-20 14:36:35'
                  update_time: '2020-02-20 14:57:33'
                  file_name: IMG_8189_52233498214699de9579e7b304a81b157b2eb2137e8062.jpg
                  file_type: img
                  file_size: 7801780
                  active_flag: true
                  inline_flag: false
                  remote_location: googledocs
                  remote_id: 1mT6jshiv6537IirwOExXJuG1jdR4F0FQ
                  cid: ''
                  s3_bucket: ''
                  mail_message_id: ''
                  mail_template_id: ''
                  deal_name: ''
                  person_name: Person
                  org_name: ''
                  product_name: ''
                  lead_name: Test lead name
                  url: https://2a7f.pipedrive.com/v1/files/123321/download
                  name: second test file name
                  description: second test file description
                additional_data:
                  pagination:
                    start: 0
                    limit: 100
                    more_items_in_collection: true
                    next_start: 100
    post:
      summary: Add file
      description: Lets you upload a file and associate it with a deal, person, organization, activity, product or lead. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-file" target="_blank" rel="noopener noreferrer">adding a file</a>.
      x-token-cost: 10
      operationId: addFile
      tags:
      - Files
      security:
      - api_key: []
      - oauth2:
        - deals:full
        - activities:full
        - contacts:full
      requestBody:
        content:
          multipart/form-data:
            schema:
              title: addFileRequest
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                  description: A single file, supplied in the multipart/form-data encoding and contained within the given boundaries
                deal_id:
                  type: integer
                  description: The ID of the deal to associate file(s) with
                person_id:
                  type: integer
                  description: The ID of the person to associate file(s) with
                org_id:
                  type: integer
                  description: The ID of the organization to associate file(s) with
                product_id:
                  type: integer
                  description: The ID of the product to associate file(s) with
                activity_id:
                  type: integer
                  description: The ID of the activity to associate file(s) with
                lead_id:
                  type: string
                  format: uuid
                  description: The ID of the lead to associate file(s) with
      responses:
        '200':
          description: Add a file from computer or Google Drive and associate it with deal, person, organization, activity or product
          content:
            application/json:
              schema:
                title: AddFileResponse
                type: object
                properties:
                  success:
                    type: boolean
                    description: If the request was successful or not
                  data:
                    type: object
                    description: The file data
                    properties:
                      id:
                        type: integer
                        description: The ID of the file
                      user_id:
                        type: integer
                        description: The ID of the user to associate the file with
                      deal_id:
                        type: integer
                        description: The ID of the deal to associate the file with
                      person_id:
                        type: integer
                        description: The ID of the person to associate the file with
                      org_id:
                        type: integer
                        description: The ID of the organization to associate the file with
                      product_id:
                        type: integer
                        description: The ID of the product to associate the file with
                      activity_id:
                        type: integer
                        description: The ID of the activity to associate the file with
                      lead_id:
                        type: string
                        description: The ID of the lead to associate the file with
                        format: uuid
                      add_time:
                        type: string
                        description: 'The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS'
                      update_time:
                        type: string
                        description: 'The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS'
                      file_name:
                        type: string
                        description: The original name of the file
                      file_size:
                        type: integer
                        description: The size of the file
                      active_flag:
                        type: boolean
                        description: Whether the user is active or not. false = Not activated, true = Activated
                      inline_flag:
                        type: boolean
                        description: Whether the file was uploaded as inline or not
                      remote_location:
                        type: string
                        description: The location type to send the file to. Only googledrive is supported at the moment.
                      remote_id:
                        type: string
                        description: The ID of the remote item
                      cid:
                        type: string
                        description: The ID of the inline attachment
                      s3_bucket:
                        type: string
                        description: The location of the cloud storage
                      mail_message_id:
                        type: string
                        description: The ID of the mail message to associate the file with
                      mail_template_id:
                        type: string
                        description: The ID of the mail template to associate the file with
                      deal_name:
                        type: string
                        description: The name of the deal associated with the file
                      person_name:
                        type: string
                        description: The name of the person associated with the file
                      org_name:
                        type: string
                        description: The name of the organization associated with the file
                      product_name:
                        type: string
                        description: The name of the product associated with the file
                      lead_name:
                        type: string
                        description: The name of the lead associated with the file
                      url:
                        type: string
                        description: The URL of the download file
                      name:
                        type: string
                        description: The visible name of the file
                      description:
                        type: string
                        description: The description of the file
              example:
                success: true
                data:
                  id: 123
                  user_id: 456
                  deal_id: 1
                  person_id: 789
                  org_id: 1
                  product_id: 1
                  activity_id: 1
                  lead_id: adf21080-0e10-11eb-879b-05d71fb426ec
                  log_id: null
                  add_time: '2020-02-20 14:36:35'
                  update_time: '2020-02-20 14:36:31'
                  file_name: IMG_8189_52233498214699de9579e7b304a81b157b2eb2137e8062.jpg
                  file_type: img
                  file_size: 7801780
                  active_flag: true
                  inline_flag: false
                  remote_location: googledocs
                  remote_id: 1mT6jshiv6537IirwOExXJuG1jdR4F0FQ
                  cid: ''
                  s3_bucket: ''
                  mail_message_id: ''
                  mail_template_id: ''
                  deal_name: ''
                  person_name: Person
                  org_name: ''
                  product_name: ''
                  lead_name: Test lead name
                  url: https://2a7f.pipedrive.com/v1/files/123/download
                  name: IMG_8189.jpg
                  description: ''
  /files/remote:
    post:
      summary: Create a remote file and link it to an item
      description: 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 <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>.
      x-token-cost: 10
      operationId: addFileAndLinkIt
      tags:
      - Files
      security:
      - api_key: []
      - oauth2:
        - deals:full
        - activities:full
        - contacts:full
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              title: addFileAndLinkItRequest
              type: object
              required:
              - file_type
              - title
              - item_type
              - item_id
              - remote_location
              properties:
                file_type:
                  type: string
                  enum:
                  - gdoc
                  - gslides
                  - gsheet
                  - gform
                  - gdraw
                  description: The file type
                title:
                  type: string
                  description: The title of the file
                item_type:
                  type: string
                  enum:
                  - deal
                  - organization
                  - person
                  description: The item type
                item_id:
                  type: integer
                  description: The ID of the item to associate the file with
                remote_location:
                  type: string
                  enum:
                  - googledrive
                  description: The location type to send the file to. Only `googledrive` is supported at the moment.
      responses:
        '200':
          description: Creates a new empty file in the remote location (googledrive) that will be linked to the item you supply - deal, person or organization
          content:
            application/json:
              schema:
                title: AddRemoteFileAndLinkItToItemResponse
                type: object
                properties:
                  success:
                    type: boolean
                    description: If the request was successful or not
                  data:
                    type: object
                    description: The file data
                    properties:
                      id:
                        type: integer
                        description: The ID of the file
                      user_id:
                        type: integer
                        description: The ID of the user to associate the file with
                      deal_id:
                        type: integer
                        description: The ID of the deal to associate the file with
                      person_id:
                        type: integer
                        description: The ID of the person to associate the file with
                      org_id:
                        type: integer
                        description: The ID of the organization to associate the file with
                      product_id:
                        type: integer
                        description: The ID of the product to associate the file with
                      activity_id:
                        type: integer
                        description: The ID of the activity to associate the file with
                      lead_id:
                        type: string
                        description: The ID of the lead to associate the file with
                        format: uuid
                      add_time:
                        type: string
                        description: 'The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS'
                      update_time:
                        type: string
                        description: 'The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS'
                      file_name:
                        type: string
                        description: The original name of the file
                      file_size:
                        type: integer
                        description: The size of the file
                      active_flag:
                        type: boolean
                        description: Whether the user is active or not. false = Not activated, true = Activated
                      inline_flag:
                        type: boolean
                        description: Whether the file was uploaded as inline or not
                      remote_location:
                        type: string
                        description: The location type to send the file to. Only googledrive is supported at the moment.
                      remote_id:
                        type: string
                        description: The ID of the remote item
                      cid:
                        type: string
                        description: The ID of the inline attachment
                      s3_bucket:
                        type: string
                        description: The location of the cloud storage
                      mail_message_id:
                        type: string
                        description: The ID of the mail message to associate the file with
                      mail_template_id:
                        type: string
                        description: The ID of the mail template to associate the file with
                      deal_name:
                        type: string
                        description: The name of the deal associated with the file
                      person_name:
                        type: string
                        description: The name of the person associated with the file
                      org_name:
                        type: string
                        description: The name of the organization associated with the file
                      product_name:
                        type: string
                        description: The name of the product associated with the file
                      lead_name:
                        type: string
                        description: The name of the lead associated with the file
                      url:
                        type: string
                        description: The URL of the download file
                      name:
                        type: string
                        description: The visible name of the file
                      description:
                        type: string
                        description: The description of the file
              example:
                success: true
                data:
                  id: 7195
                  user_id: 456
                  deal_id: 36
                  person_id: 1
                  org_id: 15
                  product_id: 1
                  activity_id: 1
                  lead_id: adf21080-0e10-11eb-879b-05d71fb426ec
                  log_id: null
                  add_time: '2020-02-21 11:52:28'
                  update_time: '2020-02-21 11:52:24'
                  file_name: ''
                  file_type: gdoc
                  file_size: 0
                  active_flag: true
                  inline_flag: false
                  remote_location: googledocs
                  remote_id: 1gzyh6ExBxIb4RBZbAZxsrrBp45yuXhZWq3Zash5b75c
                  cid: ''
                  s3_bucket: ''
                  mail_message_id: ''
                  mail_template_id: ''
                  deal_name: test deal
                  person_name: ''
                  org_name: test org
                  product_name: ''
                  lead_name: Test lead name 1
                  url: https://app.pipedrive.com/api/v1/files/7195/download
                  name: Test title for remote file
                  description: ''
  /files/remoteLink:
    post:
      summary: Link a remote file to an item
      description: Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-remote-file" target="_blank" rel="noopener noreferrer">adding a remote file</a>.
      x-token-cost: 10
      operationId: linkFileToItem
      tags:
      - Files
      security:
      - api_key: []
      - oauth2:
        - deals:full
        - activities:full
        - contacts:full
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              title: linkFileToItemRequest
              type: object
              required:
              - item_type
              - item_id
              - remote_id
              - remote_location
              properties:
                item_type:
                  type: string
                  enum:
                  - deal
                  - organization
                  - person
                  description: The item type
                item_id:
                  type: integer
                  description: The ID of the item to associate the file with
                remote_id:
                  type: string
                  description: The remote item ID
                remote_location:
                  type: string
                  enum:
                  - googledrive
                  description: The location type to send the file to. Only `googledrive` is supported at the moment.
      responses:
        '200':
          description: Links an existing remote file (googledrive) to the item you supply - deal, person, organization
          content:
            application/json:
              schema:
                title: GetLinkRemoteFileToItemResponse
                type: object
                properties:
                  success:
                    type: boolean
                    description: If the request was successful or not
                  data:
                    type: object
                    description: The file data
                    properties:
                      id:
                        type: integer
                        description: The ID of the file
                      user_id:
                        type: integer
                        description: The ID of the user to associate the file with
                      deal_id:
                        type: integer
                        description: The ID of the deal to associate the file with
                      person_id:
                        type: integer
                        description: The ID of the person to associate the file with
                      org_id:
                        type: integer
                        description: The ID of the organization to associate the file with
                      product_id:
                        type: integer
                        description: The ID of the product to associate the file with
                      activity_id:
                        type: integer
                        description: The ID of the activity to associate the file with
                      lead_id:
                        type: string
                        description: The ID of the lead to associate the file with
                        format: uuid
                      add_time:
                        type: string
                        description: 'The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS'
                      update_time:
                        type: string
                        description: 'The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS'
                      file_name:
                        type: string
                        description: The original name of the file
                      file_size:
                        type: integer
                        description: The size of the file
                      active_flag:
                        type: boolean
                        description: Whether the user is active or not. false = Not activated, true = Activated
                      inline_flag:
                        type: boolean
                        description: Whether the file was uploaded as inline or not
                      remote_location:
                        type: string
                        description: The location type to send the file to. Only googledrive is supported at the moment.
                      remote_id:
                        type: string
                        description: The ID of the remote item
                      cid:
                        type: string
                        description: The ID of the inline attachment
                      s3_bucket:
                        type: string
                        description: The location of the cloud storage
                      mail_message_id:
                        type: string
                        description: The ID of the mail message to associate the file with
                      mail_template_id:
                        type: string
                        description: The ID of the mail template to associate the file with
                      deal_name:
                        type: string
                        description: The name of the deal associated with the file
                      person_name:
                        typ

# --- truncated at 32 KB (53 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/pipedrive/refs/heads/main/openapi/pipedrive-files-api-openapi.yml