Klantly Developers

Quickstart

From a new API key to your first customer through the API, in five minutes.

1. Create an API key

In Klantly, go to Integrations → API and choose New key. Give the key a name, choose Full access and click Create key. Copy the key right away: you will never see it again.

Warning

Never put a key in the code of a website or app. Store it on your server, for example in an environment variable.

Terminal
export KLANTLY_API_KEY="kly_..."

2. Test your connection

cURL
curl "https://app.klantly.com/api/v1/me" \
  -H "Authorization: Bearer $KLANTLY_API_KEY"
PHP
$client = new \GuzzleHttp\Client([
    'base_uri' => 'https://app.klantly.com/api/v1/',
    'headers' => ['Authorization' => 'Bearer ' . getenv('KLANTLY_API_KEY')],
]);

$response = $client->request('GET', 'me');
$me = json_decode((string) $response->getBody(), true)['data'];

echo $me['company']['name'];
JavaScript
const response = await fetch('https://app.klantly.com/api/v1/me', {
  headers: { Authorization: `Bearer ${process.env.KLANTLY_API_KEY}` },
});
const { data } = await response.json();

console.log(data.company.name);
Python
import os

import requests

response = requests.get(
    "https://app.klantly.com/api/v1/me",
    headers={"Authorization": f"Bearer {os.environ['KLANTLY_API_KEY']}"},
)
print(response.json()["data"]["company"]["name"])

If everything is in order, you get your key, your company and your limits back. Getting an error? Check the error codes.

3. Create your first customer

Send a POST to /customers with at least an email address:

Body
{
  "email": "jan@example.com",
  "name": "Jan de Vries",
  "type": "business",
  "company_name": "De Vries Bouw"
}
cURL
curl -X POST "https://app.klantly.com/api/v1/customers" \
  -H "Authorization: Bearer $KLANTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2d3e-4a5b-4c6d-8e7f-9a0b1c2d3e4f" \
  -d '{"email": "jan@example.com", "name": "Jan de Vries", "type": "business", "company_name": "De Vries Bouw"}'
PHP
$response = $client->request('POST', 'customers', [
    'headers' => ['Idempotency-Key' => '6f1c2d3e-4a5b-4c6d-8e7f-9a0b1c2d3e4f'],
    'json' => [
        'email' => 'jan@example.com',
        'name' => 'Jan de Vries',
        'type' => 'business',
        'company_name' => 'De Vries Bouw',
    ],
]);

$customer = json_decode((string) $response->getBody(), true)['data'];
JavaScript
const response = await fetch('https://app.klantly.com/api/v1/customers', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.KLANTLY_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': '6f1c2d3e-4a5b-4c6d-8e7f-9a0b1c2d3e4f',
  },
  body: JSON.stringify({
    email: 'jan@example.com',
    name: 'Jan de Vries',
    type: 'business',
    company_name: 'De Vries Bouw',
  }),
});
const { data: customer } = await response.json();
Python
response = requests.post(
    "https://app.klantly.com/api/v1/customers",
    headers={
        "Authorization": f"Bearer {os.environ['KLANTLY_API_KEY']}",
        "Idempotency-Key": "6f1c2d3e-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    },
    json={
        "email": "jan@example.com",
        "name": "Jan de Vries",
        "type": "business",
        "company_name": "De Vries Bouw",
    },
)
customer = response.json()["data"]

The response is 201 Created with the new customer. The customer shows up in Klantly right away, with an entry on the customer timeline, and the automations you have set up are triggered.

4. Next steps

Last updated on September 14, 2026