> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Get all tasks

GET https://api.brevo.com/v3/crm/tasks

Retrieve a paginated list of CRM tasks with optional filtering by task type, status, date range, assignee, and linked entities (contacts, deals, companies). Results are sorted by creation date in descending order by default, with a default limit of 50 tasks per page.

Reference: https://developers.brevo.com/reference/get-all-tasks

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.

## Request

### Query parameters

- `filter[type]` (string, optional) — Filter by task type (ID)
- `filter[status]` (enum, optional) — Filter by task status
  - Allowed values: `done`, `undone`
- `filter[date]` (enum, optional) — Filter by date
  - Allowed values: `overdue`, `today`, `tomorrow`, `week`, `range`
- `filter[assignTo]` (string, optional) — Filter by the "assignTo" ID. You can utilize account emails for the "assignTo" attribute.
- `filter[contacts]` (string, optional) — Filter by contact ids
- `filter[deals]` (string, optional) — Filter by deals ids
- `filter[companies]` (string, optional) — Filter by companies ids
- `dateFrom` (integer, optional) — dateFrom to date range filter type (timestamp in milliseconds)
- `dateTo` (integer, optional) — dateTo to date range filter type (timestamp in milliseconds)
- `offset` (long, optional) — Index of the first document of the page
- `limit` (long, optional, default: 50) — Number of documents per page
- `sort` (enum, optional) — Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
  - Allowed values: `asc`, `desc`
- `sortBy` (string, optional) — The field used to sort field names.

## Response

### 200

Returns task list with filters

- `items` (list of object, optional) — List of tasks
  - `taskTypeId` (string, required) — Id for type of task e.g Call / Email / Meeting etc.
  - `name` (string, required) — Name of task
  - `date` (datetime, required) — Task due date and time
  - `id` (string, optional) — Unique task id
  - `companiesIds` (list of string, optional) — Companies ids for companies a task is linked to
  - `dealsIds` (list of string, optional) — Deal ids for deals a task is linked to
  - `contactsIds` (list of integer, optional) — Contact ids for contacts linked to this task
  - `assignToId` (string, optional) — Account id of the user assigned to this task
  - `notes` (string, optional) — Notes added to a task
  - `done` (boolean, optional) — Whether the task is marked as done
  - `createdAt` (datetime, optional) — Task creation date/time
  - `updatedAt` (datetime, optional) — Task last update date/time

## Examples

**Response**

```json
{
  "items": [
    {
      "taskTypeId": "61a5cd07ca1347c82306ad09",
      "name": "Task: Connect with client",
      "date": "2021-11-01T17:44:54.668Z",
      "id": "61a5cd07ca1347c82306ad06",
      "companiesIds": [
        "61a5ce58c5d4795761045990",
        "61a5ce58c5d4795761045991",
        "61a5ce58c5d4795761045992"
      ],
      "dealsIds": [
        "61a5ce58c5d4795761045990",
        "61a5ce58c5d4795761045991",
        "61a5ce58c5d4795761045992"
      ],
      "contactsIds": [
        1,
        2,
        3
      ],
      "assignToId": "5faab4b7f195bb3c4c31e62a",
      "notes": "In communication with client for resolution of queries.",
      "done": false,
      "createdAt": "2021-11-01T17:44:54.668Z",
      "updatedAt": "2021-11-01T17:44:54.668Z"
    }
  ]
}
```

**SDK Code**

```typescript
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.tasks.getAllTasks({
        sortBy: "name",
    });
}
main();

```

```python
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.tasks.get_all_tasks(
    sort_by="name",
)

```

```php
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Tasks\Requests\GetCrmTasksRequest;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->tasks->getAllTasks(
    new GetCrmTasksRequest([
        'sortBy' => 'name',
    ]),
);

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/crm/tasks?sortBy=name"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/crm/tasks?sortBy=name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.brevo.com/v3/crm/tasks?sortBy=name")
  .header("api-key", "<apiKey>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/crm/tasks?sortBy=name");
var request = new RestRequest(Method.GET);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/crm/tasks?sortBy=name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```