> This page is for Omni Channel.

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

# List contacts

GET https://omni-channel.hams.ai/api/v1/accounts/{account_id}/developer/contacts

Returns the contacts of the account, 20 on each page. The list includes only contacts with an email address, a phone number, or an identifier.


Reference: https://docs.hams.ai/omni-channel/reference/contacts/list-contacts

## Authentication

- `api_access_token` header (required) — An API key that an administrator creates in **Settings** > **Developer**. The personal access token of a user does not work. A key reaches every inbox, conversation, and contact in the account that created it, and nothing in other accounts.

## Request

### Path parameters

- `account_id` (integer, required) — The id of your account. It is the number after `/accounts/` in the dashboard URL.

### Query parameters

- `page` (integer, optional, default: 1) — The page number. The first page is `1`.
- `labels[]` (list of string, optional) — Return only contacts with 1 of these labels.
- `sort` (string, optional) — The sort order. The values are `name`, `email`, `phone_number`, `last_activity_at`, `created_at`, `company_name`, `city`, and `country`. Put `-` before the value for the reverse order.

## Response

### 200

A page of contacts.

- `meta` (ContactListMeta, optional)
- `payload` (list of Contact, optional)

## Errors

### 401 Unauthorized Error

The token does not exist, is not an API key, or belongs to another account. The token can also be the token of a user who is not a member of the account, or the account can be suspended. The body has only the `error` field.

- `error` (string, required) — `Invalid Access Token`, `Key is not authorized to access this account`, `Access to this endpoint is not authorized for this token`, `You are not authorized to access this account`, or `Account is suspended`.

## Types

### ContactListMeta

- `count` (integer, optional)
- `current_page` (integer, optional)

### Contact

- `id` (integer, optional)
- `name` (string, optional)
- `email` (string, optional, nullable)
- `phone_number` (string, optional, nullable) — E.164, for example `+971500000000`.
- `identifier` (string, optional, nullable) — Your own id for the contact. It is unique in the account.
- `blocked` (boolean, optional)
- `availability_status` (string, optional)
- `thumbnail` (string, optional)
- `custom_attributes` (map from string to any, optional)
- `additional_attributes` (map from string to any, optional)
- `last_activity_at` (integer, optional) — Unix timestamp, in seconds.
- `created_at` (integer, optional) — Unix timestamp, in seconds.
- `contact_inboxes` (list of map from string to any, optional) — The inboxes where the contact has an address.

## Examples

**Response**

```json
{
  "meta": {
    "count": 1,
    "current_page": 1
  },
  "payload": [
    {
      "id": 1,
      "name": "string",
      "email": "string",
      "phone_number": "string",
      "identifier": "string",
      "blocked": true,
      "availability_status": "string",
      "thumbnail": "string",
      "custom_attributes": {},
      "additional_attributes": {},
      "last_activity_at": 1,
      "created_at": 1,
      "contact_inboxes": [
        {}
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts"

headers = {"api_access_token": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts';
const options = {method: 'GET', headers: {api_access_token: '<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://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts"

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

	req.Header.Add("api_access_token", "<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://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts")

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

request = Net::HTTP::Get.new(url)
request["api_access_token"] = '<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://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts")
  .header("api_access_token", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts', [
  'headers' => [
    'api_access_token' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts");
var request = new RestRequest(Method.GET);
request.AddHeader("api_access_token", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["api_access_token": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://omni-channel.hams.ai/api/v1/accounts/1/developer/contacts")! 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()
```