Developer recipe

Send one message to an existing conversation

Send one plain-text message using an exact account/chat scope and a stable caller-generated idempotency key.

Result
One accepted send is associated with a durable operation identity; ambiguous outcomes are never retried automatically.
Time
5 minutes
Key scopes
send

Safety contract

  1. Use an existing eligible chat returned by the API.
  2. Review the exact account, recipient, and text before submitting.
  3. Generate one stable Idempotency-Key for the exact logical send.
  4. After an ambiguous result, reconcile read-only; never issue a new key to retry it.

Send

Terminal
export GRAMCLAW_BASE_URL="https://gramclaw.com"
export GRAMCLAW_API_KEY="gc_live_replace_with_your_key"
export TELEGRAM_ACCOUNT_ID="replace_with_account_id"

curl -s "$GRAMCLAW_BASE_URL/api/v1/messages" \
  -H "Authorization: Bearer $GRAMCLAW_API_KEY" \
  -H "Idempotency-Key: replace_with_stable_operation_key" \
  -H "Content-Type: application/json" \
  -d '{"account_id":"'"$TELEGRAM_ACCOUNT_ID"'","chat_id":"telegram:chat:replace_with_chat_id","text":"Reviewed message text"}'
  • This endpoint cannot start a chat, send attachments, broadcast, or fall back to Unipile.
Chat on Telegram