Delta Key Documentation

API Protocol

How your CRM, accounting system, online store or website exchanges data with Delta Key AI employees.

The protocol works in two directions. Your system sends customers, events, request results and payment notifications to Delta Key. Delta Key sends your system customer lookup requests, customer requests, login verifications and conversation records. All requests are signed, so only a party holding the key can accept them.

Golden ruleThe exact URLs and keys are shown in your dashboard. Copy the full URL from the dashboard and do not build it manually: it already contains your company ID.

Base URL

All requests to Delta Key go to a single API URL:

Base URL
https://api.deltakey.app

HTTPS only. The request body is UTF-8 encoded JSON with the header Content-Type: application/json. The company ID in paths (<company GUID>) and the keys are shown in the dashboard next to each setting.

Keys and signature

There is no shared API password. Each exchange gets its own key, and every request is signed with that key using HMAC-SHA256:

  • Inbound key - for the customer database, customer events and request results, and for signing the lookups and requests that Delta Key sends to you. Issued in the dashboard: "Integrations" → "API Connection" tab → "Customer database" → "Issue key".
  • Event channel secret - for events sent to an AI employee channel. Shown when you create the channel: "Integrations" → "API Connection" tab → "Event channels".
  • Payment notification key - dashboard: "Integrations" → "API Connection" tab → "Payment notifications" → "Issue key" (issued by the company owner).
  • Form signing key - for verifying customer login in your system. Shown when you save the form: "Integrations" → "API Connection" tab → "Customer login verification".
  • Streaming secret - for conversation records that Delta Key sends to your URL. Shown when you connect: "Integrations" → "API Connection" tab → "Conversation streaming".

The key is shown only once. A new key immediately revokes the old one: requests with the old signature will receive the response 401.

Requests to Delta Key are signed as follows:

Request signature for Delta Key
X-AI2-Signature: hex(HMAC-SHA256(<raw request body>, <key>))

The signature is computed over the body byte for byte, exactly as it is sent over the network. Do not rebuild the JSON after signing: a different key order or whitespace will produce a different signature. PHP example:

PHP
$body = json_encode(['rows' => $rows], JSON_UNESCAPED_UNICODE);
$signature = hash_hmac('sha256', $body, $key);

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => $body,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
        'X-AI2-Signature: ' . $signature,
    ],
]);
$response = json_decode(curl_exec($ch), true);

Response format

A successful response always comes in an envelope with the field data:

200 OK
{
  "success": true,
  "message": "ok",
  "data": { ... }
}

An error is returned with an HTTP status code and the field errors, which shows exactly what went wrong. The field message - human-readable text; your code should rely on the HTTP status code errors and, if present, error_code:

401 Unauthorized
{
  "success": false,
  "message": "...",
  "errors": { "signature": "invalid" }
}
  • 401 - the signature is missing ("signature": "missing") or does not match ("invalid").
  • 404 - the company, request, invoice or channel does not exist, or the key has not been issued yet.
  • 413 - the body exceeds the maximum allowed size.
  • 422 - the body could not be parsed or is missing required fields.

All timestamps in responses are ISO-8601 in UTC with the letter Z, for example 2026-10-28T09:15:00Z. In requests, also send times in UTC or with an explicit time zone. Delta Key displays local time itself, in the viewer's time zone.

Customer database

The AI employee identifies a client by email, phone, Telegram, external ID, invoice number or tracking number and answers questions about their orders, warranty and service. You can upload clients as a CSV file in your account or send them from your system:

POST
POST https://api.deltakey.app/public/cs/business/<company GUID>/import
Content-Type: application/json
X-AI2-Signature: hex(HMAC-SHA256(body, inbound key))

{"rows": [
  {"email": "[email protected]", "phone": "+79001234567", "telegram": "@ivanova",
   "external_id": "C-1001", "name": "Anna Ivanova", "service_since": "2026-05-02",
   "deal_title": "Turnkey kitchen", "sku": "K-12", "price": "320000", "currency": "RUB",
   "sold_at": "2026-07-15", "warranty_until": "2028-07-15", "deal_service_until": "2027-07-15",
   "invoice": "INV-2026-0502", "track": "TRK-9001", "note": "VIP"}
]}

Up to 500 rows per request. Row fields:

  • email, phone, telegram, external_id - at least one is required. The client is matched by email, then by external ID, then by phone and Telegram.
  • name, service_since, service_until, note - client details.
  • manager - email, login or name of an employee of your company. The AI employee's questions about this client are routed to that employee.
  • deal_title, sku, price, currency, sold_at, warranty_until, deal_service_until - one deal per row.
  • invoice, track - invoice and tracking numbers. A client who signs in with such a number sees only this deal.

