---
agentTools:
  projectIndex: https://rampwin-api.readme.io/llms.txt
---

# Search Contact

Fetches a contact for a specific integration (channel) with support for sorting and filtering.

## Endpoint

`POST /api/contacts/v3/page`

**Base URL**

```Text URL
https://api.rampwin.com
```

***

## Description

Retrieves contacts based on pagination, sorting, and filter criteria.

### Supports

* Pagination (page & page size)
* Sorting (ascending/descending)
* Search filters (contains, equals, etc.)
* Page count control
* Channel-specific contact retrieval

***

## Authentication

This API requires:

* JWT Bearer Token

***

## Headers

| Header          | Type   | Required | Description                       |
| --------------- | ------ | -------- | --------------------------------- |
| Content-Type    | string | Yes      | application/json;charset=UTF-8    |
| Accept          | string | Yes      | application/json, text/plain, */* |
| Authorization   | string | Yes      | bearer\_token                     |
| Origin          | string | No       | `https://app.rampwin.com`         |
| Referer         | string | No       | `https://app.rampwin.com/`        |
| Accept-Language | string | No       | Language preferences              |
| User-Agent      | string | No       | Client user agent                 |

***

## Request Body

| Field             | Type   | Required | Description                                |
| ----------------- | ------ | -------- | ------------------------------------------ |
| page              | number | Yes      | Page number (starts from 1)                |
| pageSize          | number | Yes      | Number of records per page                 |
| integrationId     | string | Yes      | Channel / Integration ID                   |
| sortFilter        | array  | No       | Sorting configuration                      |
| pageCountRequired | string | No       | "yes" to include total page count          |
| fitlers *(typo)*  | array  | No       | Filtering conditions (nested array format) |

***

## Sort Filter Object

| Field | Type   | Required | Description                  |
| ----- | ------ | -------- | ---------------------------- |
| field | string | Yes      | Field name (e.g., updatedAt) |
| order | string | Yes      | asc / desc                   |

***

## Filter Object

| Field        | Type   | Required | Description                        |
| ------------ | ------ | -------- | ---------------------------------- |
| field\_name  | string | Yes      | Field to filter (e.g., full\_name) |
| operator     | string | Yes      | contains, equals, etc.             |
| field\_value | string | Yes      | Value to match                     |

***

## Example Request

```curl
curl --location 'https://api.rampwin.com/api/contacts/v3/page' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: Bearer YOUR_TOKEN' \
--header 'content-type: application/json;charset=UTF-8' \
--data-raw '{
  "page": 1,
  "pageSize": 10,
  "integrationId": "Your_Channel_ID",
  "sortFilter": [
    {
      "field": "updatedAt",
      "order": "desc"
    }
  ],
  "pageCountRequired": "yes",
  "fitlers": [
    [
      {
        "field_name": "full_name",
        "operator": "contains",
        "field_value": "John"
      }
    ]
  ]
}'
```

***

## Response

### Success (200)

```json
{
  "success": true,
  "data": {
    "contacts": [
      {
        "_id": "contact_id",
        "full_name": "John Doe",
        "phone_number": "91XXXXXXXXXX",
        "updatedAt": "2026-05-04T10:00:00Z"
      }
    ],
    "page": 1,
    "pageSize": 10,
    "totalPages": 5
  }
}
```

***

### Error (400)

```json
{
  "success": false,
  "errors": {
    "message": "Invalid request parameters"
  }
}
```

***

## Business Logic Notes

* `integrationId` is mandatory to scope contacts to a specific channel
* `fitlers` is expected as a nested array (AND/OR logic handled internally)
* If `pageCountRequired = "yes"`\
  → Total page count will be returned in response

***

## Common Errors

| Error                 | Description                   |
| --------------------- | ----------------------------- |
| Invalid token         | Unauthorized access           |
| Validation error      | Missing or incorrect fields   |
| Invalid filter        | Unsupported operator or field |
| Integration not found | Invalid channel ID            |