/mereadWho this token belongs to, and its organization.
{
"id": 2,
"name": "Maria",
"email": "maria@example.com",
"role": "admin",
"org": {
"id": 1,
"name": "Example"
},
"tokenScope": "write"
}Connect an e-shop, an ERP or your own code to your team’s conversations, tasks and email, or connect OneDesk to thousands of apps through Zapier, Make or n8n. Base address: https://app.onedesk.gr/api/v1 · OpenAPI description
1. In OneDesk, an admin: Settings → API and webhooks → Organization keys → Create key. Name it after the system that will use it, give it only the rights and inboxes it needs.
2. Send it with every request:
curl -H "Authorization: Bearer ti_…" https://app.onedesk.gr/api/v1/conversations?view=unassigned
Errors come back as {"error": "…", "code": "…"} (code when there is one) with a 4xx status, or 5xx if something broke on our side. The API and webhooks are part of the Team and Business plans. /api/v1 only changes in ways that don’t break callers: new endpoints, new fields, new optional parameters.
Organization keys (made by an admin) are for systems — an e-shop, an ERP, a sync job. A key belongs to the organization, not to a person, so it keeps working when people leave; it isn’t a paid user; it sees the shared inboxes it was given (all unrestricted ones, or a list). What it writes shows the key’s name. Personal tokens act as the person who made them and see what they see — for your own scripts.
| read | Look only: every GET. |
| write | Also work on conversations: notes, assign, labels, close and reopen, read state, tasks, REST hooks. Not sending. |
| full | Everything above, sending included. Never: managing people, keys, webhooks, integrations or settings. |
Rate limit. Each key has a bucket of 120 requests that refills at 2 a second (about 120 a minute); sending an email takes 10. Every answer says what’s left in X-RateLimit-Remaining. Over the limit you get 429 with Retry-After (seconds): wait that long and try again.
Idempotency. Network trouble can make you retry a request that actually went through. Add an Idempotency-Key header (any unique string, e.g. your invoice number) to POST, PUT, PATCH and DELETE requests: for 24 hours, the same key on the same endpoint gets the first answer again, marked Idempotent-Replayed: true, instead of doing it twice.
curl -X POST https://app.onedesk.gr/api/v1/send -H "Authorization: Bearer ti_…" -H "Content-Type: application/json" -H "Idempotency-Key: invoice-2026-001542" -d '{"accountId": 5, "to": "customer@example.com", "subject": "Invoice 001542", "html": "<p>Attached…</p>"}'/mereadWho this token belongs to, and its organization.
{
"id": 2,
"name": "Maria",
"email": "maria@example.com",
"role": "admin",
"org": {
"id": 1,
"name": "Example"
},
"tokenScope": "write"
}/usersreadTeammates in the organization.
[
{
"id": 2,
"name": "Maria",
"email": "maria@example.com",
"role": "admin"
}
]/inboxesreadInboxes you can read and send from (team and your personal ones).
[
{
"id": 5,
"email": "support@example.com",
"name": "Support",
"kind": "shared"
}
]/labelsreadLabels of the organization.
[
{
"id": 3,
"name": "VIP",
"color": "#E5484D"
}
]/conversationsreadList conversations, newest first, 50 at a time. An email sent to several of your inboxes is one conversation, in each of them: accountId is its first inbox, accountIds all of them.
view | inbox, assigned_me, unassigned, assigned_others, snoozed, closed, sent, starred, mentions, label, search |
account | Only this inbox |
label | With view=label |
q | Search words |
before | The "cursor" of the previous page |
{
"items": [
{
"id": 123,
"accountId": 5,
"accountIds": [
5,
8
],
"subject": "Order 1015",
"snippet": "Hello, where is…",
"status": "open",
"assignees": [
2
],
"labels": [
3
],
"unread": true,
"lastMessageAt": "2026-10-04T09:00:00.000Z",
"tasks": {
"open": 1,
"total": 2,
"due": "2026-10-09"
}
}
],
"more": true,
"cursor": "2026-10-04T08:00:00.000Z|120"
}/conversations/{id}readOne conversation: its emails, team notes, history, tasks and drafts. In long threads the older emails come with a short text and "partial": true — ask with ?bodies=all for every email in full, or get one with GET /messages/{id}.
bodies | "all": every email with its full text and HTML |
{
"id": 123,
"subject": "Order 1015",
"messages": [
{
"id": 456,
"fromName": "Customer",
"fromEmail": "customer@example.com",
"date": "2026-10-04T09:00:00.000Z",
"direction": "in",
"text": "Hello…",
"html": "<p>Hello…</p>",
"attachments": [
{
"id": 9,
"filename": "invoice.pdf",
"contentType": "application/pdf",
"size": 52000
}
]
}
],
"comments": [],
"events": [],
"taskList": []
}/conversations/{id}/statuswriteArchive (closed), reopen (open), or close as its assignees do (done: stays in the Inbox, faded, until archived; archives when nobody is assigned). The answer says which it did.
{
"status": "closed"
}{
"ok": true,
"status": "closed"
}/conversations/{id}/assigneeswriteSet who it’s assigned to (an empty list unassigns).
{
"userIds": [
2,
4
]
}{
"ok": true
}/conversations/{id}/duewriteSet its due date: a day and, optionally, a time (HH:MM) in the organization’s time zone; date null removes it. The assignees (else whoever set it) are reminded an hour before, or at 9:00 that day for a day alone. Archiving or closing clears it. Conversations carry dueDate, dueTime and dueAt.
{
"date": "2026-10-17",
"time": "14:00"
}{
"ok": true,
"dueDate": "2026-10-17",
"dueTime": "14:00",
"dueAt": "2026-10-17T11:00:00.000Z"
}/conversations/{id}/labelswriteSet its labels.
{
"labelIds": [
3
]
}{
"ok": true
}/conversations/{id}/snoozewriteSnooze until a time (or "until": null to end it).
{
"until": "2026-10-09T07:00:00Z"
}{
"ok": true
}/conversations/{id}/readwriteMark as read or unread for the token’s owner.
{
"read": true
}{
"ok": true
}/conversations/{id}/commentswriteWrite a team note (only the team sees it). Mentioned people are notified.
{
"body": "Called the customer, all good.",
"mentions": [
4
]
}{
"id": 77
}/contacts/{email}readA contact’s name and their conversations with you.
{
"name": "Customer",
"stats": {
"messages": 4
},
"conversations": [
{
"id": 123,
"subject": "Order 1015"
}
]
}/searchreadSearch conversations, like the search bar in OneDesk: words anywhere in the emails (subject, text, sender, form fields), plus filters. All filters must match; a list (comma-separated) matches any of its values. Newest first, 50 at a time, each with an "excerpt" showing where the words were found, and "total" on the first page.
q | Words to find; each also matches as the start of a word ("invo" finds "invoice"). Greek works with or without accents. |
subject | Words in the subject only |
from | Senders: addresses or domains, e.g. maria@example.com,example.gr |
to | Recipients (To), addresses or domains |
domain | Anyone in the conversation from these domains |
inbox | Inbox ids |
label | Label ids |
assignedTo | User ids |
status | inbox, open, closed, snoozed, sent |
since | With an email on or after this day (2026-09-01, in your organization’s time zone) or time (ISO 8601) |
until | With an email up to this day (inclusive) or before this time |
hasAttachments | true: only with files |
unread | true: only unread by the token’s owner |
cursor | The "cursor" of the previous page |
{
"items": [
{
"id": 123,
"accountId": 5,
"subject": "Τιμολόγιο 1542",
"snippet": "Καλησπέρα, σας στέλνω…",
"status": "closed",
"assignees": [
2
],
"labels": [
3
],
"lastMessageAt": "2026-09-12T09:00:00.000Z",
"excerpt": "…σας στέλνω το τιμολόγιο 1542 για την παραγγελία…"
}
],
"more": false,
"cursor": null,
"total": 1
}/messagesreadEmails (and messages from other systems) in the inboxes you can see. Newest first, to look through or search them; or, with "after", every email stored after a known one, oldest first — to follow new email from an ERP or a sync job. Each comes with its files; with bodies=true also its text and HTML. "folder" is where the email is on the mail server: inbox, archive, sent, junk, trash (null for messages from other systems).
after | Follow mode: emails stored after this message id, oldest first. Start with 0 (everything) or the newest id you have; the answer’s "after" is the value for next time. |
q | Words to find (as in /search); each email found has an "excerpt" |
inbox | Inbox ids |
conversationId | Only this conversation |
direction | in (received) or out (sent) |
from | Senders: addresses or domains |
to | Recipients (To or Cc): addresses or domains |
since | Sent on or after this day or time |
until | Up to this day (inclusive) or before this time |
bodies | true: include "text" and "html" (25 a page at most) |
limit | How many: 50 by default, 100 at most (25 with bodies) |
cursor | Newest-first mode: the "cursor" of the previous page |
{
"items": [
{
"id": 456,
"conversationId": 123,
"inboxId": 5,
"direction": "in",
"folder": "inbox",
"fromName": "Customer",
"fromEmail": "customer@example.com",
"to": [
{
"name": "Support",
"email": "support@example.com"
}
],
"cc": [],
"replyTo": null,
"subject": "Order 1015",
"date": "2026-10-04T09:00:00.000Z",
"internetMessageId": "<CA+abc@mail.example.com>",
"inReplyTo": null,
"snippet": "Hello, where is my order?",
"attachments": [
{
"id": 9,
"filename": "invoice.pdf",
"contentType": "application/pdf",
"size": 52000,
"inline": false,
"cid": null,
"url": "https://app.onedesk.gr/api/v1/attachments/9"
}
],
"sentByUserId": null
}
],
"more": true,
"after": 456
}/messages/{id}readOne email in full: addresses, its text and HTML, and every file — pictures inside the HTML too ("inline": true; the HTML already points at their "url", which needs your token like any request).
{
"id": 456,
"conversationId": 123,
"inboxId": 5,
"direction": "in",
"folder": "inbox",
"fromName": "Customer",
"fromEmail": "customer@example.com",
"to": [
{
"name": "Support",
"email": "support@example.com"
}
],
"cc": [],
"replyTo": null,
"subject": "Order 1015",
"date": "2026-10-04T09:00:00.000Z",
"internetMessageId": "<CA+abc@mail.example.com>",
"inReplyTo": null,
"snippet": "Hello, where is my order?",
"text": "Hello, where is my order?\n\nMaria",
"html": "<p>Hello, where is my order?</p><p>Maria</p>",
"attachments": [
{
"id": 9,
"filename": "invoice.pdf",
"contentType": "application/pdf",
"size": 52000,
"inline": false,
"cid": null,
"url": "https://app.onedesk.gr/api/v1/attachments/9"
}
],
"sentByUserId": null
}/attachments/{id}readDownload a file, as it came. If the conversation was closed long ago, OneDesk may first fetch it from the mail server again.
The file itself (application/octet-stream), with its name in Content-Disposition.
/messages/{id}/emlreadThe original email (.eml, RFC 822) as the mail server keeps it, headers and all — to archive it in your ERP or document system. It’s fetched from the mail server, so it counts as 5 requests. Not for messages from other systems (404).
The file itself (message/rfc822), with its name in Content-Disposition.
/tasksreadYour open tasks (and those done in the last day). Admins: ?scope=everyone.
scope | mine (default) or everyone |
{
"today": "2026-10-04",
"tasks": [
{
"id": 9,
"conversationId": 123,
"text": "Send the invoice",
"assigneeId": 2,
"due": "2026-10-09",
"doneAt": null,
"subject": "Order 1015"
}
]
}/conversations/{id}/tasksreadA conversation’s tasks.
[
{
"id": 9,
"text": "Send the invoice",
"assigneeId": 2,
"due": "2026-10-09",
"doneAt": null
}
]/conversations/{id}/taskswriteAdd a task. Without assigneeId it goes to whoever the conversation is assigned to.
{
"text": "Send the invoice",
"assigneeId": 2,
"due": "2026-10-09"
}{
"id": 9,
"conversationId": 123,
"text": "Send the invoice",
"assigneeId": 2,
"due": "2026-10-09",
"doneAt": null
}/tasks/{id}writeTick, untick or change a task.
{
"done": true
}{
"id": 9,
"doneAt": "2026-10-05T10:00:00.000Z"
}/tasks/{id}writeRemove a task.
{
"ok": true
}/messageswritePut a message from another system — a contact form, an ERP alert, a shop event — into a shared inbox, as a conversation the team handles like an email. With "from", replies go by email to that address. Messages with the same "thread" in the same inbox join one conversation (reopening it if closed). Attachments as base64: up to 10 files, 15 MB in all.
{
"inboxId": 5,
"from": {
"name": "Γιώργος Παπαδάκης",
"email": "george@example.com"
},
"subject": "Φόρμα επικοινωνίας: ερώτηση για παραγγελία",
"text": "Καλησπέρα, θα ήθελα να μάθω…",
"fields": [
{
"label": "Τηλέφωνο",
"value": "6912345678"
},
{
"label": "Αρ. παραγγελίας",
"value": "4821"
}
],
"source": "Φόρμα · example.gr",
"thread": "order-4821",
"attachments": [
{
"filename": "photo.jpg",
"contentType": "image/jpeg",
"content": "/9j/4AAQ…"
}
]
}{
"conversationId": 123,
"messageId": 456,
"created": true
}/sendfullSend an email from one of your inboxes: a new one, or a reply (conversationId + replyToId). JSON, or multipart with a "data" field and "files" to attach.
{
"accountId": 5,
"to": "customer@example.com",
"cc": "",
"subject": "Your order",
"html": "<p>Hello!</p>",
"conversationId": 123,
"replyToId": 456
}{
"conversationId": 123
}/hookswriteSubscribe a URL to one event (admins’ tokens). Zapier, Make and n8n do this when a workflow is switched on.
{
"url": "https://hooks.zapier.com/hooks/standard/123/abc",
"event": "message.received"
}{
"id": 31,
"url": "https://hooks.zapier.com/…",
"event": "message.received",
"secret": "…"
}/hooks/{id}writeUnsubscribe.
{
"ok": true
}/hooks/samples/{event}readRecent examples of an event, shaped like deliveries (to map fields while building a workflow).
[
{
"id": "message.received:456",
"event": "message.received",
"data": {
"conversationId": 123,
"subject": "Order 1015"
},
"sentAt": "2026-10-04T09:00:01.000Z"
}
]Follow new email from your ERP. To copy email into another system — a customer’s messages into their ERP record, a supplier’s confirmations into the order — ask for GET /messages?after=<id> every few minutes. You get every email OneDesk stored after that id, oldest first, and an after to send next time. Nothing is missed while your system is off and nothing comes twice, with no public address needed. Webhooks are faster; use both if you like — message.received to act at once, follow mode to catch up on anything missed.
<?php // every few minutes (cron)
function onedesk($path) {
$ch = curl_init('https://app.onedesk.gr/api/v1' . $path);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . ONEDESK_KEY]]);
$body = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 429) { sleep(30); return onedesk($path); } // over the limit: wait
return json_decode($body, true);
}
$after = (int) @file_get_contents(__DIR__ . '/onedesk-after.txt'); // 0 the first time: everything
do {
$page = onedesk("/messages?after=$after&bodies=true");
foreach ($page['items'] as $m) {
if (in_array($m['folder'], ['junk', 'trash'])) continue; // skip spam and deleted mail
$email = $m['direction'] === 'in' ? $m['fromEmail'] : ($m['to'][0]['email'] ?? '');
// find the customer by $email; keep $m['subject'], $m['date'], $m['text'];
// files: $m['attachments'][…]['url'], downloaded with the same Authorization header
}
$after = $page['after'];
file_put_contents(__DIR__ . '/onedesk-after.txt', $after); // only after you've saved them
} while ($page['more']);
What an email carries. text is plain text; html is the email as it was written — clean it (e.g. HTML Purifier) before showing it in a web page of yours. Pictures inside the HTML point at their url on OneDesk, which needs your token: to show them elsewhere, download them. Messages from other systems (POST /messages) also have source and fields. internetMessageId is the email’s own Message-ID, the same in every mailbox it reached.
Searching. GET /search finds conversations, like the search bar in OneDesk; GET /messages?q= finds single emails. Both match the start of words (“τιμολ” finds “τιμολόγιο”) with or without Greek accents and capitals, in the subject, text, sender and form fields. Plain days (since=2026-09-01) are in your organization’s time zone, the one of its business hours (Settings → Organization).
OneDesk POSTs JSON to your URL when something happens. Add them in Settings → API and webhooks, or subscribe from code with POST /hooks.
{
"id": "evt_3kq9ZlV0uB1x2YtR",
"event": "message.received",
"data": {
"account": "support@example.com",
"conversationId": 123,
"messageId": 456,
"from": {
"name": "Customer",
"email": "customer@example.com"
},
"subject": "Order 1015",
"snippet": "Hello, where is my order?",
"date": "2026-10-04T09:00:00.000Z"
},
"sentAt": "2026-10-04T09:00:01.000Z"
}
Answer with any 2xx within 10 seconds. Anything else — an error, a timeout, your server being down — and OneDesk tries again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours (7 tries, about 21 hours), always with the same body. After that the delivery is marked failed and the organization’s admins are told; they can resend it from Settings, where every delivery of the last 30 days is listed. A webhook that has only failed for 3 days is switched off. Automation tools that answer 410 Gone are unsubscribed.
Duplicates and order. A retry can arrive after newer events, and rarely the same event twice. Every event has an id (also in X-OneDesk-Event-Id): store the ids you’ve handled and skip repeats. Use sentAt or fetch the conversation for the current state. Events carry a short version; the whole email is GET /messages/{messageId}.
message.received | An email arrived in an inbox |
message.sent | An email was sent from OneDesk |
comment.created | A team note was written |
conversation.assigned | Assignees changed |
conversation.closed | A conversation was closed |
conversation.reopened | A conversation was reopened |
conversation.snoozed | A conversation was snoozed |
conversation.labeled | Labels changed |
task.created | A task was added |
task.completed | A task was ticked off |
task.due | A task’s day came (8:00 local time) |
Each delivery has X-OneDesk-Signature-256: t=<timestamp>,v1=<signature>: an HMAC-SHA256, keyed with the webhook’s secret, of the timestamp, a dot and the raw body. Check it in constant time, and reject timestamps more than 5 minutes old, so a recorded delivery can’t be replayed later:
<?php // PHP
$raw = file_get_contents('php://input');
preg_match('/t=(d+),v1=([a-f0-9]+)/', $_SERVER['HTTP_X_ONEDESK_SIGNATURE_256'] ?? '', $m);
$ok = $m && abs(time() - (int)$m[1]) < 300
&& hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2]);
if (!$ok) { http_response_code(401); exit; }
$event = json_decode($raw, true); // skip it if you've seen $event['id'] before
http_response_code(200);
// Node.js (Express: use express.raw() so you get the exact body)
const [, t, v1] = req.get('x-onedesk-signature-256').match(/t=(d+),v1=([a-f0-9]+)/) || [];
const mac = crypto.createHmac('sha256', SECRET).update(t + '.' + req.body).digest('hex');
const ok = v1 && Math.abs(Date.now() / 1000 - t) < 300 && crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));
Older receivers can keep checking X-OneDesk-Signature: sha256=… (the HMAC of the body alone); it’s still sent. Other headers: X-OneDesk-Event, X-OneDesk-Event-Id, X-OneDesk-Delivery, X-OneDesk-Timestamp.
A contact form, an ERP’s alert (“customer over their credit limit”), a shop’s return request: send it with POST /messages and it becomes a conversation in a shared inbox, exactly like an email. Rules run on it, the team is told, webhooks fire; the team assigns it, writes notes and replies. With from.email, a reply goes by email from that inbox, and the customer’s answer comes back into the same conversation. Fields show as a small table above the message, and source as a badge (“via Φόρμα · example.gr”).
One conversation per thing. Send the same thread (an order number, a ticket id) and later messages join the same conversation, reopening it if it was closed. Add an Idempotency-Key so a retried request doesn’t create it twice. These messages live only in OneDesk: no copy is put in the mailbox.
<?php // contact.php — your website's form handler
$payload = [
'inboxId' => 5, // GET /api/v1/inboxes
'from' => ['name' => $_POST['name'], 'email' => $_POST['email']],
'subject' => 'Φόρμα επικοινωνίας: ' . $_POST['topic'],
'text' => $_POST['message'],
'fields' => [['label' => 'Τηλέφωνο', 'value' => $_POST['phone']], ['label' => 'Σελίδα', 'value' => $_SERVER['HTTP_REFERER'] ?? '']],
'source' => 'Φόρμα · example.gr',
];
$ch = curl_init('https://app.onedesk.gr/api/v1/messages');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . ONEDESK_KEY, 'Content-Type: application/json', 'Idempotency-Key: form-' . bin2hex(random_bytes(8))],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE)]);
$answer = json_decode(curl_exec($ch), true); // {"conversationId": 123, "messageId": 456, "created": true}
Use an organization key with “Read and work on conversations” and only the inbox it needs. Up to 10 attachments, 15 MB in all, as base64.
Show what your own system knows about a customer — balance, unpaid invoices, orders, a link to their record — in the Details panel next to their email. You write a small bridge: one address that OneDesk asks, and that answers JSON. Add it in Settings → Integrations → Your own systems, put the secret it gives you in the bridge, and use Test to see the card exactly as your team will.
A POST when someone opens a conversation (answers are kept for a minute per person), with X-OneDesk-Timestamp and X-OneDesk-Signature-256 signed exactly like webhooks, using the card’s secret:
{
"event": "card",
"contact": {
"email": "customer@example.com",
"name": "Γιώργος Παπαδάκης"
},
"conversation": {
"id": 123,
"subject": "Παραγγελία 4821",
"inbox": "sales@example.gr"
},
"user": {
"id": 2,
"name": "Maria",
"email": "maria@example.gr"
},
"org": {
"id": 1,
"name": "Example"
}
}
Within 6 seconds, HTTP 200 with JSON. Every field is optional; text is shown as plain text, links must be http(s)://, colours are gray, blue, green, yellow, red, purple. Not a customer? Answer {"found": false, "message": "…"}.
{
"title": "Παπαδάκης Γεώργιος",
"subtitle": "Πελάτης · ΑΦΜ 123456789",
"url": "https://erp.example.gr/customers/1042",
"badges": [
{
"text": "Ανεξόφλητα",
"color": "red"
}
],
"fields": [
{
"label": "Υπόλοιπο",
"value": "€1.240,00"
},
{
"label": "Πιστωτικό όριο",
"value": "€5.000,00"
},
{
"label": "Πωλητής",
"value": "Ελένη"
}
],
"sections": [
{
"title": "Τελευταία παραστατικά",
"items": [
{
"title": "ΤΔΑ 1542",
"subtitle": "12/09/2026",
"value": "€320,00",
"badge": {
"text": "Ανεξόφλητο",
"color": "red"
},
"url": "https://erp.example.gr/docs/1542"
},
{
"title": "ΤΔΑ 1498",
"subtitle": "28/08/2026",
"value": "€920,00",
"badge": {
"text": "Εξοφλήθηκε",
"color": "green"
}
}
],
"more": {
"text": "Όλα τα παραστατικά",
"url": "https://erp.example.gr/customers/1042/docs"
}
}
],
"links": [
{
"label": "Καρτέλα πελάτη",
"url": "https://erp.example.gr/customers/1042"
}
]
}
Limits: 5 badges, 20 fields, 6 sections of 20 items, 6 links; longer lists are cut. The Test button lists anything OneDesk had to leave out, and why.
<?php // onedesk-card.php — next to your ERP
$secret = 'the secret from OneDesk';
$raw = file_get_contents('php://input');
preg_match('/t=(d+),v1=([a-f0-9]+)/', $_SERVER['HTTP_X_ONEDESK_SIGNATURE_256'] ?? '', $m);
if (!$m || abs(time() - (int)$m[1]) > 300 || !hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2])) {
http_response_code(401); exit;
}
$req = json_decode($raw, true);
$email = $req['contact']['email'];
$customer = find_customer_by_email($email); // your ERP: a query, or its web services (e.g. SoftOne)
header('Content-Type: application/json; charset=utf-8');
if (!$customer) { echo json_encode(['found' => false, 'message' => 'Δεν είναι πελάτης στο ERP']); exit; }
$docs = latest_documents($customer['id'], 5);
echo json_encode([
'title' => $customer['name'],
'subtitle' => 'ΑΦΜ ' . $customer['vat'],
'url' => 'https://erp.example.gr/customers/' . $customer['id'],
'badges' => $customer['balance'] > 0 ? [['text' => 'Ανεξόφλητα', 'color' => 'red']] : [],
'fields' => [['label' => 'Υπόλοιπο', 'value' => number_format($customer['balance'], 2, ',', '.') . ' €']],
'sections' => [['title' => 'Τελευταία παραστατικά', 'items' => array_map(fn($d) => [
'title' => $d['code'], 'subtitle' => $d['date'], 'value' => number_format($d['total'], 2, ',', '.') . ' €',
'badge' => $d['paid'] ? ['text' => 'Εξοφλήθηκε', 'color' => 'green'] : ['text' => 'Ανεξόφλητο', 'color' => 'red'],
], $docs)]],
], JSON_UNESCAPED_UNICODE);
The bridge must be reachable from the internet over https (it can sit behind your firewall’s https port). Cards are part of the Team and Business plans.
Trigger: Webhooks by Zapier → Catch Hook, then add that URL as a webhook in OneDesk (or subscribe it with POST /hooks). Actions: Webhooks by Zapier → Custom Request with your token, e.g. POST /conversations/{id}/tasks.
Trigger: Webhooks → Custom webhook, copy its address into a OneDesk webhook. Actions: HTTP → Make a request to https://app.onedesk.gr/api/v1/… with the header Authorization: Bearer ti_….
Trigger: the Webhook node (POST); add its production URL as a OneDesk webhook. Actions: HTTP Request node, authentication “Header Auth” with Authorization = Bearer ti_….
Trigger on message.received, filter on the sender, then:
POST https://app.onedesk.gr/api/v1/conversations/{{data.conversationId}}/tasks
Authorization: Bearer ti_…
Content-Type: application/json
{"text": "Answer the VIP within the hour", "due": "{{today}}"}Questions or something missing? Write to hello@onedesk.gr.