> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List persons

> Query and filter persons in your organization — for person entities in the gu1 KYC and risk analysis platform, with examples for list use cases.

## Overview

Retrieves a list of persons with optional filtering by country, tax ID, or external ID. Returns up to 100 persons per request.

## Endpoint

```
GET http://api.gu1.ai/entities?type=person
```

## Authentication

Requires a valid API key in the Authorization header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Query Parameters

<ParamField query="type" type="string" required>
  Must be set to `person` to retrieve only persons
</ParamField>

<ParamField query="country" type="string">
  Filter by ISO 3166-1 alpha-2 country code (e.g., "US", "BR", "AR")
</ParamField>

<ParamField query="taxId" type="string">
  Filter by exact tax identification number
</ParamField>

<ParamField query="externalId" type="string">
  Filter by your external identifier
</ParamField>

## Response

<ResponseField name="entities" type="array">
  Array of person objects, each containing:

  * `id` - gu1's internal ID
  * `externalId` - Your external ID
  * `organizationId` - Your organization ID
  * `type` - Always "person"
  * `name` - Person name
  * `taxId` - Tax ID
  * `countryCode` - Country code
  * `riskScore` - Risk score (0-100)
  * `riskFactors` - Array of risk factors
  * `status` - Person status
  * `kycVerified` - KYC verification status
  * `kycProvider` - KYC provider name
  * `kycData` - KYC verification data
  * `entityData` - Person-specific data
  * `attributes` - Custom attributes
  * `createdAt` - Creation timestamp
  * `updatedAt` - Last update timestamp
  * `deletedAt` - Deletion timestamp (null if active)
</ResponseField>

## Examples

### List All Persons

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "http://api.gu1.ai/entities?type=person" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://api.gu1.ai/entities?type=person', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(`Found ${data.entities.length} persons`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'http://api.gu1.ai/entities',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY'
      },
      params={'type': 'person'}
  )

  data = response.json()
  print(f"Found {len(data['entities'])} persons")
  ```
</CodeGroup>

### Filter by Country

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "http://api.gu1.ai/entities?type=person&country=BR" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'http://api.gu1.ai/entities?type=person&country=BR',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  console.log(`Found ${data.entities.length} Brazilian customers`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'http://api.gu1.ai/entities',
      headers={'Authorization': 'Bearer YOUR_API_KEY'},
      params={
          'type': 'person',
          'country': 'BR'
      }
  )

  brazilian_customers = response.json()['entities']
  print(f"Found {len(brazilian_customers)} Brazilian customers")
  ```
</CodeGroup>

### Find by External ID

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "http://api.gu1.ai/entities?type=person&externalId=customer_12345" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'http://api.gu1.ai/entities?type=person&externalId=customer_12345',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  const person = data.entities[0]; // External IDs should be unique
  console.log('Found person:', person.name);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'http://api.gu1.ai/entities',
      headers={'Authorization': 'Bearer YOUR_API_KEY'},
      params={
          'type': 'person',
          'externalId': 'customer_12345'
      }
  )

  entities = response.json()['entities']
  if entities:
      print(f"Found person: {entities[0]['name']}")
  ```
</CodeGroup>

### Find by Tax ID

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "http://api.gu1.ai/entities?type=person&taxId=20-12345678-9" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'http://api.gu1.ai/entities?type=person&taxId=20-12345678-9',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  if (data.entities.length > 0) {
    console.log('Person found:', data.entities[0].name);
  }
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'http://api.gu1.ai/entities',
      headers={'Authorization': 'Bearer YOUR_API_KEY'},
      params={
          'type': 'person',
          'taxId': '20-12345678-9'
      }
  )

  entities = response.json()['entities']
  if entities:
      print(f"Person found: {entities[0]['name']}")
  ```
</CodeGroup>

## Response Example

```json theme={null}
{
  "entities": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "externalId": "customer_12345",
      "organizationId": "8e2f89ab-c216-4eb4-90eb-ca5d44499aaa",
      "type": "person",
      "name": "María González",
      "taxId": "20-12345678-9",
      "countryCode": "AR",
      "riskScore": 25,
      "riskFactors": [
        {
          "factor": "new_customer",
          "impact": 15,
          "description": "Customer registered within last 30 days"
        }
      ],
      "status": "active",
      "kycVerified": true,
      "kycProvider": "gueno_ai",
      "kycData": {
        "verificationDate": "2024-10-03T14:30:00Z",
        "overallStatus": "approved"
      },
      "entityData": {
        "person": {
          "firstName": "María",
          "lastName": "González",
          "dateOfBirth": "1985-03-15",
          "nationality": "AR",
          "occupation": "Software Engineer",
          "income": 85000
        }
      },
      "attributes": {
        "email": "maria.gonzalez@example.com",
        "phone": "+54 11 1234-5678"
      },
      "createdAt": "2024-10-03T14:30:00.000Z",
      "updatedAt": "2024-10-03T14:35:00.000Z",
      "deletedAt": null
    }
  ]
}
```

## Use Cases

### High Risk Customer Monitoring

Query all persons and filter by risk score:

```javascript theme={null}
const response = await fetch('http://api.gu1.ai/entities?type=person', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});

const data = await response.json();
const highRiskCustomers = data.entities.filter(e => e.riskScore > 70);

console.log(`Found ${highRiskCustomers.length} high-risk customers requiring review`);
highRiskCustomers.forEach(person => {
  console.log(`- ${person.name} (Risk: ${person.riskScore})`);
});
```

### KYC Compliance Dashboard

Get all unverified customers for compliance dashboard:

```python theme={null}
import requests

response = requests.get(
    'http://api.gu1.ai/entities',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={'type': 'person'}
)

persons = response.json()['entities']
unverified = [p for p in persons if not p['kycVerified']]

print(f"Unverified customers: {len(unverified)}")
for person in unverified:
    print(f"- {person['name']} ({person['externalId']})")
```

## Error Responses

### 401 Unauthorized

```json theme={null}
{
  "error": "Invalid or missing API key"
}
```

### 500 Internal Server Error

```json theme={null}
{
  "error": "Failed to search entities"
}
```

## Limits

* **Maximum results per request**: 100 persons
* **Query parameters**: Can be combined for advanced filtering
* **Rate limits**: Apply based on your plan tier

## Next Steps

* [Get Person Details](/en/api-reference/person/get) - Retrieve complete information for a specific person
* [Create Person](/en/api-reference/person/create) - Add new persons to your organization
* [Update Person](/en/api-reference/person/update) - Modify person attributes
