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

Optional delivery address

  • address_name_delivery: string
  • zipcode_delivery: string
  • city_delivery: string
  • street_delivery: string
  • number_delivery: string

Optional visiting address

  • address_name_visiting: string
  • zipcode_visiting: string
  • city_visiting: string
  • street_visiting: string
  • number_visiting: string

Optional invoicing address

  • address_name_invoicing: string
  • zipcode_invoicing: string
  • city_invoicing: string
  • street_invoicing: string
  • number_invoicing: string
  • invoice_email_address: 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: boolean
  • 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: boolean 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: boolean 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: boolean: 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 array contains the information listed below.

    Return data

    • id: id of the contact
    • forename: string
    • surname: string
    • street: string
    • number: string
    • zipcode: string
    • city: string
    • country: string
    • website: string
    • email: string
    • gsm: string
    • telephone: string
    • fax: string
    • gender: string
    • dob: date of birth, string
    • language_code: string
    • language_name: string
    • date_added: unix timestamp
    • date_edited: unix timestamp
    • status: string
    • deleted: boolean

    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.

    Return data

    • id: id of the contact
    • forename: string
    • surname: string
    • street: string
    • number: string
    • zipcode: string
    • city: string
    • country: string
    • website: string
    • email: string
    • gsm: string
    • telephone: string
    • fax: string
    • gender: string
    • dob: date of birth, string
    • iban: string
    • bic: string
    • tags: string
    • language_code: string
    • language_name: string
    • date_added: unix timestamp
    • extra_addresses: array with strings for delivery or invoicing address in case this is filled in
    • deleted: boolean
    • custom_fields: array with the different custom fields and their values
    • linked_company_ids: array with different id's
    • linked_company_names: array with different strings
    • linked_company_functions: array with different strings
    • background_info_html: string
    • external_customer_id: id

    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.

    Return data

    • id: id of the company
    • name: string
    • email: string
    • telephone: string
    • gsm: string
    • function: string
    • decision_maker: boolean

    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.

    Return data

    • id: id
    • contact_id: id
    • company_id: id
    • function: string


    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

    Optional delivery address

    • address_name_delivery: string
    • zipcode_delivery: string
    • city_delivery: string
    • street_delivery: string
    • number_delivery: string

    Optional visiting address

    • address_name_visiting: string
    • zipcode_visiting: string
    • city_visiting: string
    • street_visiting: string
    • number_visiting: string

    Optional invoicing address

    • address_name_invoicing: string
    • zipcode_invoicing: string
    • city_invoicing: string
    • street_invoicing: string
    • number_invoicing: string
    • invoice_email_address: 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: boolean 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: boolean 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: boolean 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: boolean: 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
    • invoice_email_address: 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 array contains the information listed below.

    Return data

    • id: id of the company
    • name: string
    • taxcode: string
    • business_type: string
    • street: string
    • number: string
    • zipcode: string
    • city: string
    • country: string
    • website: string
    • email: string
    • telephone: string
    • fax: string
    • iban: string
    • bic: string
    • language_code: string
    • language_name: string
    • date_added: unix timestamp
    • date_edited: unix timestamp
    • status: string
    • vat_liability: string
    • payment_term: string
    • deleted: boolean

    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.

    Return data

    • id: id of the company
    • name: string
    • street: string
    • number: string
    • zipcode: string
    • city: string
    • country: string
    • taxcode: string
    • kvk_nummer: string
    • local_business_number: string
    • email: string
    • website: string
    • telephone: string
    • fax: string
    • iban: string
    • bic: string
    • pricelist_id: id
    • account_manager_id: id
    • date_added: unix timestamp
    • date_edited: unix timestamp
    • tags: string
    • language_code: string
    • business_type: string
    • vat_liability: string
    • sector_name: string
    • invoice_email_address: string
    • payment_term: string
    • extra_addresses: array with strings for delivery or invoicing address in case this is filled in
    • background_info_html: string
    • related_companies: id's of the related companies
    • deleted: boolean
    • custom_fields: array with the different custom fields and their values
    • external_customer_id: id

    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.

    • name: string