Getting startedGeneralCRMDealsInvoicesSubscriptionsProductsTicketsTimetracking & TasksCallsMeetingsPlanningProjectsExternal costsNotesFilesUsers & TeamsCustom Fields

Teamleader Contact/Company 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 access contacts and companies.

Contact API overview

Adding a contact to Teamleader

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

Required POST parameters

  • forename: string
  • surname: string
  • email: string

Optional POST parameters

  • salutation: string
  • telephone: string
  • gsm: string
  • website: string
  • country: string: country code according to ISO 3166-1 alpha-2. For Belgium: "BE"
  • zipcode: string
  • city: string
  • street: string
  • number: string
  • language: string: language code according to ISO 639-1. For Dutch: "NL"
  • gender: M/F/U
  • dob: unix timestamp (date of birth)
  • description: background information on the contact
  • newsletter: 0/1
  • add_tag_by_string: string: pass one or more tags, comma-separated. Existing tags will be reused, other tags will be automatically created for you.
  • automerge_by_name: 0/1 If this flag is set to 1, Teamleader will merge this info into an existing contact with the same forename and surname, if it finds any. Default: 0
  • automerge_by_email: 0/1 If this flag is set to 1, Teamleader will merge this info into an existing contact with the same email address, if it finds any.
  • custom_field_ID: replace ID by the ID of your custom field. (eg custom_field_310)
  • tracking string: title of the activity
  • tracking_long string: description of the activity

Sample output

Example output: 418164 (id of the contact that was added)

Updating contact information

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

Required POST parameters

  • contact_id: integer: ID of the contact
  • track_changes: 0/1: if set to 1, all changes are logged and visible to users in the web-interfae

Optional POST parameters

  • forename: string
  • surname: string
  • city: string
  • zipcode: string
  • street: string
  • number: string
  • language: string: language code according to ISO 639-1. For Dutch: "NL"
  • gender: M/F/U
  • dob: unix timestamp (date of birth)
  • description: background information on the contact
  • country: string: country code according to ISO 3166-1 alpha-2. For Belgium: "BE"
  • gsm: string
  • telephone: string
  • fax: string
  • website: string
  • email: string
  • linked_company_ids: comma-separated list of company ids that should be linked to this contact. (overwrites existing links)
  • add_tag_by_string: string: pass one or more tags, comma-separated. Existing tags will be reused, other tags will be automatically created for you.and added to the contact
  • remove_tag_by_string: string: pass one or more tags, comma-separated. These tags will be removed from the contact.
  • custom_field_ID: replace ID by the ID of your custom field. (eg custom_field_310)

Sample output

Example output: OK or error message

Deleting a contact

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

Required POST parameters

  • contact_id: integer: ID of the contact

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.

(Un)Linking a contact to a company

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

Required POST parameters

  • contact_id: integer: ID of the contact
  • company_id: integer: ID of the contact
  • mode: link/unlink: if set to link, the contact is added to the company. If set to unlink, the relation is removed.

Optional POST parameters

  • function: string: the job title the contact holds at the company (eg: HR manager)

Sample output

Example output: OK or error message

Searching Teamleader contacts

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

Required POST parameters

  • amount: integer: the amount of contacts returned per request (1 - 100)
  • pageno: integer: the current page (the first page is 0)

Optional POST parameters

  • searchby: string: a search string. Teamleader will try to match each part of the string to the forename, surname, company name and email address.
  • modifiedsince: integer: Unix timestamp. Teamleader will only return contacts that have been added or modified since that timestamp.
  • filter_by_tag: string: Company tag. Teamleader will only return companies that have the tag.
  • segment_id: integer: The ID of a segment created for contacts. Teamleader will only return contacts that have been filtered out by the segment settings.
  • selected_customfields: comma-separated list of the IDs of the custom fields you wish to select (max 10). Example: '42,142'

Sample output

Example output: JSON array containing all matching Teamleader contacts. Each entry in the array is an associative array containing information about the contact. The most important keys for this array are: forename, surname, status, email, gender, gsm, telephone, fax, street, number, zipcode, city, country, values of all custom fields that you have defined for contacts.

Fetching contact information

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

Required POST parameters

  • contact_id: integer: the ID of the contact

Sample output

Example output: JSON array containing info about the contact