Dates are accepted in the formats YYYY-MM-DD, DD.MM.YYYY or ISO-8601 with a time zone. The protocol does not accept client passwords. Response:

200 OK
{"success": true, "message": "ok",
 "data": {"total": 3, "ok": 2, "rejected": 1,
          "report": [{"line": 3, "field": "sold_at", "error": "bad_date"}]}}

Row rejection codes: client_contact_required, bad_email, bad_date, manager_not_in_company, bad_amount, bad_currency, unsafe_cell, save_failed. If there are more than 500 rows or no rows array, the response is 422.

Customer events

Send client events as they happen: order packed, payment received, request closed. The AI employee takes them into account when talking to the client.

POST
POST https://api.deltakey.app/public/cs/business/<company GUID>/events
Content-Type: application/json
X-AI2-Signature: hex(HMAC-SHA256(body, inbound key))

{"create_clients": false,
 "rows": [
  {"external_id": "C-1001", "event_at": "2026-10-28T09:15:00Z", "kind": "order",
   "ref": "7781", "key": "order status", "value": "packed", "external_ref": "evt-88112"},
  {"email": "[email protected]", "event_at": "2026-10-28T09:16:00Z", "kind": "payment",
   "ref": "7781", "key": "debt", "value": "12500", "num_value": 12500, "unit": "RUB",
   "external_ref": "evt-88113"}
]}
  • The client is matched by external_id, email or phone.
  • The optional row fields name, contact_email, contact_phone apply only when a new client card is created: name becomes the card name, contact_email and contact_phone are added to the card note marked "unconfirmed". They are not written to the email and phone fields, are not used to match the client and do not modify a matched card. On their own, name/contact_* without external_id, email or phone are not enough.
  • kind - order, payment, delivery, ticket, call, visit, note, status or custom.
  • key - what the fact is, value - the value in words, num_value and unit - the value as a number, ref - order or invoice number, data - any additional fields as an object.
  • external_ref - your event ID. Resending with the same ID updates the event instead of creating a duplicate.
  • create_clients - defaults to true: an unknown client will be created. With false such a row is rejected with the code client_not_found.
  • An empty event_at means the current time.
200 OK
{"success": true, "message": "ok",
 "data": {"total": 2, "ok": 2, "rejected": 0, "added": 1, "updated": 1,
          "clients_created": 0, "errors": [], "errors_list": []}}

Request result

When a client asks to book, return, reschedule or call back, the AI employee does not carry out the action itself: it creates a request and sends it to your system (see Lookups and requests). Once the request has been fulfilled, report the result:

POST
POST https://api.deltakey.app/public/cs/business/<company GUID>/tasks/<task_guid>/result
Content-Type: application/json
X-AI2-Signature: hex(HMAC-SHA256(body, inbound key))

{"status": "done",
 "answer": "Booked for Wednesday 16.09 at 15:00, technician Sergey",
 "external_ref": "SR-55",
 "for_client": true}
  • status - done, rejected or cancelled close the request.
  • answer - the response text. With for_client: true (default), the AI employee relays it to the client.
  • external_ref - the request number in your system.

Response: {"data": {"task": {"guid": "...", "status": "done"}}}. Unknown request - 404.

Events to an employee channel

An event channel is a separate intake URL of an AI employee. Your store sends orders here, your CRM sends requests, and your monitoring sends incidents. Each event becomes a card in the employee's channel, and the team receives a notification. A channel is created by an administrator who has permission to manage the employee; the URL and secret are displayed on creation.

POST
POST https://api.deltakey.app/public/hooks/<channel key>
Content-Type: application/json
X-AI2-Signature: sha256=hex(HMAC-SHA256(body, channel secret))

{"type": "order",
 "id": "order-123",
 "title": "New order",
 "text": "Order order-123 paid",
 "client": "client-42",
 "payload": {"order_id": "order-123"},
 "actions": [{"type": "link", "title": "Open", "value": "https://your-store.example/orders/123"}],
 "consent": false,
 "state": "new",
 "sender": "CRM"}
  • type (or event) - event type, up to 64 characters.
  • title - title, up to 200 characters; text (or body, message) - text, up to 4000 characters.
  • client (or thread) - the client, if the channel groups events by client.
  • id (or event_id, order_id) - event ID. Resending with the same ID updates the same card.
  • payload - any data as an object.
  • actions - up to four buttons: link only (link, http or https) or phone (tel). Other actions are not accepted.
  • consent: true - the event awaits the team's decision: "Approve" or "Reject".
  • state - status, up to 24 characters; sender - sender, up to 120 characters.

If your system cannot sign the body, you can pass the secret in the parameter ?token=<channel secret>, but a signature is more secure: a URL with a token remains in proxy logs. The channel also accepts forms (application/x-www-form-urlencoded, multipart/form-data). Body size - up to 64 000 bytes.

