write

Create a draft

Save an EXACT, ready-to-publish post as a draft from text you (the assistant) wrote yourself. This is the ONLY way to create a post: the server never generates copy and spends no AI credits — the body is stored verbatim, in whatever language you wrote it (only deterministic typography cleanup is applied unless deslop:false). It guarantees the language and wording you intended. The result is a DRAFT only — nothing is published until schedule_post is confirmed, so the operator stays in full control. Call it once, for text the operator has already approved: iterate on wording with preview_post(text) first. Each call creates a NEW draft that shows up in the team's review queue, and saved drafts cannot be edited here, so saving every revision floods the queue with near-identical drafts. To attach media, pass public direct-download links in imageUrls / videoUrls / audioUrls: the server fetches them and publishes the post with the media attached. If any link fails to download, NO draft is created — fix the link and retry. Note: a post with media is a caption (1024-char limit, checked by preview_post). Tracks (audioUrls) go out as music and cannot share a post with photos or videos; they need rightsConfirmed:true, which you may set only after the operator confirmed they hold the rights to publish those tracks.

post/api/v1/create_post_from_text

Request

  • Base URL: https://awraiter.ai
  • URL: https://awraiter.ai/api/v1/create_post_from_text
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Retry key (≤ 200 characters). A repeated call with the same key returns the first call's result instead of acting twice. Without it the server hashes the arguments, which catches retries but treats a deliberate repeat within 24 hours as one too.

Request body

channelIdnumber required
bodystring required

Post text in Markdown as Telegram renders it: bold, italic, underline, strikethrough, ||spoiler||, text, code. A quote is one or more lines starting with "> "; it ends at the first line without ">", and goes out as a plain quote. Separate paragraphs with a blank line. Premium emoji: <tg-emoji id="ID">🔥</tg-emoji>, with an ID from the channel's emoji sets (get_channel → customEmoji); the emoji inside the tag must be the base emoji of that ID and is shown where premium emoji cannot render.

titlestring
deslopboolean

Strip AI-tell typography (em dashes -> hyphen, smart quotes). Default true. No AI is used either way.

imageUrlsstring[]

Public http(s) direct links to images to attach (jpg/png/webp; svg/gif rejected).

videoUrlsstring[]

Public http(s) direct links to videos to attach (mp4 preferred).

audioUrlsstring[]

Public http(s) direct links to audio files (mp3/m4a/ogg/wav/flac, up to 49 MB each), sent as music tracks with the post text as the caption. Not a YouTube/SoundCloud page: the link must return the file itself. Cannot be combined with imageUrls/videoUrls. Requires rightsConfirmed:true.

rightsConfirmedboolean

Required with audioUrls. Set true only after the operator has confirmed they hold the rights to use these tracks and publish them in the channel. Ask them; never assume.

planItemIdnumber

Optional content-plan slot id this draft fills. The slot must belong to this channel's plan and have no post yet; on success the draft is linked to it and the slot is marked completed. The channel's autopilot policy then decides: the response's autopilot.action is 'auto' (a plan was created at the slot time, planId/publishAt) or 'approve' (the draft waits in the review queue; reason says why — policy_manual, streak_below_target, recommendation_revise, banlist_hit, quiet hours, daily limit…). Do not call schedule_post for a draft the policy already scheduled.

Response

The tool's result in data.

okunknown required
dataobject required

Not declared by the tool yet; treat the shape as informational.

Changes

No recorded changes to this operation across all 1 revision of this API.