Getting all contacts related to a company

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

Required POST parameters

  • company_id: integer: the ID of the company

Sample output

Example output: JSON array containing info about the contacts that are related to this company

Getting all relationships between contacts and companies

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

Required POST parameters

  • amount: integer: the amount of relationships returned per request (1 - 100)
  • pageno: integer: the current page (the first page is 0)

Sample output

Example output: JSON array containing info about relations between contacts and companies



Company API overview

Adding a company to Teamleader

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

Required POST parameters

  • name: string

Optional POST parameters

  • email: string
  • vat_code: string
  • telephone: string
  • country: string: country code according to ISO 3166-1 alpha-2. For Belgium: "BE"
  • zipcode: string
  • city: string
  • street: string
  • number: string
  • website: string
  • description: string
  • account_manager_id: ID: id of the user.
  • local_business_number: string containing the local business number (KVK in the Netherlands)
  • business_type: string containing the company type (eg NV, BVBA,..)
  • language: string: language code according to ISO 639-1. For Dutch: "NL"
  • add_tag_by_string: string: pass one or more tags, comma-separated. Existing tags will be reused, other tags will be automatically created for you.
  • payment_term: 0D / 7D / 10D / 15D / 21D / 30D / 45D / 60D / 30DEM / 60DEM / 90DEM. Default: 30D
  • automerge_by_name: 0/1 If this flag is set to 1, Teamleader will merge this info into an existing company with the same name, if it finds any.
  • automerge_by_email: 0/1 If this flag is set to 1, Teamleader will merge this info into an existing company with the same email address, if it finds any.
  • automerge_by_vat_code: 0/1 If this flag is set to 1, Teamleader will merge this info into an existing company with the same VAT code, if it finds any.
  • custom_field_ID: replace ID by the ID of your custom field. (eg custom_field_310)

Sample output

Example output: 4158764 (id of the company that was added)

Updating company information

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

Required POST parameters

  • company_id: integer: ID of the company
  • track_changes: 0/1: if set to 1, all changes are logged and visible to users in the web-interfae

Optional POST parameters

  • name: string
  • vat_code: string
  • city: string
  • zipcode: string
  • street: string
  • number: string
  • description: string
  • country: string: country code according to ISO 3166-1 alpha-2. For Belgium: "BE"
  • telephone: string
  • website: string
  • fax: string
  • email: string
  • local_business_number: string containing the local business number (KVK in the Netherlands)
  • business_type: string containing the company type (eg NV, BVBA,..)
  • external_customer_id string containing the bookkeeping customer ID
  • add_tag_by_string: string: pass one or more tags, comma-separated. Existing tags will be reused, other tags will be automatically created for you.and added to the company
  • remove_tag_by_string: string: pass one or more tags, comma-separated. These tags will be removed from the company.
  • custom_field_ID: replace ID by the ID of your custom field. (eg custom_field_310)

Sample output

Example output: OK or error message

Deleting a company

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

Required POST parameters

  • company_id: integer: ID of the company

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.

Searching Teamleader companies

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

Required POST parameters

  • amount: integer: the amount of companies returned per request (1 - 100)
  • pageno: integer: the current page (the first page is 0)

Optional POST parameters

  • searchby: string: a search string. Teamleader will try to match each part of the string to the company name and email address.
  • modifiedsince: integer: Unix timestamp. Teamleader will only return companies that have been added or modified since that timestamp.
  • filter_by_tag: string: Company tag. Teamleader will only return companies that have the tag.
  • segment_id: integer: The ID of a segment created for companies. Teamleader will only return companies that have been filtered out by the segment settings.
  • selected_customfields: comma-separated list of the IDs of the custom fields you wish to select (max 10). Example: '42,142'

Sample output

Example output: JSON array containing all matching Teamleader companies. Each entry in the array is an associative array containing information about the contact. The most important keys for this array are: name, street, number, zipcode, city, country, website, account manager, values of all custom fields that you have defined for companies.

Fetching company information

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

Required POST parameters

  • company_id: integer: the ID of the company

Sample output

Example output: JSON array containing info about the company

Getting all possible business types for a country

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

Required POST parameters

Sample output

Example output: JSON array containing the names of business types (legal structures) a company can have within a certain country.