Response: {"success": true, "data": {"accepted": true}}. Errors: 401 - the signature is missing or invalid, 404 - the channel is disabled or not found, 413 - the body exceeds 64 000 bytes, 422 - the body could not be parsed.

Payment notifications

If clients pay invoices issued on your company page directly to your bank account, notify us of every successful payment. This way the invoice is closed automatically.

POST
POST https://api.deltakey.app/public/twincard/payments/<company GUID>/callback
Content-Type: application/json
X-AI2-Signature: hex(HMAC-SHA256(body, notification key))

{"invoice_no": "2026-00007",
 "status": "paid",
 "amount": "5000.00",
 "currency": "RUB",
 "external_id": "pay_7f3c91",
 "paid_at": "2026-10-28T10:12:00Z"}

The URL path is set by the platform and is the same for all companies. Fields:

  • invoice_no - invoice number, required.
  • status - paid (funds received), failed (payment failed) or refunded (refund), required.
  • amount, currency - the amount actually credited and its currency.
  • external_id - your payment ID; paid_at - payment time in UTC.

Response: {"data": {"invoice_no": "2026-00007", "status": "settled", "repeat": false}}. A repeated notification changes nothing and returns "repeat": true, so keep resending until you receive 200. Errors: 401 - signature rejected, 404 - the invoice does not exist or the key has not been issued yet, 422 - missing invoice_no or unknown status.

Lookups and requests

Delta Key calls your system during a conversation. The URLs are configured in your account: "Integrations" → "API connection" tab → "Company system connection". The URL must use HTTPS on the standard port 443 and a public domain.

Each request comes with the following headers:

Headers
Content-Type: application/json
X-AI2-Source: ai2
X-AI2-Type: lookup
X-AI2-Timestamp: 1793178000
X-AI2-Signature: hex(HMAC-SHA256("POST\n" + URL path + "\n" + X-AI2-Timestamp + "\n" + body, inbound key))

The signature covers the method, the path of your URL without parameters, the time and the body, so an intercepted request cannot be replayed later or sent to another URL. How to verify the signature is shown in the section Signature verification.

Client lookup

The AI employee asks your system about order status, debt, warranty, appointments, delivery or payment:

X-AI2-Type: lookup
{"type": "lookup",
 "question": "order_status",
 "text": "where is my order 7781",
 "refs": ["7781"],
 "client": {"external_id": "C-1001", "phone": "+79001234567",
            "email": "[email protected]", "name": "Anna Ivanova"},
 "bot": {"guid": "...", "name": "Maria"},
 "owner": {"kind": "business", "guid": "..."},
 "request_id": "a1b2c3d4e5f60718",
 "at": "2026-10-28T09:00:00+00:00",
 "ts": 1793178000}

question - order_status, debt, warranty, request_status, appointment, delivery, payment, access, requisites, vehicle_check, phones, payments, sbp, overview or custom. refs - up to five numbers the employee found in the question. Respond within 5 seconds:

Your response
{"ok": true,
 "answer": {"text": "Order 7781 is packed, pickup tomorrow after 14:00",
            "facts": {"status": "packed", "ready_at": "2026-10-29"}}}

{"ok": false, "reason": "not_found"}

reason - not_found, unknown_client or unavailable. If there is no response within 5 seconds, the employee tells the client they will check and passes the question to company staff. The employee relays the response as a fact and does not execute any instructions contained in it. The "Test connection" button in your account sends {"type": "ping"} and expects {"ok": true}.

Client requests

A client request is recorded in the company process log and, if a request intake URL is set, sent to you:

X-AI2-Type: action_request
{"type": "action_request",
 "task_guid": "60b7f4f3-...",
 "action": "book",
 "params": {"date": "2026-10-30", "time": "15:00"},
 "text": "book me for Thursday after three",
 "client": {"external_id": "C-1001", "phone": "+79001234567", "name": "Anna Ivanova"},
 "owner": {"kind": "business", "guid": "..."},
 "request_id": "...", "at": "...", "ts": 1793178000}

action - book, return, reschedule, cancel, callback, order or custom. Respond with {"accepted": true, "external_ref": "SR-55"}, and once you have fulfilled it, send the request result.

Customer login verification

A client can sign in to the chat with the AI employee using their account credentials from your website. In the form builder, you define the fields (for example, "Contract number" and "Password") and the verification URL. At sign-in, Delta Key sends the data to it with the same header scheme as in the section Lookups and requests, but the signature is computed with the form signing key:

POST to your URL
{"form_id": 4,
 "owner": {"kind": "business", "guid": "..."},
 "fields": {"login": "412", "password": "..."},
 "ts": 1793178000}

