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

# Check Customer Exists

> Check whether a customer exists in a campaign using a loan ID, lead ID, or phone number.

### Headers

**Authorization** `string` *required*

Bearer token for authentication (e.g., `Bearer <your_token>`).

**X-ORG-ID** `string`

Optional. Use this header only when the authenticated user belongs to multiple organizations. It identifies the organization to target for this action.

### Body Parameters

**campaignId** `string` *required*

The unique identifier of the campaign to search.

> [!NOTE]
>
> Provide exactly one of `loan_id`, `lead_id`, or `phone_number`.

**loan\_id** `string`

The loan ID to search for. Use for `debt_collection` organizations.

**lead\_id** `string`

The lead ID to search for. Use for `lead_generation` organizations.

**phone\_number** `string`

The customer's phone number to search for.

### Response

**success** `boolean`

Indicates whether the request was successful.

**exists** `boolean`

Whether a matching customer exists in the campaign.

```json 200 OK theme={null}
{
  "success": true,
  "exists": true
}
```

```json 400 Bad Request theme={null}
{
  "success": false,
  "message": "Validation failed",
  "errors": [
    "Provide exactly one of loan_id, lead_id, or phone_number"
  ]
}
```

```json 401 Unauthorized theme={null}
{
  "success": false,
  "error": "Unauthorized",
  "message": "Missing or invalid authorization header"
}
```

```json 403 Forbidden theme={null}
{
  "success": false,
  "error": "Forbidden",
  "message": "You don't have the required permission to perform this action"
}
```

```json 500 Server Error theme={null}
{
  "success": false,
  "error": "InternalServerError",
  "message": "An unexpected error occurred"
}
```

## Error Codes

| Status | Description |
| - | - |
| `400` | Validation error - `campaignId` is required, or exactly one customer identifier must be provided |
| `401` | Unauthorized - missing or invalid authorization header |
| `403` | Forbidden - insufficient permission to access the campaign customers |
| `500` | Internal server error |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.