How to publish a post to Telegram via cURL in 5 minutes

5 minutes from sign-up to first post via API. cURL command inside.

How to set up

1

Minute 1: Sign up

Open https://t.me/Crosslybot, hit /start. Go through the quick onboarding (language, consent, plan). Webhook input requires Pro+, so pick Pro.

2

Minute 2: Create a webhook

In the Mini App go to Channels → Webhook → Create → Inbound. Enter a name (e.g. 'My first webhook'). Get the Bearer token — click Copy, save to a text file (shown ONCE).

3

Minute 3: Create a project

Home → Create project. Pick your webhook as source. Add a target channel — a Telegram channel where the bot has admin rights. Activate the project.

4

Minute 4: Send cURL

Open a terminal, run the curl command from the section below on this page. Replace `endpoint_id` (number) and Bearer token with your own values.

5

Minute 5: Verify

Open your Telegram channel — the post should appear. If not — check the API response (200 OK?) and Crosslybot logs in Operations → Published.

FAQ

What if API returns 401 Unauthorized?

Check the Bearer token: format must be Authorization: Bearer crossly_live_. If the token is correct — it may have been revoked. In Crosslybot go to webhook details → Rotate token (old one is revoked instantly).

And if 400 Bad Request?

Response contains errors[] with the list of specific payload validation issues. Most common: media type not in {photo, video, audio} (document is blocked), URL not https://, entity offset exceeds text length.

Where to find endpoint_id?

In Crosslybot, in your webhook's card. Or in the URL — clicking on the webhook in the list opens a page with the endpoint and its ID.

Can I skip creating a project?

No — a webhook without a project works in 'accept 200 OK, do nothing' mode (for security — an attacker can't tell the difference between 'token valid' and 'token valid and in use'). Create a project for posts to actually publish.

Is webhook supported on Free?

Sandbox tester is available on all plans (Free: 100 requests/day). Actual webhook input (with publishing) — Pro+ only.

The fastest way to publish a post to Telegram, VK and Max from code is the Crosslybot webhook. No need to register a Bot Token, go through VK OAuth, or fight Max API. One Crosslybot Bearer token, one cURL command — and the post is live.

cURL command

curl -X POST 'https://wh.crosslybot.com/v1/webhooks/12345' \
  -H 'Authorization: Bearer crossly_live_xxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: hello-world-001' \
  -d '{
    "text": "Hello, world! 👋\n\nThis is my first post via webhook.",
    "entities": [
      {"type": "bold", "offset": 0, "length": 13}
    ]
  }'

Replace:

  • 12345 → your endpoint_id from Crosslybot
  • crossly_live_xxxxx... → your Bearer token

Expected response

{
  "ok": true,
  "id": "post_abc123",
  "trace_id": "tr_xyz789",
  "queued_targets": 1
}

queued_targets — how many project targets received this post.

Next — example with media

curl -X POST 'https://wh.crosslybot.com/v1/webhooks/12345' \
  -H 'Authorization: Bearer crossly_live_...' \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "Post with an image",
    "media": [
      {"type": "photo", "url": "https://picsum.photos/800/600"}
    ],
    "buttons": [
      [{"text": "Learn more", "url": "https://crosslybot.com"}]
    ]
  }'

Sandbox without real publishing

If you want to test the payload format without sending to channels:

curl -X POST 'https://wh.crosslybot.com/v1/sandbox/test' \
  -H 'Authorization: Bearer crossly_live_...' \
  -H 'Content-Type: application/json' \
  -d '{...same payload...}'

Sandbox validates JSON schema and media URLs, returns would_create_post without DB write.

What’s next

Read the in-depth guides:

Webhook input is available on Pro, Maxi and Business plans. Sandbox — on all plans.

Free plan

Ready to try?

Connect the bot in 2 minutes. Free plan — no cards, no signup.

More about the bot →