Verify the data and respond within 12 seconds:

Your response
{"ok": true,
 "client": {"external_id": "412", "name": "Ivan Petrov", "email": "...", "phone": "...",
            "service_since": "2024-01-10",
            "deals": [{"title": "Service agreement", "sold_at": "2024-01-10",
                       "service_until": "2026-12-31", "external_ref": "D-12"}]}}

{"ok": false} - rejection: the client will see that the credentials are incorrect. On success, the client is created or updated by external_id. Delta Key does not store the client's password or write it to logs.

Conversation streaming

Streaming sends the AI employee's conversation records to your URL: the client's message and the employee's reply, contact details left by the client, and requests to pass something on. Streaming is enabled by the employee's administrator for the entire employee or for an individual conversation; the secret is shown once when streaming is enabled.

POST to your URL
POST <your URL>
Content-Type: application/json
X-Persona-Signature: hex(HMAC-SHA256(body, streaming secret))

{"type": "transcript",
 "project": "aironik",
 "persona_guid": "ru-kPzNy4BIuaMnl2KaGXrw",
 "persona_name": "Maria",
 "sender_guid": null,
 "sender_name": "Guest 3f9a1c2b",
 "inbound": "How much is delivery to Berlin?",
 "reply": "Delivery to Berlin costs €12 and takes 2-3 days.",
 "conversation": "guest#5120",
 "origin": "deltakey",
 "at": "2026-10-28T09:15:00+00:00"}
  • type - transcript (message and reply), contact (contact details left), order, case or note (request to pass something on). For all types except transcript, the text comes in the field content.
  • persona_guid, persona_name - the AI employee; sender_guid, sender_name - the other party, if known.
  • conversation - a reference to the conversation; project and origin - internal labels of the product and the channel where the conversation took place.

Your receiver must ignore unknown fields: the protocol is extended without breaking working receivers. Respond with any 2xx code within 15 seconds. A response with any other code or a timeout triggers a retry: up to 5 attempts in total, with intervals of 1, 5, 15 and 60 minutes. Redirects (3xx) are not followed.

Signature verification

Verify the signature before any processing and compare it using a constant-time function. Lookup, requests and sign-in verification in PHP:

PHP
$raw  = file_get_contents('php://input');
$ts   = $_SERVER['HTTP_X_AI2_TIMESTAMP'] ?? '';
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$expected = hash_hmac('sha256', "POST\n" . $path . "\n" . $ts . "\n" . $raw, $key);

if (!hash_equals($expected, $_SERVER['HTTP_X_AI2_SIGNATURE'] ?? '')
    || abs(time() - (int)$ts) > 300) {
    http_response_code(401);
    exit;
}
$request = json_decode($raw, true);

The 5-minute window is our recommendation for rejecting old replays. Conversation streaming in Node.js:

Node.js
const crypto = require('crypto');

function isValid(rawBody, signature, secret) {
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return typeof signature === 'string'
    && signature.length === expected.length
    && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}

// rawBody - the raw request body, byte for byte, before JSON parsing
if (!isValid(rawBody, req.headers['x-persona-signature'], SECRET)) {
  res.statusCode = 403;
  return res.end();
}

Product catalogs

To let the AI employee know your product range, prices and stock levels, connect a YML or CommerceML 2 catalog in the Integrations section (an export from 1C, a CMS or an online store). You provide a direct HTTPS link to the published file and, for a protected file, an HTTP Basic login and password. Delta Key reads the latest export each time and does not store a copy of the catalog.

  • YML: the field feed_url, and if needed username and password.
  • CommerceML 2: catalog_url (import.xml, an XML file with both sections, or a ZIP), and if needed offers_url for prices and stock levels.
  • The link must not contain a login, password, non-standard port or fragment. Redirects are not followed.
  • Up to 200 MB for downloaded files, up to 45 seconds per download, XML without DTD and no more than 32 levels deep.

Limits

  • Client base and client events: up to 500 rows per request, body up to 5 MB.
  • Events to an employee channel: body up to 64 000 bytes, up to four buttons.
  • Your URLs for lookup, requests and sign-in verification: HTTPS only, port 443, public domain, response up to 64 KB. Timeouts: lookup and requests - 5 seconds, sign-in verification - 12 seconds.
  • Conversation streaming: response within 15 seconds, up to 5 delivery attempts.
  • All keys are shown only once; a new key immediately revokes the old one.
SecurityStore keys on your server, not in web page code or mobile apps. If a key may have been exposed to third parties, issue a new one: the old key will stop working immediately.

Need help with architecture?

We will review your systems and prepare a blueprint of channels, data, tools and AI roles.

Contact us