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
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.
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).
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.
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.
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_
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→ yourendpoint_idfrom Crosslybotcrossly_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:
- REST API for developers — all payload fields, error handling
- AI agent → Crosslybot — ChatGPT/Claude integration
- n8n workflow — no-code automation
- Notion → Crosslybot — content calendar
- RSS aggregator — news publishing
Webhook input is available on Pro, Maxi and Business plans. Sandbox — on all plans.
Ready to try?
Connect the bot in 2 minutes. Free plan — no cards, no signup.