Webhook Documentation

Everything you need to integrate with external services like n8n.

Webhooks are a powerful way for your application to send and receive information from other services in real-time. Here’s how they work in your CRM.


Outgoing Webhooks

Your application sends these webhooks when certain events happen. You can set the destination URL in the Settings page.

Event: New Post Scheduled

This webhook is sent every time you schedule a new post in the Scheduler. It tells your external service (e.g., n8n) that a new post needs to be generated and published.

Method: POST

Data Format: application/json

Example Payload:
{
  "event": "new_post_scheduled",
  "channel_identifier": "@my_telegram_channel",
  "post_text_idea": "A post about morning coffee",
  "scheduled_at_utc": "2025-10-28 14:30:00",
  "post_id": 123
}
Field Descriptions:
  • event: The name of the event (always "new_post_scheduled").
  • channel_identifier: The public URL or @name of the target channel (e.g., "@my_channel" or "t.me/joinchat/...").
  • post_text_idea: The initial text or idea you entered in the scheduler. Your n8n workflow should use this as a prompt for AI text generation.
  • scheduled_at_utc: The planned publication time in UTC.
  • post_id: The unique ID of the post in this CRM, which can be used for status updates.

Incoming Webhooks

Your application can also receive webhooks from other services. This is how your n8n workflow reports back on the result of a publication.

The unique and secure URL for incoming webhooks is available on the Settings page.

Purpose: Report Publication Status

After your n8n workflow attempts to publish a post, it **must** send a webhook back to your CRM to report the outcome. This allows the system to update the post's status from "pending" to "published" or "failed".

Method: POST

Data Format: application/json

Required Fields:
  • post_id (integer): The ID of the post this update refers to. This is mandatory.
  • status (string): The outcome. Use published for success or failed for an error.
Example Payload (Success):

This is the minimal payload you need to send for a successful publication.

{
  "post_id": 123,
  "status": "published"
}
Example Payload (Error):

If something goes wrong, send this payload. You can include an optional details field for error messages.

{
  "post_id": 123,
  "status": "failed",
  "details": "Telegram API error: Chat not found."
}