ArtyChat Developers

Webhooks

Receive signed, near real-time notifications when important activity happens in an ArtyChat business. Use webhooks to confirm API or MCP actions, synchronize CRMs, trigger automations, and keep external systems up to date.

EVENTS / HTTPS / HMAC-SHA256

Quick start

  1. Create an External API token with webhooks:write and webhooks:read.
  2. Register an HTTPS endpoint and choose the events you want.
  3. Copy the signing secret returned at creation. It is shown only once.
  4. Verify X-ArtyChat-Signature before processing each request.
  5. Return any 2xx response within 15 seconds to acknowledge delivery.
curl -X POST https://artychat.com/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production CRM",
    "url": "https://example.com/webhooks/artychat",
    "events": ["booking.created","booking.status_changed","customer.updated"]
  }'

Supported events

Subscribe to individual events or use * to receive every supported event.

EventWhen it fires
booking.createdA booking is created from web, mobile, API, MCP, or another ArtyChat flow.
booking.updatedA booking record changes.
booking.status_changedBooking status changes.
customer.createdA customer/contact is created.
customer.updatedA customer/contact changes.
order.createdA store order is created.
order.updatedA store order changes.
order.status_changedStore order status changes.
pos.sale.createdA POS sale/order is created.
pos.sale.updatedA POS sale/order changes.
pos.sale.status_changedPOS status changes.
message.received / message.sentCustomer or business-side chat message activity.
conversation.created / conversation.updatedConversation lifecycle and assignment/state changes.
invoice.created / invoice.updated / invoice.paidInvoice and quote lifecycle, including payment completion.
payment.created / payment.completed / payment.failedPayment lifecycle.
lead.created / lead.updatedCRM lead lifecycle.
form.submittedA new public form submission is received.
task.created / task.completedTask lifecycle.
campaign.started / campaign.completedWhatsApp campaign lifecycle.
product.created / product.updated / product.low_stockCatalog changes and low-stock notification (threshold 5).
webhook.testGenerated by the test-delivery endpoint.
expense.createdExpense lifecycle.
expense.updatedExpense lifecycle.
expense.deletedExpense lifecycle.
delivery.createdDelivery creation, assignment, or lifecycle transition.
delivery.updatedDelivery creation, assignment, or lifecycle transition.
delivery.assignedDelivery creation, assignment, or lifecycle transition.
delivery.acceptedDelivery creation, assignment, or lifecycle transition.
delivery.picked_upDelivery creation, assignment, or lifecycle transition.
delivery.delivered / delivery.canceledDelivery creation, assignment, or lifecycle transition.
delivery.status_changedDelivery creation, assignment, or lifecycle transition.
dispatch.status_changedDispatch preparation status changes.

Payload format

Expense events contain data.expense. Delivery events contain data.delivery and data.metadata; status_changed also includes previous_status and status. Delivery payloads omit internal proof storage paths. Delivery events are queued after the database transaction commits and also cover automatic handoff when a POS order becomes ready.

Each delivery has a stable event envelope. The resource-specific object is inside data.

{
  "id": "4a1a2a92-0b3b-4df5-9cb4-b70934af52a1",
  "type": "booking.status_changed",
  "created_at": "2026-10-05T05:10:00.000000Z",
  "business_id": 29,
  "data": {
    "booking": {
      "id": 1234,
      "status": "confirmed"
    },
    "previous_status": "pending",
    "status": "confirmed"
  }
}
Delivery headers:
  • X-ArtyChat-Event — event name.
  • X-ArtyChat-Delivery — unique delivery UUID.
  • X-ArtyChat-Timestamp — Unix timestamp used for signing.
  • X-ArtyChat-Signature — HMAC-SHA256 signature in v1=... format.

Verify webhook signatures

Compute HMAC-SHA256 over timestamp + "." + raw_request_body with your endpoint signing secret. Compare the result using a constant-time comparison.

PHP

$body = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_ARTYCHAT_TIMESTAMP'] ?? '';
$received = $_SERVER['HTTP_X_ARTYCHAT_SIGNATURE'] ?? '';

$expected = 'v1=' . hash_hmac(
    'sha256',
    $timestamp . '.' . $body,
    getenv('ARTYCHAT_WEBHOOK_SECRET')
);

if (!hash_equals($expected, $received)) {
    http_response_code(401);
    exit('Invalid signature');
}

http_response_code(200);

Node.js

const crypto = require("crypto");

const expected = "v1=" + crypto
  .createHmac("sha256", process.env.ARTYCHAT_WEBHOOK_SECRET)
  .update(timestamp + "." + rawBody)
  .digest("hex");

if (!crypto.timingSafeEqual(
  Buffer.from(expected),
  Buffer.from(signature)
)) {
  return res.status(401).send("Invalid signature");
}

res.sendStatus(200);

Webhook management API

All paths are relative to https://artychat.com/api/v1.

MethodPathScopePurpose
GET/webhooks/eventswebhooks:readList supported events
GET/webhookswebhooks:readList endpoints
POST/webhookswebhooks:writeCreate endpoint
PATCH/webhooks/{id}webhooks:writeUpdate endpoint/events
DELETE/webhooks/{id}webhooks:writeDelete endpoint
POST/webhooks/{id}/rotate-secretwebhooks:writeRotate signing secret
GET/webhooks/{id}/deliverieswebhooks:readDelivery history
POST/webhooks/{id}/testwebhooks:writeSend test delivery
POST/webhooks/{id}/deliveries/{delivery}/retrywebhooks:writeRetry a delivery

Each business can create up to 20 webhook endpoints. Endpoint URLs must use HTTPS.

Acknowledgements and retries

  • Any HTTP 2xx response acknowledges a delivery.
  • The endpoint has 15 seconds to respond.
  • Failed deliveries are retried automatically up to 5 attempts.
  • Retry delays increase progressively: approximately 1 minute, 5 minutes, 15 minutes, and 1 hour.
  • Use X-ArtyChat-Delivery as an idempotency key. Your receiver should safely ignore duplicate delivery IDs.

Test an endpoint

curl -X POST https://artychat.com/api/v1/webhooks/1/test \
  -H "Authorization: Bearer YOUR_API_KEY"

Test deliveries use event type webhook.test and the same signing mechanism as production events.

Security recommendations

  • Always verify the HMAC signature against the raw request body before parsing or acting on the payload.
  • Reject stale timestamps to reduce replay risk. A 5-minute tolerance is a common choice.
  • Store signing secrets in a secret manager or environment variable.
  • Rotate a signing secret immediately if you suspect it was exposed.
  • Return quickly, then perform slow processing asynchronously in your own queue.
  • Do not assume delivery order. Use event timestamps and resource IDs when sequencing matters.