Skip to content
ChatterfyHelp Center
HomeGeneralCRMAI ManagerTrackerPlatformsAPIFAQUpdate log
Getting started
Chatterfy API: What It Is and How to Get Started
How to get an API key
API Key Permissions: Which Role to Assign
First API request in 5 minutes
Instructions
Help Center
API and AI
  1. API
  2. Getting started
  3. First API request in 5 minutes

First API request in 5 minutes

The first API request is a check that the key works. You will send a request to Chatterfy and receive your company in the response. Next, step-by-step, you will find the company, bot, and chat IDs — t

Updated November 2, 20264 min
The first API request is a check that the key works. You will send a request to Chatterfy and receive your company in the response.
Next, step-by-step, you will find the company, bot, and chat IDs — they are needed for almost all other requests. You don't need to program: the commands can be copied as is.



What you will need

  1. API key. How to get it — in the article How to get an API key.
  1. Service account added to the Space with the bot.
  1. One of the following programs: Terminal (available on macOS), PowerShell (available on Windows), or Postman (free, for any system).



Step 1. Check your API key

Проверьте API-ключ запросом POST /companies/v1/search с пустым телом {} — он вернёт вашу компанию. Выполните его в Терминале на macOS и Linux, в PowerShell на Windows или в Postman. Вместо ВАШ_КЛЮЧ вставьте свой ключ целиком.
Open Terminal, paste the command, and press Enter.
Терминалbash
curl -X POST 'https://api.chatterfy.ai/public-api/companies/v1/search' \
  -H 'ApiKey: ВАШ_КЛЮЧ' \
  -H 'Content-Type: application/json' \
  -d '{}'
Open PowerShell from the Start menu, paste the command, and press Enter.
PowerShellpowershell
$headers = @{ "ApiKey" = "ВАШ_КЛЮЧ" }
Invoke-RestMethod -Method Post `
  -Uri "https://api.chatterfy.ai/public-api/companies/v1/search" `
  -Headers $headers -ContentType "application/json" -Body "{}" |
  ConvertTo-Json -Depth 10
  1. In Postman, click New and select HTTP.
  1. To the left of the address bar, select the POST method. In the address bar, paste https://api.chatterfy.ai/public-api/companies/v1/search.
  1. On the Headers tab, add a row: in Key — ApiKey, in Value — your key.
  1. On the Body tab, select raw and the JSON format, enter {}.
  1. Click Send.
If everything is in order, you will receive a response with your company (some fields are hidden):
Ответjson
{
  "data": [
    {
      "id": "3f2a9c10-7b4e-4d21-a8f5-61c0e9b2d7a4",
      "name": "My Company",
      "access": {
        "company.read": "all"
      }
    }
  ],
  "pagination": {
    "has_more": false
  }
}
Copy the id value — this is the company ID. You will need it in the next step.
Got a 401 error?
missing_api_key — the ApiKey header was not passed. invalid_api_key — the key was not copied completely, contains an extra space, or has already been replaced with a new one. Other errors are explained in the article API Errors and Limits.



Step 2. Find the bot ID

Список ботов компании отдаёт POST /bots/v1/search с company_id в теле. Вместо ID_КОМПАНИИ вставьте id компании из шага 1. Команды для Терминала и PowerShell — на вкладках, в Postman поменяйте адрес и тело.
Терминалbash
curl -X POST 'https://api.chatterfy.ai/public-api/bots/v1/search' \
  -H 'ApiKey: ВАШ_КЛЮЧ' \
  -H 'Content-Type: application/json' \
  -d '{"company_id": "ID_КОМПАНИИ"}'
PowerShellpowershell
$headers = @{ "ApiKey" = "ВАШ_КЛЮЧ" }
$body = @{ company_id = "ID_КОМПАНИИ" } | ConvertTo-Json
Invoke-RestMethod -Method Post `
  -Uri "https://api.chatterfy.ai/public-api/bots/v1/search" `
  -Headers $headers -ContentType "application/json" -Body $body |
  ConvertTo-Json -Depth 10
Поменяйте адрес на https://api.chatterfy.ai/public-api/bots/v1/search, а в Body впишите {"company_id": "ID_КОМПАНИИ"}. Нажмите Send.
The response contains the bots that the service account has access to. Find the one you need using the name field and copy its id — this is the bot id.
Ответjson
{
  "data": [
    {
      "id": "0b7c2e64-5d1f-4a8e-9c3b-2f6d8e1a4b90",
      "name": "Sales bot",
      "space_id": "5a8d3f71-2e9b-4c06-b1f4-8e7a2c9d0b35",
      "status": "active"
    }
  ],
  "pagination": {
    "has_more": false
  }
}
An empty data list means the service account is not added to any Space with bots. Add it following the instructions How to get an API key.



Step 3. Find bot chats

Чаты бота отдаёт POST /chats/v1/search с bot_id в теле. Вместо ID_БОТА вставьте id бота из шага 2. Параметр limit — сколько чатов вернуть.
Терминалbash
curl -X POST 'https://api.chatterfy.ai/public-api/chats/v1/search' \
  -H 'ApiKey: ВАШ_КЛЮЧ' \
  -H 'Content-Type: application/json' \
  -d '{"bot_id": "ID_БОТА", "limit": 5}'
