Getting startedGeneralCRMDealsInvoicesSubscriptionsProductsTicketsTimetracking & TasksCallsMeetingsPlanningProjectsExternal costsNotesFilesUsers & TeamsCustom Fields

Teamleader Files API

This document assumes you have your API key and know how to perform a POST request (see Getting started)

This part of the api allows you to manage files from Teamleader.

Files API overview

Getting all files related to an object

API endpoint: https://app.teamleader.eu/api/getFiles.php

Required POST parameters

  • amount: integer: the amount of files returned per request (1 - 100)
  • pageno: integer: the current page (the first page is 0)
  • object_type: string: contact, company, sale, ticket, project or meeting
  • object_id: integer: ID of the object

Optional POST parameters

  • folder_name: string: the folder name of which the contents should be displayed

Sample output

Example output: JSON array containing either an error message of a list of files.
  • id: id of the file
  • filename: string
  • date_last_edited: unix timestamp
  • filesize_bytes: integer

Getting information about a file

API endpoint: https://app.teamleader.eu/api/getFileInfo.php

Required POST parameters

  • file_id: integer: ID of the file

Sample output

Example output: JSON array containing information about this file (related objects, filename, size in bytes,..).
  • filename: string
  • filesize_bytes: integer
  • uploader_client_id: id of the user who uploaded it
  • related_object_type: string
  • related_object_id: id of the related object
  • folder: string
  • date_last_edited: unix timestamp
  • date_last_edited_formatted: dd/mm/yyyy

Downloading a file

API endpoint: https://app.teamleader.eu/api/downloadFile.php

Required POST parameters

  • file_id: integer: ID of the file

Sample output

Example output: JSON array containing a signed URL where the file can be downloaded.
The signed URL will remaing valid for 30 seconds.

Uploading a file

API endpoint: https://app.teamleader.eu/api/uploadFile.php

Required POST parameters

  • object_type: string: contact, company, sale, ticket, project or meeting
  • object_id: integer: ID of the object
  • file_content: string: Base64 encoded version the file
  • file_name: string: name of the file, including extension

Optional POST parameters

  • folder_name: string: folder name where the file should be uploaded

Sample output

Example output: JSON array containing the status of the call and file ID if the upload was successful.

Deleting a file

API endpoint: https://app.teamleader.eu/api/deleteFile.php

Required POST parameters

  • file_id: integer: ID of the file

Sample output

Example output: A JSON object will be returned indicated the status of the deletion.
A reason will be provided if the call failed.