Skip to content

Black Friday:

60% off

Cliedesk Pro

Every plan, every site count. Ends Cyber Monday.

00 days 00 hrs 00 min 00 sec
Claim 60% off

Developers

Automation platforms and calendars (Cliedesk Pro)

This guide covers a feature of Cliedesk Pro. The free plugin is a complete help desk; see what Pro adds.

Zapier, Make, n8n, Uncanny Automator, AutomatorWP and booking links. The code is the pro_platforms module in cliedesk-pro/src/Modules/Platforms/. Everything comes from the live registries: the webhook event catalogue (triggers) and the Public API catalogue over Actions (actions), so nothing is listed twice by hand.

The API for platforms

All routes are on cliedesk-api/v1 and need an API key (or OAuth token). A platform key usually has webhooks:read, webhooks:write, events:read and the scopes of the data it uses.

Route Scope What it does
GET /me any The connection test: key name, scopes, owner
GET /automation/triggers webhooks:read Event types this key can receive, with the read scope and a sample event
GET /automation/actions webhooks:read Public API writes this key can run: key, method, path, scope, fields, sample_input, sample_output
GET /hooks webhooks:read This key’s REST Hooks
POST /hooks webhooks:write Subscribe: target_url, event (a type or prefix.*), platform (zapier, make, n8n), optional product_ids, brand_ids
DELETE /hooks/{id} webhooks:write Unsubscribe (whk_…)
  • A REST Hook is an ordinary webhook subscription (webhooks): signed deliveries, retries, auto-pause and the delivery log. It is owned by the key’s owner, so payloads are rendered with the owner’s rights; the key’s product restriction becomes its product filter.
  • A key sees and removes only its own hooks, at most 25, and only for types its scopes can read (403 INSUFFICIENT_SCOPE with details.required_scope). Test keys get a dry run (id: null, nothing is created).
  • The key’s owner needs the webhook right (cliedesk_manage_settings, as for webhook.create); otherwise 403 FORBIDDEN.
  • Hooks of a revoked key or OAuth grant are removed at once; the daily job cliedesk_pro_platforms_maintenance also removes those of expired keys and of blocked or deleted OAuth clients.
  • Samples and polling: GET /events?types={type}&order=newest&limit=3 (event stream).
  • Actions are run with the Public API route of each Action and the same key; the key’s scopes, product restriction, rate limits and test-key dry runs apply as for any API call. Bulk jobs and webhook routes are not listed as actions.

App definitions in the repository

integrations/zapier/app-definition.json (Zapier Platform schema, with index.js), integrations/make/app.json (base, connection, dedicated webhook, modules) and integrations/n8n/ (credentials, a declarative action node and a trigger node). They are generated by Manifests::files() from the core catalogue (add-on Actions of one site are left out; /automation/actions lists them) and are not published; the owner decides where and when.

  • Regenerate after a catalogue change: wp cliedesk platforms manifests --write=<repo root>, or run ManifestContractTest with CLIEDESK_UPDATE_SNAPSHOTS=1 (like docs/api/openapi.json).
  • tests/phpunit/pro/automation-platforms/ManifestContractTest.php fails when a committed file differs from the live catalogue, when a trigger is not a live event type, or when an action’s route or scope does not exist.

WordPress automation plugins

Registered only when the plugin is active (its own start-up hook fires):

  • Uncanny Automator (automator_add_integration): Automator()->register->integration(), ->trigger() (one anonymous trigger per event type, code CLIEDESK_{TYPE}) and ->action(); tokens through automator_maybe_parse_token.
  • AutomatorWP (automatorwp_init): automatorwp_register_integration(), automatorwp_register_trigger() (cliedesk_{type}, fired with automatorwp_trigger_event(), tags {cliedesk_event_id}…) and automatorwp_register_action() (run on automatorwp_execute_action).
  • Triggers listen to the Pro action cliedesk_pro_wp_event_{type} (dots as underscores), fired with flat tokens: event_id, event_type, created_at, object_id, conversation_id, conversation_number, conversation_subject, contact_id, contact_email, product_id, actor_type.
  • Actions: create a conversation, reply, add an internal note, change the status. They run as a rule actor with the recipe author’s capabilities as the ceiling. Events caused by such an action do not fire recipe triggers again.
  • Tests use recorded stand-ins (tests/phpunit/fixtures/pro/automation-platforms/AutomatorStandIns.php) of the plugins’ documented calls. Check a new plugin version against them before a release.
  • Each person saves one booking page in Settings → Team → My profile → Booking link (PUT users/{id}/booking-link with url and aiMayOffer; Actions user.booking_link and user.booking_link.update). HTTPS only; Google Calendar appointment pages, Calendly and Cal.com are recognised, other booking pages are allowed. Team managers can change anyone’s. Kept in user meta cliedesk_pro_booking.
  • The team link pro_platforms.team_booking_url is used when a person has none.
  • Saved reply token {agent.booking_url} (Free’s cliedesk_saved_reply_tokens and cliedesk_saved_reply_token filters): the link of the person who sends the reply; for rules, the conversation’s assignee. Empty when no link is set (use a fallback: {agent.booking_url | "https://example.com/book"}).
  • The AI agent (M6) will offer meeting slots from the links with aiMayOffer on (BookingLinks::for_ai()). Nothing reads that choice before M6.