---
updatedAt: 2025-10-08T23:40:57.000Z
agentTools:
  projectIndex: https://docs.onfleet.com/llms.txt
---

# Task Custom Fields - Search

Search a task with specific custom field(s) and value(s)

This is a POST request. <https://onfleet.com/api/v2/tasks/customFields/search>

This endpoint allows users to query tasks by a specific custom field key-value pair, returning all tasks that match the provided criteria. Instead of using JSON brackets, users only need to supply an array of key-value objects. The response will return all tasks that contain the queried key-value pair.

Request Fields:

| Name  | Type   | Description                       |
| :---- | :----- | :-------------------------------- |
| Key   | String | Unique identifier.                |
| Value | Object | The desired value for this field. |

Example payload:

```json Example Object to attach to Task
[
    {
        "key": "c1",
        "value": "hello"
    }
]
```
```json Multiple key/value payload
[
    {
        "key": "c1",
        "value": "hello"
    },
    {
        "key": "c2",
        "value": "world"
    }
]
```

> 📘 Empty Value
>
> If the custom field has an empty value, omit the key-value pair object from the array to ensure the endpoint returns the correct results.