Getting startedGeneralCRMDealsInvoicesSubscriptionsProductsTicketsTimetracking & TasksCallsMeetingsPlanningProjectsExternal costsNotesFilesUsers & TeamsCustom Fields

Teamleader Tickets 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 add new tickets and ticket replies to Teamleader.

Manipulating tickets

Adding an new ticket

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

Required POST parameters for opportunities

  • client_email: string: email address of the client opening this ticket
  • client_name: string: name of the contact. Used when Teamleader needs to create a new contact
  • subject: string: subject of the ticket

Optional POST parameters

  • contact_or_company: contact or company: Who is the ticket for? Use this parameter in case you do not want to use client_email and client_name.
  • contact_or_company_id: integer: ID of the contact or company. Use this parameter in case you do not want to use client_email and client_name.
  • optional_company_id: company_id: ID of the company related to the contact of the ticket
  • send_autoreply: 0/1: if this option is enabled, Teamleader will send autoreplies after this ticket has been created, if an autoreply was set up.
  • description_html: string (html) : add extra information about this ticket to be displayed to the user.
  • responsible_sys_client_id: integer : ID of the user that is responsible for this ticket.
  • project_id: integer : The ID of the related project.
  • custon_field_id: value for a custom field

Sample output

Example output: 41664 (id of the ticket that was added)

Updating a ticket

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

Required POST parameters for opportunities

  • ticket_id: Integer: The ID of the ticket you want to add this reply to

Optional POST parameters

  • status: open, new, closed: Assign a new status to the ticket by passing this parameter
  • contact_or_company: set to either contact or company
  • contact_or_company_id: integer: ID of the related contact or company
  • responsible_sys_client_id: ID of the the new user responsible for this ticket.
  • custon_field_id: value for a custom field

Sample output

Example output: JSON array indicating the success or failure of the update.

Adding a new message to a ticket

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

Required POST parameters for opportunities

  • ticket_id: Integer: The ID of the ticket you want to add this reply to
  • message: string: The message you want to insert. Must be UTF-8 encoded text.

Optional POST parameters

  • new_ticket_status: open, new, closed: Assign a new status to the ticket by passing this parameter
  • from: by default, the new message will be added as if the ticket client added a new message. If you pass a user ID in this parameter, the message will be added as if that Teamleader user added the reply.
  • internal_note: 0/1: if this parameter is set to 1, the message will be an internal note.
  • announce_reply: 0/1: if this parameter is set to 1, a new notification will be sent to the person responsible for this ticket. A notification will be sent regardless of this parameter if the ticket was closed and subsequently reopened by this API call.
  • send_email 0/1; if this parameter is set, an e-mail will be send out when adding a message.

Optional attachments passed as POST parameters

Pass a number of attachments along with this message. Replace X in the POST parameter by an integer (0,1,2,3,..).


  • attachment_X_body_base64: string: base64 encoded file
  • attachment_X_filename: string: name of the file including file extension (eg. screenshot.jpg)

Sample output

Example output: OK

Searching tickets

Searching tickets

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

Required POST parameters for opportunities

  • type: string: pick one option: new, open, waiting_for_client, escalated_thirdparty, not_closed, closed

Optional POST parameters for tickets

  • contact_or_company: contact or company: use this to filter tickets by client
  • contact_or_company_id: integer: ID of the contact or company
  • deep_search: 0/1: pass 1 to return not just tickets related to the requested contact, but also to tickets related to linked companies
  • project_id Limits the search result to the tickets related to this project

Sample output

Example output: JSON array containing all tickets matching the criteria.
	Each entry in the array is an associative array containing information about the ticket.
  • id: id of the ticket
  • for: string containing 'contact' or 'company'
  • for_id: id of the contact or company
  • subject: string
  • date_created: dd/mm/yyyy
  • status: string
  • description: string
  • responsible_sys_client_id: user id
  • time_spent:

Fetching ticket information

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

Required POST parameters for opportunities

  • ticket_id: integer: ID of the ticket

Optional POST parameters for tickets

  • return_detailed_timetracking: 0/1: pass 1 to return detailed timetracking information about this ticket

Sample output

Example output: JSON array containing information about this ticket.
  • id: id of the ticket
  • subject: string
  • date_created: unix timestamp
  • status: string
  • date_closed: unix timestamp
  • responsible_user_id: user id
  • for: string containing 'contact' or 'company'
  • for_id: id of the contact or company
  • deleted: boolean
  • optional_company_id: id
  • background_info_html: string
  • custom_fields: array containing the id's of the custom fields and their values

Searching ticket messages

Getting all messages related to a ticket

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

Required POST parameters for opportunities

  • ticket_id: ID: pass the ID of the ticket
  • include_internal_message: 0/1: display internal messages or not in the output
  • include_third_party_message: 0/1: display third party messages or not in the output

Sample output

Example output: JSON array containing all messages for this ticket, either outgoing or incoming.
  • id: ID of the ticket
  • message: string
  • date: unix timestamp
  • date_formatted: dd/mm/yyyy
  • from: string containing 'contact' or 'company'
  • from_id: id of the contact or company
  • internal_message: boolean

Fetching a single message by ID

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

Required POST parameters for opportunities

  • message_id: integer: ID of the message

Sample output

Example output: JSON array containing information about this message, including the related ticket id.

TicketCloud

Generating the TicketCloud redirect URL

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

Required POST parameters

  • ticket_id: integer: ID of the ticket

Sample output

Example output: Teamleader will return an array containing the signed URL. You can share this URL with a client.
The TicketCloud platform allows online ticket replies.