Naar de inhoud
Menu

Zoeken op de site

Typ om te zoeken in handleidingen, blog, API en product.

↑ ↓ om te bewegen · Enter om te openen · Esc om te sluiten

API-referentie

API

Contacten

Bekijk en werk contactgegevens bij

Bekijken als Markdown

Contacten zijn de personen die met je agent praten via kanalen zoals WhatsApp, Instagram en e-mail. Elk contact heeft een profiel met naam, kanaal-ID's en optionele metadata.

MethodePadBeschrijving
GET/v1/contactsContacten weergeven
GET/v1/contacts/:idDetails van een contact bekijken
POST/v1/contactsEen contact aanmaken
PATCH/v1/contacts/:idEen contact bijwerken
PUT/v1/contactsAanmaken of bijwerken op telefoon of e-mail (upsert)
GET/v1/contacts?phone=|email=Contacten zoeken op telefoon of e-mail
PATCH/v1/contacts/:id/attributesContactattributen opslaan
PUT/v1/contacts/:id/stageHet contact in een fase van een funnel plaatsen
POST/v1/contacts/:id/eventsEen gebeurtenis aan de tijdlijn toevoegen

Het endpoint voor weergeven ondersteunt de volgende queryparameters:

ParameterTypeBeschrijving
limitnumberResultaten per pagina (standaard: 20, maximaal: 100)
offsetnumberAantal resultaten om over te slaan (standaard: 0)

Contacten weergeven

GET/v1/contacts
curl "https://rest-api.tbit.app/v1/contacts?limit=20&offset=0" \
  -H "X-API-Key: $TBIT_API_KEY"
