Docs › Connect channels › Custom channel via API

Custom channel via API

With an API channel you bring messages from a system you control into the inbox: from your own app, your shop or a messenger The-Y doesn't support natively (e.g. Viber via Make or n8n). Your system delivers customer messages through the API. The CRM sends replies from the inbox back to an address of your system, signed.

⏱ approx. 10 min in the CRM, plus the connection in your system · Permission “Manage settings” (admin) · every plan, including Free · for developers or Make/n8n · As of 23 Nov 2026 (version 1.1.72)

Contents: How it works · Setup · Deliver a customer message · Receive replies · Report delivery status · In the CRM · Limits · Troubleshooting

How it works

Setup

  1. Create the API channel. Settings → Channels → card “Your own channels: API and web form” → “Create API channel”. Enter a name only you see in the CRM, e.g. “Viber via Make” or “Customer app”. Each API channel belongs to one brand; with several brands, choose the right one at the top first.
  2. Copy the secret. The secret (whsec_…) is then shown once in the window (“Secret – visible only now”). Copy it into your system: it lets you verify that replies really come from the CRM. Later you can only create a new one (“Create new secret” – the old one stops working immediately).
  3. Enter the “Reply address (webhook)”. The CRM sends every reply here. Cloud: https:// only, and no addresses in a local or internal network. Empty = incoming only, no replies.
  4. “Send test”. The CRM sends the signed event webhook.ping to the address and shows whether it was delivered.
  5. “Create a key for this channel”. In the same window you get an API key with exactly one scope, “Deliver messages” (channels:inbound), and only for this channel. It is shown only once (“Key – visible only now”) – copy it, done.
  6. Take the channel ID. The “Channel ID (channel_id)” is shown in the window and goes into every incoming message.
Existing keys do not have the “Deliver messages” scope. Create a new key for the connection – easiest in the channel with “Create a key for this channel”. Alternatively, create a key with “Deliver messages” under Settings → Integrations; it then works for all API channels of the account. Renewal and expiry are set under “Integrations”; the channel's window lists its keys with “last used” and lets you revoke them.

Deliver a customer message

Send each message from your customer to the API like this (cloud: crm.the-y.at, self-hosted: your own address):

POST https://crm.the-y.at/api/ext/v1/channels/inbound
Authorization: Bearer tyk_…
Content-Type: application/json

{
  "channel_id": "<channel ID from the API channel's window>",
  "sender": { "id": "customer-4711", "name": "Anna Muster", "email": "anna@example.com", "phone": "+43 664 1234567" },
  "text": "Hello, is my parcel on its way?",
  "thread": "order-4711",
  "subject": "Order 4711",
  "message_id": "msg-001"
}
FieldMeaning
channel_idRequired. The channel ID from the API channel's window.
sender.idRequired. Your ID for the customer (e.g. customer number or ID in the messenger). Replies are addressed to this ID.
textRequired. The message, up to 8,000 characters.
sender.name, sender.email, sender.phoneOptional. Help match the contact.
sender.contact_idOptional. ID of an existing contact in the CRM.
threadOptional. Your own conversation ID: same ID = always the same conversation (a closed one is reopened). Without thread there is one ongoing conversation per sender; once it is closed, the next message starts a new one (like WhatsApp).
subjectOptional. Subject of the conversation.
message_idOptional, recommended. Your ID for the message. If the same ID arrives a second time, the API answers 200 with "duplicate": true and creates nothing twice.

Contact: the CRM looks up sender.contact_id first, then the email address, then the phone number and finally the ID within the channel.

API response: 201 with conversation_id, message_id, contact_id, created_conversation and "duplicate": false. GET /api/ext/v1/channels/inbound lists the account's API channels (a key “only for this channel” sees only its own).

The same with curl:

curl -X POST https://crm.the-y.at/api/ext/v1/channels/inbound \
  -H "Authorization: Bearer tyk_…" \
  -H "Content-Type: application/json" \
  -d '{"channel_id":"<channel ID>","sender":{"id":"customer-4711","name":"Anna Muster"},"text":"Hello!","message_id":"msg-001"}'
ResponseMeaning
400 invalid_fieldA field is missing or invalid; field says which one.
401No key or an invalid key.
403 insufficient_scopeThe key lacks the “Deliver messages” scope (channels:inbound).
404 channel_not_foundThis API channel does not exist in this account – or the key belongs to a different channel.
409 channel_disabledThe API channel is switched off in the CRM; nothing is accepted.
429Limit reached (see Limits). Wait the seconds given in Retry-After.
503 temporarily_unavailableNot possible right now. Send again in 30 seconds with the same message_id – nothing is created twice.

Receive replies

Every reply in the conversation arrives as a POST at your reply address:

# Reply to your reply address (POST, JSON)
X-TheY-Event: message.outbound
X-TheY-Timestamp: 1763683200
X-TheY-Signature: v1=<HMAC-SHA256(secret, "<timestamp>.<body>")>
X-TheY-Event-Id: evt_<message ID>

{ "id": "evt_…", "event": "message.outbound", "tenant": "…", "at": "…",
  "data": { "channel_id": "…", "conversation_id": "…", "thread": "order-4711",
            "recipient": { "id": "customer-4711" },
            "message": { "id": "…", "text": "It's on its way!", "author": { "name": "Ola" },
                         "attachments": [ { "filename": "invoice.pdf", "content_type": "application/pdf", "size": 12345, "data_base64": "…" } ] } } }

Report delivery status (optional)

If your system returned its own ID when it received a reply, use it to report the status later. The inbox then shows the ticks; the status only moves forward, never back.

POST https://crm.the-y.at/api/ext/v1/channels/inbound/status
Authorization: Bearer tyk_…
Content-Type: application/json

{ "channel_id": "<channel ID>", "message_id": "<your ID>", "status": "delivered" }

status is delivered, read or failed (optionally with error as a short text).

In the CRM: like the other channels

Limits

Troubleshooting

“403 insufficient_scope” although the key works otherwise

Existing keys do not get the “Deliver messages” scope automatically. Create a new key in the channel's window (“Create a key for this channel”).

“404 channel_not_found”

Check the channel_id (shown in the channel's window or in GET /api/ext/v1/channels/inbound). A key “only for this channel” gets 404 for any other channel.

Replies do not reach my system

Click “Send test” in the channel's window. In the cloud the address must start with https:// and answer with 2xx. The last error is shown below the address. Use “Send again” in the inbox for messages that were not delivered.

The signature never matches

Sign the body raw, exactly as it arrives – do not parse it as JSON and serialise it again. If you clicked “Create new secret”, the old one no longer works. Discard timestamps older than 5 minutes.

Next steps