PowerShellpowershell
$headers = @{ "ApiKey" = "ВАШ_КЛЮЧ" }
$body = @{ bot_id = "ID_БОТА"; limit = 5 } | ConvertTo-Json
Invoke-RestMethod -Method Post `
  -Uri "https://api.chatterfy.ai/public-api/chats/v1/search" `
  -Headers $headers -ContentType "application/json" -Body $body |
  ConvertTo-Json -Depth 10
Адрес — https://api.chatterfy.ai/public-api/chats/v1/search, в Body — {"bot_id": "ID_БОТА", "limit": 5}.
You will receive five chats with the most recent correspondence. Each has an id — this is the chat id, client name in name, status in status, and the last message in last_message (some fields are hidden):
Ответjson
{
  "data": [
    {
      "id": "9d4e1b27-3c8a-4f6e-b2d1-7a5c0e8f3b62",
      "bot_id": "0b7c2e64-5d1f-4a8e-9c3b-2f6d8e1a4b90",
      "name": "Анна",
      "username": "anna_k",
      "status": "manual",
      "tags": [],
      "last_message": {
        "content": "Здравствуйте! Сколько стоит доставка?",
        "sender_type": "incoming"
      },
      "created_at": "2026-10-28T09:15:42Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "..."
  }
}
has_more: true means there are more chats than returned. How to get the next pages — in the article How to get chats and messages via API.



Step 4. Read chat correspondence

Сообщения чата отдаёт POST /messages/v1/search с chat_id в теле. Вместо ID_ЧАТА вставьте id чата из шага 3. order: desc — сначала новые сообщения.
Терминалbash
curl -X POST 'https://api.chatterfy.ai/public-api/messages/v1/search' \
  -H 'ApiKey: ВАШ_КЛЮЧ' \
  -H 'Content-Type: application/json' \
  -d '{"chat_id": "ID_ЧАТА", "limit": 10, "order": "desc"}'
PowerShellpowershell
$headers = @{ "ApiKey" = "ВАШ_КЛЮЧ" }
$body = @{ chat_id = "ID_ЧАТА"; limit = 10; order = "desc" } | ConvertTo-Json
Invoke-RestMethod -Method Post `
  -Uri "https://api.chatterfy.ai/public-api/messages/v1/search" `
  -Headers $headers -ContentType "application/json" -Body $body |
  ConvertTo-Json -Depth 10
Адрес — https://api.chatterfy.ai/public-api/messages/v1/search, в Body — {"chat_id": "ID_ЧАТА", "limit": 10, "order": "desc"}.
You will receive the 10 latest chat messages. content contains the text, sender_type shows who wrote: incoming — client, outcoming — your side.
Save the id
Save the company, bot, and chat IDs in a note. They do not change, and you will use them in requests in upcoming articles.



How to read an API response

What you see
What this means
Data without an error field
Request successful
data and pagination
This is a list. Entries are in data, information about the next page is in pagination
error with fields code, message, request_id
Error. code is a short name, message is an explanation, request_id is the request number for support
Header X-RateLimit-Remaining
How many requests can still be made in the current minute



Frequently asked questions

Terminal on macOS: Finder → Applications → Utilities → Terminal. PowerShell on Windows: click Start, type 'PowerShell', and open the application.

The curl command does not work in Windows PowerShell because curl is structured differently there than on macOS. Use the Windows tab with Invoke-RestMethod or Postman.

No, you cannot send an API request from a browser address bar: the browser will not transmit the ApiKey header, and most requests also use the POST method. Use Terminal, PowerShell, or Postman.

On a 401 response, verify that the API key is pasted in its entirety, without spaces or quotation marks at the edges, and that the header is named specifically ApiKey. If the key was replaced using the Reissue key button, the old one no longer works.

The command with the API key will be saved in the Terminal history on your computer. If you checked the key on someone else's or a public computer, issue a new key afterward.



Related

How to get an API key
An API key is a password that your program uses to log into Chatterfy. The key is not issued to you personally, but to a service account — a separate company member specifically for integrations. You
How to get chats and messages via API
Chats and messages via the API are read in two requests: first the list of bot chats, then the messages of the specific chat. This is the same as opening the bot in the application and tapping on a co
API Errors and Limits
An API error is a response where Chatterfy explains why it didn't complete a request. All errors look the same, so you can figure them out using two fields: the response code and code . This article e
How to connect Chatterfy API to your AI
Connecting the API to your AI means giving Claude, Cursor, ChatGPT, or another assistant an instruction and a key so it can send requests to Chatterfy on your behalf. You write 'show me who hasn't bee

Was this article helpful?

BackAPI Key Permissions: Which Role to Assign

On this page

  • What you will need
  • Step 1. Check your API key
  • Step 2. Find the bot ID
  • Step 3. Find bot chats
  • Step 4. Read chat correspondence
  • How to read an API response
  • Frequently asked questions
  • Related