Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

unipile-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and authenticate Unipile webhooks (unified messaging, email and LinkedIn API). Use when building a Unipile webhook receiver, securing it with a shared…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Unipile Webhooks

Unipile is a unified API for messaging (LinkedIn, WhatsApp, Instagram, Telegram), email (Google, Microsoft, IMAP) and calendars. You create a webhook with POST /api/v1/webhooks (or in the Unipile dashboard), choose a source, and Unipile sends an HTTP POST to your request_url when something happens.

Things that differ from most providers:

  1. There is no signature. Unipile doesn't sign the body. No HMAC, no timestamp header. Instead you add your own secret to the webhook's headers array and Unipile sends it on every delivery.
  2. Payloads differ by source. Messaging, email, email tracking and users webhooks send a flat object with an event field. Account status webhooks send {"AccountStatus": {...}} with no event field.
  3. No JSON content type by default for webhooks created through the API. Add {"key": "Content-Type", "value": "application/json"} to headers, and parse the raw body yourself either way.

When to Use This Skill

  • How do I receive Unipile webhooks?
  • How do I verify Unipile webhook signatures? (You can't. Send a shared secret in a header instead.)
  • How do I create a Unipile webhook with the API and add an Unipile-Auth header?
  • How do I handle message_received, message_read and mail_received?
  • How do I detect an account that needs reconnecting (CREDENTIALS)?
  • Why does my Unipile webhook arrive more than once?

Verification (core): a shared secret header

Create the webhook with a secret in headers:

curl --request POST --url https://{YOUR_DSN}/api/v1/webhooks \
  --header 'X-API-KEY: XXXXXXXX' --header 'content-type: application/json' \
  --data '{
    "request_url": "https://example.com/webhooks/unipile",
    "source": "messaging",
    "headers": [
      { "key": "Content-Type", "value": "application/json" },
      { "key": "Unipile-Auth", "value": "<secret from openssl rand -hex 32>" }
    ]
  }'

Then check the header in constant time before you parse the body:

const crypto = require('crypto');

// NOT a Unipile signature. This is a secret YOU put in the webhook's headers array.
function verifyUnipileSecret(headerValue) {
  const expected = process.env.UNIPILE_WEBHOOK_SECRET;
  if (!expected) throw new Error('UNIPILE_WEBHOOK_SECRET is not set'); // fail closed
  if (typeof headerValue !== 'string') return false;
  const a = Buffer.from(headerValue);
  const b = Buffer.from(expected);
  // Length check first: timingSafeEqual throws on a length mismatch.
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// Express: verifyUnipileSecret(req.get('Unipile-Auth'))

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Return 401 for a missing or wrong secret and 500 when the secret isn't configured, so the endpoint never accepts everything by accident. The header name (Unipile-Auth) is your choice, and header names are case-insensitive. See references/verification.md.

Sources and Events

source Events Payload shape
messaging message_received (default), message_read, message_reaction, message_edited, message_deleted, message_delivered Flat: account_id, account_type, event, chat_id, message_id, message, sender, attendees, attachments
email mail_received (default), mail_sent, mail_moved Flat: email_id, account_id, event, from_attendee, to_attendees, subject, body, origin
email_tracking mail_opened, mail_link_clicked Flat: event, event_id, tracking_id, email_id, account_id, url
users new_relation Flat, with event
calendar_event calendar_event_created (default), calendar_event_updated, calendar_event_deleted Flat: event, webhook_name, account_id, calendar_id, id
account_status message is CREATION_SUCCESS, RECONNECTED, SYNC_SUCCESS, OK, CREDENTIALS, ERROR, STOPPED, DELETED, ... {"AccountStatus": {"account_id", "account_type", "message"}}

Notes:

  • Sent messages are delivered as message_received. Compare account_info.user_id with sender.attendee_provider_id to tell your own from others. The email webhook covers sent email too (mail_sent), and its origin is unipile or external.
  • Account status message values include OK, CREDENTIALS, ERROR/STOPPED, CONNECTING, DELETED, CREATION_SUCCESS, RECONNECTED and SYNC_SUCCESS. When the status isn't OK, Unipile stops sending new-message webhooks for that account, so surface CREDENTIALS to the user and start a reconnect.
  • Dispatch on AccountStatus first, then on event. Acknowledge events you don't handle with 200.

Delivery, Retries and Idempotency

  • Reply with a 200 in under 30 seconds. Otherwise Unipile makes **five retry atte
Полный SKILL.md на GitHub

Установить unipile-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/unipile/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл unipile-webhooks?

Receive and authenticate Unipile webhooks (unified messaging, email and LinkedIn API). Use when building a Unipile webhook receiver, securing it with a shared secret header such as Unipile-Auth (Unipile has no HMAC signature), creating webhooks with POST /api/v1/webhooks, handling message_received, message_read, mail_received and account status (OK, CREDENTIALS) payloads, or debugging Unipile webhook retries and missing JSON content types.

Как установить скилл unipile-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл unipile-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить unipile-webhooks с