# Teamleader Focus

> Work with your Teamleader Focus CRM: find, create, update and delete contacts and companies, run deals through your pipeline, and manage tasks and calendar events.

App · 33 actions. Web page: https://docs.lodol.com/docs/integrations/teamleader-focus

## Actions

### Add tags to contact

Put tags on a contact, creating any that do not exist. Tags it already has stay.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.
- Tags (`tags`, list, required): The tags.

**Outputs**

- `contact` (object): The contact with its tags

**Example output**

```json
{
  "contact": {
    "added_at": "example",
    "birthdate": "example",
    "companies": [],
    "emails": [],
    "first_name": "example",
    "gender": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "marketing_mails_consent": true,
    "primary_address": {},
    "remarks": "example",
    "salutation": "example",
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Cancel calendar event

Cancel a calendar event for all attendees.

**Inputs**

- Event ID (`event_id`, text, required): The event's id, from 'List events' or an earlier step.

**Outputs**

- `cancelled` (true/false): Always true once cancelled
- `id` (text): The id of the event cancelled

**Example output**

```json
{
  "cancelled": true,
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74"
}
```

### Complete task

Mark a task as done.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.

**Outputs**

- `task` (object): The task, now done

**Example output**

```json
{
  "task": {
    "assignee": {},
    "completed": true,
    "completed_at": "example",
    "customer": {},
    "deal": {},
    "description": "example",
    "due_on": "example",
    "estimated_duration": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "priority": "example",
    "title": "example",
    "work_type": {}
  }
}
```

### Create calendar event

Create a calendar event with a start and end, linked to a company, contact or deal, optionally with attendees.

**Inputs**

- Title (`title`, text, required): The event's title.
- Activity type (`activity_type_id`, text, required): The kind of event, as set up in Teamleader.
- Start (`starts_at`, date and time, required): When the event starts.
- End (`ends_at`, date and time, required): When the event ends.
- Description (`description`, text): Details about the event.
- Location (`location`, text): Where the event takes place. Teamleader only accepts it when the activity type is a meeting.
- Work type (`work_type_id`, text): The kind of work, as set up in Teamleader. Teamleader only accepts it, and needs it, when the activity type is a task.
- Attendees (`attendee_user_ids`, list): The Teamleader users who attend.
- Link to (`link_type`, text, required): Whether the event is linked to a company, a contact or a deal. Teamleader needs the event to be linked to one. One of: `company`, `contact`, `deal`.
- Linked record ID (`link_id`, text, required): The id of the company, contact or deal to link, from a list step.

**Outputs**

- `id` (text): The id of the new record
- `type` (text): The kind of record, such as contact

**Example output**

```json
{
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
  "type": "event"
}
```

### Create company

Add a company. Only the name is needed.

**Inputs**

- Name (`name`, text, required): The company's name.
- VAT number (`vat_number`, text): The company's VAT number.
- E-mail (`email`, text): The primary e-mail address. It replaces the company's e-mail addresses.
- Phone (`phone`, text): A phone number. It replaces the company's phone numbers.
- Website (`website`, text): The company's website.
- Language (`language`, text): The language to write to them in. One of: `nl` (Dutch), `en` (English), `fr` (French), `de` (German), `da` (Danish), `es` (Spanish), `fi` (Finnish), `it` (Italian), `nb` (Norwegian), `pl` (Polish), and 3 more.
- Responsible user (`responsible_user_id`, text): The Teamleader user who looks after the company.
- Preferred currency (`preferred_currency`, text): The currency to use for the company. One of: `EUR` (Euro (EUR)), `USD` (US dollar (USD)), `GBP` (Pound sterling (GBP)), `CHF` (Swiss franc (CHF)), `DKK` (Danish krone (DKK)), `SEK` (Swedish krona (SEK)), `NOK` (Norwegian krone (NOK)), `PLN` (Polish zloty (PLN)), `CZK` (Czech koruna (CZK)), `RON` (Romanian leu (RON)), and 13 more.
- Remarks (`remarks`, text): Background information, as Markdown.
- Allow marketing e-mails (`marketing_mails_consent`, true/false): Whether Teamleader may send marketing e-mails to them. Leave unset to keep it as it is.
- Street and number (`address_line_1`, text): The primary address, first line. An address needs this, the postal code, the city and the country; it replaces the current primary address.
- Postal code (`postal_code`, text): The primary address' postal code.
- City (`city`, text): The primary address' city.
- Country code (`country`, text): The two-letter country code, such as BE or NL.
- Tags (`tags`, list): Tags to put on the company.

**Outputs**

- `id` (text): The id of the new record
- `type` (text): The kind of record, such as contact

**Example output**

```json
{
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
  "type": "company"
}
```

### Create contact

Add a contact. Only the last name is needed; link them to a company afterwards with 'Link contact to company'.

**Inputs**

- Last name (`last_name`, text, required): The contact's last name.
- First name (`first_name`, text): The contact's first name.
- E-mail (`email`, text): The primary e-mail address. It replaces the contact's e-mail addresses.
- Phone (`phone`, text): A phone number. Setting a phone or mobile number replaces the contact's phone numbers.
- Mobile (`mobile`, text): A mobile number. Setting a phone or mobile number replaces the contact's phone numbers.
- Website (`website`, text): The contact's website.
- Salutation (`salutation`, text): How to address them, such as Mr or Ms.
- Gender (`gender`, text): The contact's gender. One of: `female`, `male`, `non_binary` (Non-binary), `prefers_not_to_say` (Prefers not to say), `unknown`.
- Language (`language`, text): The language to write to them in. One of: `nl` (Dutch), `en` (English), `fr` (French), `de` (German), `da` (Danish), `es` (Spanish), `fi` (Finnish), `it` (Italian), `nb` (Norwegian), `pl` (Polish), and 3 more.
- Birthdate (`birthdate`, date): Their date of birth.
- Remarks (`remarks`, text): Background information, as Markdown.
- Allow marketing e-mails (`marketing_mails_consent`, true/false): Whether Teamleader may send marketing e-mails to them. Leave unset to keep it as it is.
- Street and number (`address_line_1`, text): The primary address, first line. An address needs this, the postal code, the city and the country; it replaces the current primary address.
- Postal code (`postal_code`, text): The primary address' postal code.
- City (`city`, text): The primary address' city.
- Country code (`country`, text): The two-letter country code, such as BE or NL.
- Tags (`tags`, list): Tags to put on the contact.

**Outputs**

- `id` (text): The id of the new record
- `type` (text): The kind of record, such as contact

**Example output**

```json
{
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
  "type": "contact"
}
```

### Create deal

Create a deal for a company or contact, optionally in a given phase, with a value, probability and closing date.

**Inputs**

- Title (`title`, text, required): The deal's title.
- Customer type (`customer_type`, text, required): Whether the customer is a company or a contact. One of: `company`, `contact`.
- Customer ID (`customer_id`, text, required): The customer's id, from 'List companies', 'List contacts' or an earlier step.
- Contact person ID (`contact_person_id`, text): The contact at the customer to deal with, from 'List contacts' or an earlier step.
- Phase (`phase_id`, text): The phase to start in. Defaults to the first phase of the default pipeline.
- Summary (`summary`, text): Remarks about the deal.
- Source (`source_id`, text): Where the deal came from.
- Department (`department_id`, text): The department the deal belongs to.
- Responsible user (`responsible_user_id`, text): The Teamleader user who owns the deal.
- Estimated value (`estimated_value`, number): The expected amount of the deal.
- Currency (`currency`, text): The currency of the estimated value. Defaults to EUR. One of: `EUR` (Euro (EUR)), `USD` (US dollar (USD)), `GBP` (Pound sterling (GBP)), `CHF` (Swiss franc (CHF)), `DKK` (Danish krone (DKK)), `SEK` (Swedish krona (SEK)), `NOK` (Norwegian krone (NOK)), `PLN` (Polish zloty (PLN)), `CZK` (Czech koruna (CZK)), `RON` (Romanian leu (RON)), and 13 more.
- Probability (%) (`probability`, number): The chance of winning, from 0 to 100. From 0 to 100.
- Expected closing date (`closing_date`, date): When the deal is expected to close.
- Purchase order number (`purchase_order_number`, text): The customer's purchase order number.

**Outputs**

- `id` (text): The id of the new record
- `type` (text): The kind of record, such as contact

**Example output**

```json
{
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
  "type": "deal"
}
```

### Create task

Create a task with a due date and a work type, optionally assigned to a user and linked to a deal or customer.

**Inputs**

- Title (`title`, text, required): The task's title.
- Due date (`due_on`, date, required): When the task is due.
- Work type (`work_type_id`, text, required): The kind of work, as set up in Teamleader.
- Description (`description`, text): Details about the task.
- Assign to (`assignee_id`, text): The Teamleader user to give the task to. Leave empty to leave it unassigned.
- Estimated minutes (`estimated_minutes`, number): How long the task should take, in minutes. At least 1.
- Deal ID (`deal_id`, text): The deal the task belongs to, from 'List deals' or an earlier step.
- Customer type (`customer_type`, text): Whether the customer is a company or a contact. One of: `company`, `contact`.
- Customer ID (`customer_id`, text): The customer's id, from 'List companies', 'List contacts' or an earlier step.

**Outputs**

- `id` (text): The id of the new record
- `type` (text): The kind of record, such as contact

**Example output**

```json
{
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
  "type": "todo"
}
```

### Delete company

Delete a company. This cannot be undone.

**Inputs**

- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `id` (text): The id of the record deleted

**Example output**

```json
{
  "deleted": true,
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74"
}
```

### Delete contact

Delete a contact. This cannot be undone.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `id` (text): The id of the record deleted

**Example output**

```json
{
  "deleted": true,
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74"
}
```

### Delete deal

Delete a deal. This cannot be undone.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `id` (text): The id of the record deleted

**Example output**

```json
{
  "deleted": true,
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74"
}
```

### Delete task

Delete a task. This cannot be undone.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `id` (text): The id of the record deleted

**Example output**

```json
{
  "deleted": true,
  "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74"
}
```

### Get company

Get one company with its e-mail addresses, phone numbers, addresses, tags and responsible user.

**Inputs**

- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "added_at": "example",
    "emails": [],
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "marketing_mails_consent": true,
    "name": "example",
    "preferred_currency": "example",
    "primary_address": {},
    "responsible_user": {},
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "vat_number": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Get contact

Get one contact with their e-mail addresses, phone numbers, addresses, tags and linked companies.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.

**Outputs**

- `contact` (object): The contact

**Example output**

```json
{
  "contact": {
    "added_at": "example",
    "birthdate": "example",
    "companies": [],
    "emails": [],
    "first_name": "example",
    "gender": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "marketing_mails_consent": true,
    "primary_address": {},
    "remarks": "example",
    "salutation": "example",
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Get current user

Get the Teamleader Focus user the connection acts as: name, e-mail, function, language and time zone.

**Inputs**: None.

**Outputs**

- `user` (object): The connected user

**Example output**

```json
{
  "user": {
    "account": {},
    "email": "example",
    "first_name": "example",
    "function": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "teams": [],
    "telephones": [],
    "time_zone": "example"
  }
}
```

### Get deal

Get one deal with its customer, value, phase, owner and source.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.

**Outputs**

- `deal` (object): The deal

**Example output**

```json
{
  "deal": {
    "closed_at": "example",
    "created_at": "example",
    "current_phase": {},
    "department": {},
    "estimated_closing_date": "example",
    "estimated_probability": 1,
    "estimated_value": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "lead": {},
    "lost_reason": {},
    "pipeline": {},
    "purchase_order_number": "example",
    "reference": "example",
    "responsible_user": {},
    "source": {},
    "status": "example",
    "summary": "example",
    "title": "example",
    "updated_at": "example",
    "web_url": "example",
    "weighted_value": {}
  }
}
```

### Link contact to company

Link a contact to a company, with their position there.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.
- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.
- Position (`position`, text): Their job title at the company.
- Decision maker (`decision_maker`, true/false): Whether they decide on purchases at the company.

**Outputs**

- `contact` (object): The contact with its linked companies

**Example output**

```json
{
  "contact": {
    "added_at": "example",
    "birthdate": "example",
    "companies": [],
    "emails": [],
    "first_name": "example",
    "gender": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "marketing_mails_consent": true,
    "primary_address": {},
    "remarks": "example",
    "salutation": "example",
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### List activity types

List the activity types set up in Teamleader, such as meeting or call. An activity type's id is what 'Create calendar event' takes.

**Inputs**: None.

**Outputs**

- `activity_types` (list): The activity types
- `count` (number): How many activity types

**Example output**

```json
{
  "activity_types": [
    {
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "name": "example"
    }
  ],
  "count": 1
}
```

### List calendar events

List calendar events, filtering by attendee, activity type or time. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`term`, text): Matches the title and description.
- Attendee (`attendee_user_id`, text): Only events this user is part of.
- Activity type (`activity_type_id`, text): Only events of this type.
- From (`starts_from`, date and time): Only events that end after this date and time.
- Until (`starts_until`, date and time): Only events that start before this date and time.
- Order (`sort_order`, text): Order by start time. Defaults to Teamleader's own order. One of: `asc` (Ascending), `desc` (Descending).
- Page size (`page_size`, number): How many to return, 1 to 100. Defaults to 20. From 1 to 100.
- Page number (`page_number`, number): Which page to return, starting at 1. Use it with 'Has more' to read on. At least 1.

**Outputs**

- `count` (number): How many came back on this page
- `events` (list): The events
- `has_more` (true/false): Whether a next page exists; raise the page number to get it
- `page_number` (number): The page number returned
- `page_size` (number): The page size used
- `total` (number): How many match in all (a lower bound if Teamleader does not say)

**Example output**

```json
{
  "count": 1,
  "events": [
    {
      "activity_type": {},
      "attendees": [],
      "creator": {},
      "description": "example",
      "ends_at": "example",
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "links": [],
      "location": "example",
      "starts_at": "example",
      "title": "example"
    }
  ],
  "has_more": false,
  "page_number": 1,
  "page_size": 20,
  "total": 1
}
```

### List companies

List companies, searching by name, VAT number, e-mail or phone, or filtering by tags, status or last update. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`term`, text): Matches name, VAT number, e-mail and phone number.
- E-mail (`email`, text): Only the company with this primary e-mail address.
- VAT number (`vat_number`, text): Only the company with this VAT number.
- Tags (`tags`, list): Only those that have all of these tags.
- Status (`status`, text): Only active or only deactivated ones. One of: `active`, `deactivated`.
- Updated since (`updated_since`, date and time): Only those changed on or after this date and time.
- Sort by (`sort_by`, text): What to order the results by. One of: `added_at` (Date added), `updated_at` (Last updated), `name`.
- Order (`sort_order`, text): Ascending or descending. Defaults to ascending when 'Sort by' is set. One of: `asc` (Ascending), `desc` (Descending).
- Page size (`page_size`, number): How many to return, 1 to 100. Defaults to 20. From 1 to 100.
- Page number (`page_number`, number): Which page to return, starting at 1. Use it with 'Has more' to read on. At least 1.

**Outputs**

- `companies` (list): The companies
- `count` (number): How many came back on this page
- `has_more` (true/false): Whether a next page exists; raise the page number to get it
- `page_number` (number): The page number returned
- `page_size` (number): The page size used
- `total` (number): How many match in all (a lower bound if Teamleader does not say)

**Example output**

```json
{
  "companies": [
    {
      "added_at": "example",
      "emails": [],
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "language": "example",
      "marketing_mails_consent": true,
      "name": "example",
      "preferred_currency": "example",
      "primary_address": {},
      "responsible_user": {},
      "status": "example",
      "tags": [],
      "telephones": [],
      "updated_at": "example",
      "vat_number": "example",
      "web_url": "example",
      "website": "example"
    }
  ],
  "count": 1,
  "has_more": false,
  "page_number": 1,
  "page_size": 20,
  "total": 1
}
```

### List contacts

List contacts, searching by name, e-mail or phone, or filtering by company, tags, status or last update. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`term`, text): Matches first name, last name, e-mail and phone number.
- E-mail (`email`, text): Only the contact with this primary e-mail address.
- Company ID (`company_id`, text): Only contacts linked to this company, from 'List companies' or an earlier step.
- Tags (`tags`, list): Only those that have all of these tags.
- Status (`status`, text): Only active or only deactivated ones. One of: `active`, `deactivated`.
- Updated since (`updated_since`, date and time): Only those changed on or after this date and time.
- Sort by (`sort_by`, text): What to order the results by. One of: `added_at` (Date added), `updated_at` (Last updated), `name`.
- Order (`sort_order`, text): Ascending or descending. Defaults to ascending when 'Sort by' is set. One of: `asc` (Ascending), `desc` (Descending).
- Page size (`page_size`, number): How many to return, 1 to 100. Defaults to 20. From 1 to 100.
- Page number (`page_number`, number): Which page to return, starting at 1. Use it with 'Has more' to read on. At least 1.

**Outputs**

- `contacts` (list): The contacts
- `count` (number): How many came back on this page
- `has_more` (true/false): Whether a next page exists; raise the page number to get it
- `page_number` (number): The page number returned
- `page_size` (number): The page size used
- `total` (number): How many match in all (a lower bound if Teamleader does not say)

**Example output**

```json
{
  "contacts": [
    {
      "added_at": "example",
      "birthdate": "example",
      "companies": [],
      "emails": [],
      "first_name": "example",
      "gender": "example",
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "language": "example",
      "last_name": "example",
      "marketing_mails_consent": true,
      "primary_address": {},
      "remarks": "example",
      "salutation": "example",
      "status": "example",
      "tags": [],
      "telephones": [],
      "updated_at": "example",
      "web_url": "example",
      "website": "example"
    }
  ],
  "count": 1,
  "has_more": false,
  "page_number": 1,
  "page_size": 20,
  "total": 1
}
```

### List deal phases

List the phases deals go through, in order, optionally only those of one pipeline. A phase's id is what 'Create deal' and 'Move deal to phase' take.

**Inputs**

- Pipeline (`pipeline_id`, text): Only the phases of this pipeline.

**Outputs**

- `count` (number): How many phases
- `phases` (list): The phases, in order

**Example output**

```json
{
  "count": 1,
  "phases": [
    {
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "name": "example",
      "probability": 1
    }
  ]
}
```

### List deals

List deals, searching by title or customer, or filtering by state, pipeline, phase, owner, closing date or last activity. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`term`, text): Matches the title, reference and the customer's name.
- Status (`statuses`, list): Only deals in these states. One or more of: `open`, `won`, `lost`.
- Pipeline (`pipeline_id`, text): Only deals in this pipeline.
- Phase (`phase_id`, text): Only deals in this phase.
- Responsible user (`responsible_user_id`, text): Only deals owned by this user.
- Closing on or after (`closing_from`, date): Only deals expected to close on or after this date.
- Closing on or before (`closing_until`, date): Only deals expected to close on or before this date.
- Updated since (`updated_since`, date and time): Only deals with activity on or after this date and time.
- Sort by (`sort_by`, text): What to order the results by. One of: `created_at` (Date created), `weighted_value` (Weighted value).
- Order (`sort_order`, text): Ascending or descending. Defaults to ascending when 'Sort by' is set. One of: `asc` (Ascending), `desc` (Descending).
- Page size (`page_size`, number): How many to return, 1 to 100. Defaults to 20. From 1 to 100.
- Page number (`page_number`, number): Which page to return, starting at 1. Use it with 'Has more' to read on. At least 1.

**Outputs**

- `count` (number): How many came back on this page
- `deals` (list): The deals
- `has_more` (true/false): Whether a next page exists; raise the page number to get it
- `page_number` (number): The page number returned
- `page_size` (number): The page size used
- `total` (number): How many match in all (a lower bound if Teamleader does not say)

**Example output**

```json
{
  "count": 1,
  "deals": [
    {
      "closed_at": "example",
      "created_at": "example",
      "current_phase": {},
      "department": {},
      "estimated_closing_date": "example",
      "estimated_probability": 1,
      "estimated_value": {},
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "lead": {},
      "lost_reason": {},
      "pipeline": {},
      "purchase_order_number": "example",
      "reference": "example",
      "responsible_user": {},
      "source": {},
      "status": "example",
      "summary": "example",
      "title": "example",
      "updated_at": "example",
      "web_url": "example",
      "weighted_value": {}
    }
  ],
  "has_more": false,
  "page_number": 1,
  "page_size": 20,
  "total": 1
}
```

### List tasks

List tasks, filtering by assignee, done or open, due date or customer. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Search (`term`, text): Matches the task's description.
- Assigned to (`assigned_to`, text): Only tasks for this user or a team they are in.
- Done or not (`state`, text): Only open tasks or only completed ones. Leave empty for both. One of: `open` (Open tasks), `completed` (Completed tasks).
- Due on or after (`due_from`, date): Only tasks due from this date.
- Due on or before (`due_by`, date): Only tasks due by this date.
- Customer type (`customer_type`, text): Whether the customer is a company or a contact. One of: `company`, `contact`.
- Customer ID (`customer_id`, text): The customer's id, from 'List companies', 'List contacts' or an earlier step.
- Sort by (`sort_by`, text): What to order the results by. One of: `due_on` (Due date), `created_at` (Date created).
- Order (`sort_order`, text): Ascending or descending. Defaults to ascending when 'Sort by' is set. One of: `asc` (Ascending), `desc` (Descending).
- Page size (`page_size`, number): How many to return, 1 to 100. Defaults to 20. From 1 to 100.
- Page number (`page_number`, number): Which page to return, starting at 1. Use it with 'Has more' to read on. At least 1.

**Outputs**

- `count` (number): How many came back on this page
- `has_more` (true/false): Whether a next page exists; raise the page number to get it
- `page_number` (number): The page number returned
- `page_size` (number): The page size used
- `tasks` (list): The tasks
- `total` (number): How many match in all (a lower bound if Teamleader does not say)

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page_number": 1,
  "page_size": 20,
  "tasks": [
    {
      "assignee": {},
      "completed": true,
      "completed_at": "example",
      "customer": {},
      "deal": {},
      "description": "example",
      "due_on": "example",
      "estimated_duration": {},
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "priority": "example",
      "title": "example",
      "work_type": {}
    }
  ],
  "total": 1
}
```

### List work types

List the work types set up in Teamleader. A work type's id is what 'Create task' takes.

**Inputs**: None.

**Outputs**

- `count` (number): How many work types
- `work_types` (list): The work types

**Example output**

```json
{
  "count": 1,
  "work_types": [
    {
      "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
      "name": "example"
    }
  ]
}
```

### Mark deal as lost

Mark a deal as lost, with the reason.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.
- Lost reason (`reason_id`, text): Why the deal was lost.
- Extra information (`extra_info`, text): More about why it was lost.

**Outputs**

- `deal` (object): The deal, now lost

**Example output**

```json
{
  "deal": {
    "closed_at": "example",
    "created_at": "example",
    "current_phase": {},
    "department": {},
    "estimated_closing_date": "example",
    "estimated_probability": 1,
    "estimated_value": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "lead": {},
    "lost_reason": {},
    "pipeline": {},
    "purchase_order_number": "example",
    "reference": "example",
    "responsible_user": {},
    "source": {},
    "status": "example",
    "summary": "example",
    "title": "example",
    "updated_at": "example",
    "web_url": "example",
    "weighted_value": {}
  }
}
```

### Mark deal as won

Mark a deal as won.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.

**Outputs**

- `deal` (object): The deal, now won

**Example output**

```json
{
  "deal": {
    "closed_at": "example",
    "created_at": "example",
    "current_phase": {},
    "department": {},
    "estimated_closing_date": "example",
    "estimated_probability": 1,
    "estimated_value": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "lead": {},
    "lost_reason": {},
    "pipeline": {},
    "purchase_order_number": "example",
    "reference": "example",
    "responsible_user": {},
    "source": {},
    "status": "example",
    "summary": "example",
    "title": "example",
    "updated_at": "example",
    "web_url": "example",
    "weighted_value": {}
  }
}
```

### Move deal to phase

Move a deal to another phase of its pipeline.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.
- Phase (`phase_id`, text, required): The phase to move the deal to.

**Outputs**

- `deal` (object): The deal in its new phase

**Example output**

```json
{
  "deal": {
    "closed_at": "example",
    "created_at": "example",
    "current_phase": {},
    "department": {},
    "estimated_closing_date": "example",
    "estimated_probability": 1,
    "estimated_value": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "lead": {},
    "lost_reason": {},
    "pipeline": {},
    "purchase_order_number": "example",
    "reference": "example",
    "responsible_user": {},
    "source": {},
    "status": "example",
    "summary": "example",
    "title": "example",
    "updated_at": "example",
    "web_url": "example",
    "weighted_value": {}
  }
}
```

### Remove tags from contact

Take tags off a contact. Other tags stay.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.
- Tags (`tags`, list, required): The tags.

**Outputs**

- `contact` (object): The contact with its tags

**Example output**

```json
{
  "contact": {
    "added_at": "example",
    "birthdate": "example",
    "companies": [],
    "emails": [],
    "first_name": "example",
    "gender": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "marketing_mails_consent": true,
    "primary_address": {},
    "remarks": "example",
    "salutation": "example",
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Update company

Change a company's details. Only the fields you fill in change, except that an e-mail, a phone number or an address replaces the company's current ones.

**Inputs**

- Company ID (`company_id`, text, required): The company's id, from 'List companies' or an earlier step.
- Name (`name`, text): A new name.
- VAT number (`vat_number`, text): The company's VAT number.
- E-mail (`email`, text): The primary e-mail address. It replaces the company's e-mail addresses.
- Phone (`phone`, text): A phone number. It replaces the company's phone numbers.
- Website (`website`, text): The company's website.
- Language (`language`, text): The language to write to them in. One of: `nl` (Dutch), `en` (English), `fr` (French), `de` (German), `da` (Danish), `es` (Spanish), `fi` (Finnish), `it` (Italian), `nb` (Norwegian), `pl` (Polish), and 3 more.
- Responsible user (`responsible_user_id`, text): The Teamleader user who looks after the company.
- Preferred currency (`preferred_currency`, text): The currency to use for the company. One of: `EUR` (Euro (EUR)), `USD` (US dollar (USD)), `GBP` (Pound sterling (GBP)), `CHF` (Swiss franc (CHF)), `DKK` (Danish krone (DKK)), `SEK` (Swedish krona (SEK)), `NOK` (Norwegian krone (NOK)), `PLN` (Polish zloty (PLN)), `CZK` (Czech koruna (CZK)), `RON` (Romanian leu (RON)), and 13 more.
- Remarks (`remarks`, text): Background information, as Markdown.
- Allow marketing e-mails (`marketing_mails_consent`, true/false): Whether Teamleader may send marketing e-mails to them. Leave unset to keep it as it is.
- Street and number (`address_line_1`, text): The primary address, first line. An address needs this, the postal code, the city and the country; it replaces the current primary address.
- Postal code (`postal_code`, text): The primary address' postal code.
- City (`city`, text): The primary address' city.
- Country code (`country`, text): The two-letter country code, such as BE or NL.

**Outputs**

- `company` (object): The company as it is now

**Example output**

```json
{
  "company": {
    "added_at": "example",
    "emails": [],
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "marketing_mails_consent": true,
    "name": "example",
    "preferred_currency": "example",
    "primary_address": {},
    "responsible_user": {},
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "vat_number": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Update contact

Change a contact's details. Only the fields you fill in change, except that an e-mail, a phone or mobile number or an address replaces the contact's current ones. Use 'Add tags' for tags.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's id, from 'List contacts' or an earlier step.
- Last name (`last_name`, text): A new last name.
- First name (`first_name`, text): The contact's first name.
- E-mail (`email`, text): The primary e-mail address. It replaces the contact's e-mail addresses.
- Phone (`phone`, text): A phone number. Setting a phone or mobile number replaces the contact's phone numbers.
- Mobile (`mobile`, text): A mobile number. Setting a phone or mobile number replaces the contact's phone numbers.
- Website (`website`, text): The contact's website.
- Salutation (`salutation`, text): How to address them, such as Mr or Ms.
- Gender (`gender`, text): The contact's gender. One of: `female`, `male`, `non_binary` (Non-binary), `prefers_not_to_say` (Prefers not to say), `unknown`.
- Language (`language`, text): The language to write to them in. One of: `nl` (Dutch), `en` (English), `fr` (French), `de` (German), `da` (Danish), `es` (Spanish), `fi` (Finnish), `it` (Italian), `nb` (Norwegian), `pl` (Polish), and 3 more.
- Birthdate (`birthdate`, date): Their date of birth.
- Remarks (`remarks`, text): Background information, as Markdown.
- Allow marketing e-mails (`marketing_mails_consent`, true/false): Whether Teamleader may send marketing e-mails to them. Leave unset to keep it as it is.
- Street and number (`address_line_1`, text): The primary address, first line. An address needs this, the postal code, the city and the country; it replaces the current primary address.
- Postal code (`postal_code`, text): The primary address' postal code.
- City (`city`, text): The primary address' city.
- Country code (`country`, text): The two-letter country code, such as BE or NL.

**Outputs**

- `contact` (object): The contact as it is now

**Example output**

```json
{
  "contact": {
    "added_at": "example",
    "birthdate": "example",
    "companies": [],
    "emails": [],
    "first_name": "example",
    "gender": "example",
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "language": "example",
    "last_name": "example",
    "marketing_mails_consent": true,
    "primary_address": {},
    "remarks": "example",
    "salutation": "example",
    "status": "example",
    "tags": [],
    "telephones": [],
    "updated_at": "example",
    "web_url": "example",
    "website": "example"
  }
}
```

### Update deal

Change a deal's title, summary, value, probability, closing date, owner, department or source. Only the fields you fill in change.

**Inputs**

- Deal ID (`deal_id`, text, required): The deal's id, from 'List deals' or an earlier step.
- Title (`title`, text): A new title.
- Summary (`summary`, text): Remarks about the deal.
- Source (`source_id`, text): Where the deal came from.
- Department (`department_id`, text): The department the deal belongs to.
- Responsible user (`responsible_user_id`, text): The Teamleader user who owns the deal.
- Estimated value (`estimated_value`, number): The expected amount of the deal.
- Currency (`currency`, text): The currency of the estimated value. Defaults to EUR. One of: `EUR` (Euro (EUR)), `USD` (US dollar (USD)), `GBP` (Pound sterling (GBP)), `CHF` (Swiss franc (CHF)), `DKK` (Danish krone (DKK)), `SEK` (Swedish krona (SEK)), `NOK` (Norwegian krone (NOK)), `PLN` (Polish zloty (PLN)), `CZK` (Czech koruna (CZK)), `RON` (Romanian leu (RON)), and 13 more.
- Probability (%) (`probability`, number): The chance of winning, from 0 to 100. From 0 to 100.
- Expected closing date (`closing_date`, date): When the deal is expected to close.
- Purchase order number (`purchase_order_number`, text): The customer's purchase order number.

**Outputs**

- `deal` (object): The deal as it is now

**Example output**

```json
{
  "deal": {
    "closed_at": "example",
    "created_at": "example",
    "current_phase": {},
    "department": {},
    "estimated_closing_date": "example",
    "estimated_probability": 1,
    "estimated_value": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "lead": {},
    "lost_reason": {},
    "pipeline": {},
    "purchase_order_number": "example",
    "reference": "example",
    "responsible_user": {},
    "source": {},
    "status": "example",
    "summary": "example",
    "title": "example",
    "updated_at": "example",
    "web_url": "example",
    "weighted_value": {}
  }
}
```

### Update task

Change a task's title, due date, work type, assignee or links. Only the fields you fill in change.

**Inputs**

- Task ID (`task_id`, text, required): The task's id, from 'List tasks' or an earlier step.
- Title (`title`, text): A new title.
- Due date (`due_on`, date): A new due date.
- Work type (`work_type_id`, text): A new work type.
- Description (`description`, text): Details about the task.
- Assign to (`assignee_id`, text): The Teamleader user to give the task to. Leave empty to leave it unassigned.
- Estimated minutes (`estimated_minutes`, number): How long the task should take, in minutes. At least 1.
- Deal ID (`deal_id`, text): The deal the task belongs to, from 'List deals' or an earlier step.
- Customer type (`customer_type`, text): Whether the customer is a company or a contact. One of: `company`, `contact`.
- Customer ID (`customer_id`, text): The customer's id, from 'List companies', 'List contacts' or an earlier step.

**Outputs**

- `task` (object): The task as it is now

**Example output**

```json
{
  "task": {
    "assignee": {},
    "completed": true,
    "completed_at": "example",
    "customer": {},
    "deal": {},
    "description": "example",
    "due_on": "example",
    "estimated_duration": {},
    "id": "9d4096c3-813f-4bd5-b3c4-4091807b5b74",
    "priority": "example",
    "title": "example",
    "work_type": {}
  }
}
```
