ICTDesk connects to your own systems in three ways. The REST API reads and changes chats, tickets, visitors, agents and departments. Webhooks tell your server the moment something happens. The widget JavaScript API lets your website open the chat or pass in a logged-in customer. One API key from your dashboard gets you started.
This guide walks through each part with the jobs teams use it for most. When you need every field and error code, the full ICTDesk API reference has it all.
What You Can Build
A good first job is CRM sync. A chat ends, and the visitor, the transcript and the tags land on the right contact without anyone copying and pasting. It takes one webhook and a few lines of code on your side.
After that it depends on what you run. An order system can open a ticket when a payment fails, and the customer gets the usual email with a private link to reply. Offline messages can drop into the channel your team already watches. HR can add an agent on someone’s first day and switch them off on their last. And if your customers log in to your site, they can start a chat without typing their name and email all over again.
Step 1: Create an API Key
Sign in as the account owner and open Hours, Tags & API in the sidebar. Under API keys, give the key a name (for example “CRM sync”) and click Create key. Copy it straight away: ICTDesk stores only a fingerprint, so the key is shown once. Keep it on your server and never put it in a web page. An account can hold up to 10 keys, and deleting one stops it working at once.
API keys and webhooks come with the Agency plan. On Starter or Pro, the panel shows an upgrade note instead. The widget JavaScript in Step 6 works on every plan.
Step 2: Make Your First Request
Every call goes to https://service.ictdesk.net/api/v1/ with the key as a bearer token. Answers are JSON. This one lists closed chats since the start of the month:
curl "https://service.ictdesk.net/api/v1/chats?status=closed&from=2026-11-01" \
-H "Authorization: Bearer ictd_your_key_here"
Lists come in pages of 25 (ask for up to 100 with per_page), and each answer has a meta block with the total. A key only ever sees its own account.
Step 3: Pick the Endpoints You Need
Chats are where most of the data lives. You can filter them by status, date, tag, website or the visitor’s email, pull one chat with every message, and tag it. You can also answer a live chat as one of your agents, or close it, which is handy for bots and internal tools.
Tickets work the way they do in the panel. Create one as the customer or as your team, reply, leave an internal note, and change the status, priority or owner. The customer gets the same emails either way.
The rest is housekeeping. Look up a visitor by email, fix their name or phone, or ban them. Add, change or remove departments and agents (a new agent still gets the welcome email, and your plan’s agent limit still counts). Websites and tags are read-only.
Here’s a ticket created from your own system. It’s one call:
curl -X POST https://service.ictdesk.net/api/v1/tickets \
-H "Authorization: Bearer ictd_your_key_here" \
-H "Content-Type: application/json" \
-d '{"requester_email":"ali@example.com","subject":"Invoice copy","body":"Please send the invoice for order 5521."}'
Step 4: Add a Webhook
Polling the API for news works, but webhooks are faster and lighter. In Hours, Tags & API, scroll to Webhooks, paste your HTTPS address and tick the events you want:
chat.startedandchat.closed(the closed event carries the whole conversation)chat.messagefor every message, if you really need that muchoffline_message.receivedticket.created,ticket.messageandticket.status_changed
Copy the signing secret when it appears, then click Send test. The panel shows the answer your server gave. Each account can have five webhooks.
Step 5: Check the Signature
Anyone can post to a public URL, so check that each call really came from ICTDesk. Every delivery has an X-ICTDesk-Timestamp header and an X-ICTDesk-Signature header. The signature is sha256= plus an HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with your secret. In PHP:
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_ICTDESK_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_ICTDESK_SIGNATURE'] ?? '';
$want = 'sha256=' . hash_hmac('sha256', $ts . '.' . $body, getenv('ICTDESK_WEBHOOK_SECRET'));
if (!hash_equals($want, $sig) || abs(time() - (int) $ts) > 300) { http_response_code(401); exit; }
Answer with any 2xx status within 10 seconds. If your server is down, ICTDesk tries again after 30 seconds and after 5 minutes. A webhook that fails 50 times in a row switches itself off, and you can switch it back on in the panel. A Node.js version of the check is in the reference.
Step 6: Control the Chat Widget from Your Page
Once the widget loads, your page has window.ICTDesk. A “Chat with us” button is one line:
<button onclick="ICTDesk.open()">Chat with us</button>
To greet a logged-in customer by name and skip the pre-chat form, set window.ICTDeskSettings above your widget code:
<script>
window.ICTDeskSettings = {
name: "Ali Khan",
email: "ali@example.com",
department: "Billing"
};
</script>
You can also hide the chat button on some pages (ICTDesk.hide()), send agent chats from a page to one department (ICTDesk.setDepartment("Sales")), and listen for events such as chat:start or message with ICTDesk.on(). Only pass details you’ve checked yourself, like those of your logged-in user.
Security Notes
Keys and webhook secrets show up once, so copy them somewhere safe. If one goes missing, don’t hunt for it: delete the key and make a new one, or click New secret on the webhook. Only the account owner sees this part of the panel. Your Administrator agents can’t.
ICTDesk won’t send webhooks to localhost or a private network address, so use a public URL, even for testing. Each key gets 120 requests a minute, which is plenty for syncing but not for polling every second.
One more thing worth doing while you’re here: turn on Allowed domains in your widget settings, so your chat code only works on your own sites. The account settings guide shows how.
Frequently Asked Questions
Do I need a developer to use the ICTDesk API?
For the REST API and webhooks, yes, someone has to write a little code on your side. The widget JavaScript API is simpler: a web designer can add an “open chat” button in a minute.
Can the API send messages to visitors?
Yes. Send a message into a live chat as one of your agents, and the visitor sees it in the widget straight away. For tickets, a staff reply goes to the customer by email, just like a reply from the panel.
Which events can webhooks send?
Chat started, chat closed, every chat message, offline message received, ticket created, ticket reply and ticket status change. You pick the ones you want for each webhook.
What happens if my server is down when a webhook fires?
ICTDesk retries twice, after 30 seconds and after 5 minutes. The panel shows the last result for each webhook, so you can see what went wrong.
Is there a limit on API calls?
Each key can make 120 requests per minute. If you go over, you get a 429 answer and can try again a moment later.
Related Guides
- ICTDesk Support Center, every setup guide in one place
- ICTDesk Features, the full list of what the platform does
- How to Add Live Chat to Your Website, the widget install walkthrough
Want an integration built for you? Talk to our team, and we can build it on request in a short time.