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

# List customers

GET /persons

Returns a paginated list of resolved customers with search, segment and
attribute filters, and sorting.

Reference: https://docs.pivolio.com/api-reference/pivolio/customers/list-persons

## Authentication

- `X-Workspace-Id` header (required) — API Key authentication via header

## Request

### Query parameters

- `limit` (integer, optional, default: 50)
- `offset` (integer, optional, default: 0)
- `q` (string, optional, nullable) — Search name/email/id
- `identified` (boolean, optional, nullable)
- `country` (string, optional, nullable)
- `source` (string, optional, nullable)
- `segment` (enum, optional, nullable) — Saved customer segments (filter presets for the customers list).
  - Allowed values: `paying`, `identified`, `anonymous_high_intent`, `consent_denied`
- `sort` (enum, optional) — Server-sortable columns for the customers list.
  - Allowed values: `last_seen`, `events`, `revenue`, `created`
- `order` (enum, optional)
  - Allowed values: `asc`, `desc`

## Response

### 200

Successful Response

- `items` (list of PersonListItem, required)
- `total` (integer, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (string, required)
- `code` (string, required)
- `errors` (list of FieldError, optional, nullable)

## Types

### PersonListItem

A customer row — identity + denormalized rollups.

- `id` (string, required)
- `is_identified` (boolean, required)
- `country` (string, required)
- `source` (string, required)
- `event_count` (integer, required)
- `revenue_usd_cents` (integer, required)
- `created_at` (datetime, required)
- `consent` (ConsentSnapshot, required) — Consent statuses for dashboard display. Blank string means unanswered.
- `email` (string, optional, nullable)
- `name` (string, optional, nullable)
- `last_seen_at` (datetime, optional, nullable)

### FieldError

- `field` (string, required)
- `message` (string, required)

### ConsentSnapshot

Consent statuses for dashboard display. Blank string means unanswered.

- `ad_storage` (string, optional, default: )
- `analytics_storage` (string, optional, default: )
- `ad_user_data` (string, optional, default: )
- `ad_personalization` (string, optional, default: )

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "is_identified": true,
      "country": "US",
      "source": "website_signup",
      "event_count": 42,
      "created_at": "2023-11-20T14:22:00Z",
      "consent": {
        "ad_storage": "granted",
        "analytics_storage": "granted",
        "ad_user_data": "denied",
        "ad_personalization": "granted"
      },
      "email": "jane.doe@example.com",
      "name": "Jane Doe",
      "last_seen_at": "2024-01-15T09:30:00Z",
      "revenue_cents": 15999
    }
  ],
  "total": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/persons"

headers = {"X-Workspace-Id": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/persons';
const options = {method: 'GET', headers: {'X-Workspace-Id': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.example.com/persons"

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

	req.Header.Add("X-Workspace-Id", "<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.example.com/persons")

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

request = Net::HTTP::Get.new(url)
request["X-Workspace-Id"] = '<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.example.com/persons")
  .header("X-Workspace-Id", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/persons', [
  'headers' => [
    'X-Workspace-Id' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/persons");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Workspace-Id", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Workspace-Id": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/persons")! 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()
```