> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Search people

POST https://api-sandbox.payabli.com/api/v2/people/search
Content-Type: application/json

Searches for people by identity attributes during boarding. The search
covers every business in your organization, so use it to find a person
before you create them again. To read the people already on a
paypoint's business, use a standard `GET` instead.
Provide at least one of `firstName` or `lastName`. Each result has a
`matchScore` showing how closely it matches, and an external identity
vendor can enrich the results. Each result's `dateOfBirth` is masked.
To get the full value, use the unmasked search.


Reference: https://docs.payabli.com/developers/api-reference/search-people

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Query parameters

- `entry` (string, required) — The entry name of your organization, from `OrgEntryName` on the organization. With a paypoint's entry name instead, the search covers only that paypoint's business.
- `orgId` (long, required) — The ID of your organization.

### Body (application/json)

This endpoint expects a PeopleSearchRequest.

- `PeopleSearchRequest`

## Response

### 200

The search results.

- `success` (boolean, required) — Whether the request succeeded.
- `message` (string, required, nullable) — A human-readable result message.
- `traceId` (string, required, nullable) — The trace identifier for the request, useful for support.
- `data` (PeopleSearchResultsResponse, required, nullable) — The search results.

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 403 Forbidden Error

Consent error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### PeopleSearchResultsResponse

The results of a people search.

- `results` (list of PeopleSearchResultResponse, required, nullable) — The matched records.
- `total` (integer, required) — The total number of matches.
- `isEnrichedByVendor` (boolean, required) — Whether the person was sent to the identity vendor for evaluation.

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### PeopleSearchResultResponse

A single identity match returned by a search.

- `personReference` (string, optional, nullable) — The person reference of the matching existing person. Null when `isFromVendor` is `true`.
- `firstName` (string, optional, nullable) — The matched first name.
- `lastName` (string, optional, nullable) — The matched last name.
- `dateOfBirth` (string, optional, nullable) — The matched date of birth. The standard search masks it (for example `****-**-14`), and the unmasked search returns the full `YYYY-MM-DD` value.
- `primaryEmail` (string, optional, nullable) — The matched primary email address.
- `primaryPhone` (string, optional, nullable) — The matched primary phone number.
- `riskDecision` (string, optional, nullable) — The risk decision for the match.
- `matchScore` (double, optional, nullable) — How closely the record matches the search criteria.
- `isTopMatch` (boolean, optional, nullable) — Whether this is the highest-scoring match.
- `isFromVendor` (boolean, optional, nullable) — When `true`, no existing person matched, and this result comes only from the identity vendor. A vendor result has no `personReference`.
- `phones` (list of string, optional) — The person's phone numbers.
- `emails` (list of string, optional) — The person's email addresses.
- `addressCount` (integer, optional) — The number of addresses on file for the person.
- `phoneCount` (integer, optional) — The number of phone numbers on file for the person.
- `emailCount` (integer, optional) — The number of email addresses on file for the person.

## Examples

**Request**

```json
{
  "firstName": "Marcus",
  "lastName": "Delgado"
}
```

**Response**

```json
{
  "success": true,
  "message": "People search completed",
  "traceId": "0HNONVR8FH4GO:00000030",
  "data": {
    "results": [
      {
        "personReference": "01a0014d-ce1a-7110-9bac-c4c59647a88d",
        "firstName": "Marcus",
        "lastName": "Delgado",
        "dateOfBirth": "****-**-14",
        "primaryEmail": "marcus.delgado@example.com",
        "primaryPhone": "+13055551212",
        "riskDecision": null,
        "matchScore": 0.6,
        "isTopMatch": true,
        "isFromVendor": false,
        "phones": [
          "+13055551212"
        ],
        "emails": [
          "marcus.delgado@example.com"
        ],
        "addressCount": 0,
        "phoneCount": 1,
        "emailCount": 1
      }
    ],
    "total": 1,
    "isEnrichedByVendor": false
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/v2/people/search"

querystring = {"entry":"8cfec329267","orgId":"123"}

payload = {
    "firstName": "Marcus",
    "lastName": "Delgado"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"firstName":"Marcus","lastName":"Delgado"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123"

	payload := strings.NewReader("{\n  \"firstName\": \"Marcus\",\n  \"lastName\": \"Delgado\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"firstName\": \"Marcus\",\n  \"lastName\": \"Delgado\"\n}"

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.post("https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"Marcus\",\n  \"lastName\": \"Delgado\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123', [
  'body' => '{
  "firstName": "Marcus",
  "lastName": "Delgado"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"firstName\": \"Marcus\",\n  \"lastName\": \"Delgado\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "firstName": "Marcus",
  "lastName": "Delgado"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/people/search?entry=8cfec329267&orgId=123")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```