const response = await fetch('https://rest-api.tbit.app/v1/contacts?limit=20&offset=0', {
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
  },
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.get(
  'https://rest-api.tbit.app/v1/contacts?limit=20&offset=0',
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.get(
    'https://rest-api.tbit.app/v1/contacts?limit=20&offset=0',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts?limit=20&offset=0');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Contactdetails ophalen

GET/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1
curl "https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1" \
  -H "X-API-Key: $TBIT_API_KEY"
const response = await fetch('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1', {
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
  },
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.get(
  'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1',
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.get(
    'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Contact bijwerken

PATCH/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1
curl -X PATCH "https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profile_name": "Jane Doe",
    "email": "[email protected]",
    "notes": "Preferred language: English"
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1', {
  method: 'PATCH',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    profile_name: 'Jane Doe',
    email: '[email protected]',
    notes: 'Preferred language: English',
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.patch(
  'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1',
  {
    profile_name: 'Jane Doe',
    email: '[email protected]',
    notes: 'Preferred language: English',
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.patch(
    'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'profile_name': 'Jane Doe',
        'email': '[email protected]',
        'notes': 'Preferred language: English',
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'profile_name' => 'Jane Doe',
        'email' => '[email protected]',
        'notes' => 'Preferred language: English',
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Contact aanmaken

De custom_attributes worden gevalideerd met dezelfde regels als «Attributen opslaan» voordat er iets wordt geschreven. Als een waarde niet klopt, antwoordt het 400 VALIDATION_ERROR met de reden per sleutel (Invalid custom_attributes: «sleutel»: «reden») en worden noch het contact noch de attributen opgeslagen. Een attribuut dat niet bestaat, wordt aangemaakt met het type dat uit de waarde wordt afgeleid.

POST/v1/contacts
curl -X POST "https://rest-api.tbit.app/v1/contacts" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "573009876543",
    "channel_type": "whatsapp",
    "profile_name": "Jane Doe",
    "custom_attributes": {
      "city": "Bogota",
      "plan": "premium"
    }
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    channel_id: '573009876543',
    channel_type: 'whatsapp',
    profile_name: 'Jane Doe',
    custom_attributes: {
      city: 'Bogota',
      plan: 'premium',
    },
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.post(
  'https://rest-api.tbit.app/v1/contacts',
  {
    channel_id: '573009876543',
    channel_type: 'whatsapp',
    profile_name: 'Jane Doe',
    custom_attributes: {
      city: 'Bogota',
      plan: 'premium',
    },
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.post(
    'https://rest-api.tbit.app/v1/contacts',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'channel_id': '573009876543',
        'channel_type': 'whatsapp',
        'profile_name': 'Jane Doe',
        'custom_attributes': {
            'city': 'Bogota',
            'plan': 'premium',
        },
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'channel_id' => '573009876543',
        'channel_type' => 'whatsapp',
        'profile_name' => 'Jane Doe',
        'custom_attributes' => [
            'city' => 'Bogota',
            'plan' => 'premium',
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Zoekt het contact van je agent op WhatsApp (E.164, met of zonder «+») en, als dat niet gevonden wordt, op e-mail. Als het niet bestaat, wordt het aangemaakt; als het bestaat, wordt het ontbrekende kanaal toegevoegd. Een naam die het contact al heeft, wordt nooit overschreven. Antwoordt 201 bij aanmaken en 200 bij vinden.

Als het telefoonnummer en het e-mailadres bij twee verschillende contacten horen, antwoordt het 409 CONTACT_CONFLICT met beide id's en wordt er niets geschreven. De attributen die je stuurt, worden gevalideerd voordat het contact wordt aangeraakt (zie «Attributen opslaan»).

PUT/v1/contacts
curl -X PUT "https://rest-api.tbit.app/v1/contacts" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+573001234567",
    "email": "[email protected]",
    "first_name": "Ana",
    "last_name": "Pérez",
    "attributes": {
      "plan": "premium"
    }
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts', {
  method: 'PUT',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    phone: '+573001234567',
    email: '[email protected]',
    first_name: 'Ana',
    last_name: 'Pérez',
    attributes: {
      plan: 'premium',
    },
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.put(
  'https://rest-api.tbit.app/v1/contacts',
  {
    phone: '+573001234567',
    email: '[email protected]',
    first_name: 'Ana',
    last_name: 'Pérez',
    attributes: {
      plan: 'premium',
    },
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.put(
    'https://rest-api.tbit.app/v1/contacts',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'phone': '+573001234567',
        'email': '[email protected]',
        'first_name': 'Ana',
        'last_name': 'Pérez',
        'attributes': {
            'plan': 'premium',
        },
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'phone' => '+573001234567',
        'email' => '[email protected]',
        'first_name' => 'Ana',
        'last_name' => 'Pérez',
        'attributes' => [
            'plan' => 'premium',
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
Response
{
  "data": {
    "created": true,
    "matched_by": null,
    "contact": {
      "id": "64f1a2b3c4d5e6f7a8b9c0d1",
      "first_name": "Ana",
      "last_name": "Pérez",
      "profile_name": "Ana Pérez",
      "phone": "573001234567",
      "email": "[email protected]",
      "channels": [
        {
          "channel_type": "whatsapp",
          "channel_id": "573001234567"
        },
        {
          "channel_type": "email",
          "channel_id": "[email protected]"
        }
      ],
      "attributes": {
        "plan": "premium",
        "ciudad": "Bogotá"
      },
      "stages": [
        {
          "funnel_id": "64f1a2b3c4d5e6f7a8b9c0aa",
          "funnel_name": "Clientes",
          "stage": "prueba",
          "stage_name": "En prueba"
        }
      ],
      "created_at": "2026-10-01T12:00:00.000Z",
      "updated_at": "2026-10-08T15:00:00.000Z"
    }
  }
}

Geeft tot 10 contacten van je agent terug met dat WhatsApp-nummer (in welke schrijfwijze dan ook) of dat e-mailadres, met hun attributen en de funnelfases waarin ze zich bevinden. Zonder phone of email blijft het endpoint de gebruikelijke gepagineerde lijst.

GET/v1/contacts
curl "https://rest-api.tbit.app/v1/contacts?email=ana%40example.com" \
  -H "X-API-Key: $TBIT_API_KEY"
const response = await fetch('https://rest-api.tbit.app/v1/contacts?email=ana%40example.com', {
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
  },
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.get(
  'https://rest-api.tbit.app/v1/contacts?email=ana%40example.com',
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.get(
    'https://rest-api.tbit.app/v1/contacts?email=ana%40example.com',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts?email=ana%40example.com');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
Response
{
  "data": [
    {
      "id": "64f1a2b3c4d5e6f7a8b9c0d1",
      "first_name": "Ana",
      "last_name": "Pérez",
      "profile_name": "Ana Pérez",
      "phone": "573001234567",
      "email": "[email protected]",
      "channels": [
        {
          "channel_type": "whatsapp",
          "channel_id": "573001234567"
        },
        {
          "channel_type": "email",
          "channel_id": "[email protected]"
        }
      ],
      "attributes": {
        "plan": "premium",
        "ciudad": "Bogotá"
      },
      "stages": [
        {
          "funnel_id": "64f1a2b3c4d5e6f7a8b9c0aa",
          "funnel_name": "Clientes",
          "stage": "prueba",
          "stage_name": "En prueba"
        }
      ],
      "created_at": "2026-10-01T12:00:00.000Z",
      "updated_at": "2026-10-08T15:00:00.000Z"
    }
  ]
}

Attributen opslaan

De sleutels zijn de NAAM van het attribuut, zoals te zien in «Contactgegevens» (ongeacht hoofdletters of accenten). Alles of niets: als een sleutel niet bestaat, antwoordt het 422 UNKNOWN_ATTRIBUTES met de lijst in details.missing, en als een waarde niet in het type past (een optie die niet in de lijst staat, een getal dat geen getal is, een datum die niet te lezen is), antwoordt het 422 INVALID_VALUE; in beide gevallen wordt er niets opgeslagen.

Datums: vier vormen worden geaccepteerd: volledige datum (2026-11-14), jaar en maand (2026-11), dag en maand zonder jaar (--11-14) of alleen de maand (--11). Een datum met tijd (2026-11-14T15:00:00Z) wordt opgeslagen als de dag ervan, en de API geeft hem altijd zonder tijd terug (2026-11-14). Lijsten van objecten, zoals «Speciale datums»: elk item wordt tegen zijn schema gevalideerd. De datumvelden gebruiken die vier vormen, de verplichte mogen niet leeg zijn en de keuzelijsten moeten een van de lijst zijn (ongeacht hoofdletters of accenten; wordt opgeslagen zoals de optie).

Met create_missing: true worden de ontbrekende aangemaakt (het type wordt afgeleid uit de waarde). null wist de waarde. Elke nieuwe waarde telt als «ingevuld attribuut»: een funnel met een regel voor dat attribuut verplaatst de kaart net zoals wanneer de AI hem invult.

PATCH/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes
curl -X PATCH "https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "attributes": {
      "plan": "premium",
      "ciudad": "Bogotá"
    },
    "create_missing": false
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes', {
  method: 'PATCH',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    attributes: {
      plan: 'premium',
      ciudad: 'Bogotá',
    },
    create_missing: false,
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.patch(
  'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes',
  {
    attributes: {
      plan: 'premium',
      ciudad: 'Bogotá',
    },
    create_missing: false,
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.patch(
    'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'attributes': {
            'plan': 'premium',
            'ciudad': 'Bogotá',
        },
        'create_missing': False,
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/attributes');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'attributes' => [
            'plan' => 'premium',
            'ciudad' => 'Bogotá',
        ],
        'create_missing' => false,
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
Response
{
  "data": {
    "id": "64f1a2b3c4d5e6f7a8b9c0d1",
    "attributes": {
      "plan": "premium",
      "ciudad": "Bogotá"
    },
    "updated": [
      "plan",
      "ciudad"
    ],
    "created_attributes": []
  }
}

Geef de funnel aan via funnel_id of via zijn naam (funnel) en de fase via zijn slug. Als het contact niet in die funnel zit, voegt hij hem toe; als hij in een andere fase zit, verplaatst hij hem; als hij al daar zit, doet hij niets (changed: false). De acties bij binnenkomst van de fase worden uitgevoerd en het blijft in de geschiedenis van het contact staan.

Standaard gaat de bel van het team niet af: stuur notify: true als je de melding wilt. Fouten: 404 FUNNEL_NOT_FOUND en 422 UNKNOWN_STAGE (met de lijst van fasen).

PUT/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage
curl -X PUT "https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "funnel": "Clientes",
    "stage": "prueba"
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage', {
  method: 'PUT',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    funnel: 'Clientes',
    stage: 'prueba',
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.put(
  'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage',
  {
    funnel: 'Clientes',
    stage: 'prueba',
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.put(
    'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'funnel': 'Clientes',
        'stage': 'prueba',
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/stage');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'funnel' => 'Clientes',
        'stage' => 'prueba',
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
Response
{
  "data": {
    "id": "64f1a2b3c4d5e6f7a8b9c0d1",
    "funnel_id": "64f1a2b3c4d5e6f7a8b9c0aa",
    "stage": "prueba",
    "previous_stage": "registrado",
    "changed": true
  }
}

Laat een mijlpaal achter op de kaart van het contact, met zijn datum (occurred_at, standaard nu; mag niet in de toekomst liggen). Met idempotency_key wordt dezelfde gebeurtenis niet gedupliceerd: dezelfde aanroep herhalen antwoordt 200 met duplicate: true en de oorspronkelijke gebeurtenis. data accepteert tot 20 sleutels met tekst, nummer of booleaanse waarde.

Contacten van een andere agent antwoorden 404, net als een contact dat niet bestaat.

POST/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events
curl -X POST "https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events" \
  -H "X-API-Key: $TBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Empezó la prueba gratis",
    "description": "Termina el 15 de octubre",
    "occurred_at": "2026-10-08T15:00:00Z",
    "idempotency_key": "trial:64f1a2b3c4d5e6f7a8b9c0d1:2026-10-08",
    "data": {
      "plan": "monthly"
    }
  }'
const response = await fetch('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.TBIT_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Empezó la prueba gratis',
    description: 'Termina el 15 de octubre',
    occurred_at: '2026-10-08T15:00:00Z',
    idempotency_key: 'trial:64f1a2b3c4d5e6f7a8b9c0d1:2026-10-08',
    data: {
      plan: 'monthly',
    },
  }),
});
const data = await response.json();
import axios from 'axios';

const { data } = await axios.post(
  'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events',
  {
    name: 'Empezó la prueba gratis',
    description: 'Termina el 15 de octubre',
    occurred_at: '2026-10-08T15:00:00Z',
    idempotency_key: 'trial:64f1a2b3c4d5e6f7a8b9c0d1:2026-10-08',
    data: {
      plan: 'monthly',
    },
  },
  {
    headers: {
      'X-API-Key': process.env.TBIT_API_KEY,
    },
  },
);
import os
import requests

response = requests.post(
    'https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events',
    headers={'X-API-Key': os.environ['TBIT_API_KEY']},
    json={
        'name': 'Empezó la prueba gratis',
        'description': 'Termina el 15 de octubre',
        'occurred_at': '2026-10-08T15:00:00Z',
        'idempotency_key': 'trial:64f1a2b3c4d5e6f7a8b9c0d1:2026-10-08',
        'data': {
            'plan': 'monthly',
        },
    },
)
data = response.json()
<?php
$ch = curl_init('https://rest-api.tbit.app/v1/contacts/64f1a2b3c4d5e6f7a8b9c0d1/events');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: ' . getenv('TBIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'name' => 'Empezó la prueba gratis',
        'description' => 'Termina el 15 de octubre',
        'occurred_at' => '2026-10-08T15:00:00Z',
        'idempotency_key' => 'trial:64f1a2b3c4d5e6f7a8b9c0d1:2026-10-08',
        'data' => [
            'plan' => 'monthly',
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
Response
{
  "data": {
    "id": "6ac85d7e32e0335e1dcac4fd",
    "contact_id": "64f1a2b3c4d5e6f7a8b9c0d1",
    "name": "Empezó la prueba gratis",
    "occurred_at": "2026-10-08T15:00:00.000Z",
    "duplicate": false
  }
}

De list-endpoints geven gepagineerde resultaten terug:

json
{
  "data": [
    {
      "id": "64f1a2b3c4d5e6f7a8b9c0d1",
      "profile_name": "Jane Doe",
      "email": "[email protected]",
      "notes": "Preferred language: English",
      "channels": [
        {
          "channel_id": "573001234567",
          "channel_type": "whatsapp"
        }
      ],
      "custom_attributes": {
        "city": "Bogota",
        "plan": "premium"
      },
      "created_at": "2024-09-01T12:00:00Z",
      "updated_at": "2024-09-01T14:30:00Z"
    }
  ],
  "pagination": {
    "total": 50,
    "limit": 20,
    "offset": 0,
    "has_more": true
  }
}