Publish a Post
Publish a post to social media platforms
Publish posts to the social networks you or your users have linked. If you want to publish posts to User Profiles, please see the /profiles endpoint for more details.
Please be sure to add your API_KEY
, and the PROFILE_KEY
if publishing to a User Profile, in the Authorization header.
The API Key can be found in the Ayrshare Developer Dashboard under the API Key page.
See the Post API Overview for more details on posting options.
Header Parameters
Body Parameters
The post text sent to the social networks specified in the platforms parameter. See here for advanced options, including how to include URLs and rich text.
Social media platforms to post. Accepts an array of Strings with values: bluesky
, facebook
, gmb
, instagram
, linkedin
, pinterest
, reddit
, snapchat
, telegram
, threads
, tiktok
, twitter
, or youtube
.
Please note: use facebook
for Facebook Pages, and gmb
for Google Business Profile.
Use all
to post to all linked social networks. Also include the required fields for all social network. E.g. title
must be included in youTubeOptions
if youtube
is linked.
An array of image or video URLs to include in the post. Please see /media endpoint to learn more.
URLs must be secure and begin with https://
. If the URL has special characters, e.g. ñ, please encode the special characters before sending.
Videos require a paid plan.
Please see here for Image and Video Requirements and other advanced options.
Ayrshare will try to determine the media type based on the file extension in the URL (.mp4). You can explicitly set the media a video if the URL does not end in a known video extension, such as animated GIFs.
Please see video extension for details.
The datetime to schedule a future post. Accepts a UTC date time.
For example, use format YYYY-MM-DDThh:mm:ssZ
and send as 2026-07-08T12:30:00Z
.
Please see utctime for more examples.
Also see schedule posts for details.
Add in a first comment automatically after posting. See first comment for details.
Disable comments for the post. Only available for Instagram, LinkedIn, and TikTok.
Shorten links in the post for all platforms using Ayrshare’s link shortener.
Only URLs starting with https will be shortened.
Max Pack required for link shortening.
Please see here for using 3rd party link shorteners.
Please see auto-schedule for details.
Also known as Evergreen Content, automatically repost n times every x days. A paid plan is required.
Parameters:
repeat
: (required) integer n times, max 10days
: (required) integer x times, min 3startDateTime
: (optional) as an ISO-8601 UTC date time. If not present, the first post will send immediately.
Please be careful when using this capability to stay in compliance with the social networks.
See auto hashtags for details.
See Bluesky details.
See Facebook details.
See Instagram details.
See LinkedIn details.
See Pinterest details.
See Reddit details.
See Snapchat details.
See Telegram details.
See Threads details.
See TikTok details.
See X/Twitter details.
See YouTube details.
See approval workflow for details.
Generate random post text for testing. randomPost: true
will ignore the post
field.
Generate a random media image for testing. randomMediaUrl: true
will ignore the mediaUrls
field.
An optional unique ID associated with the post. Duplicate IDs will be rejected. Please see idempotency for details.
Set notes on a post that can be retrieved via the /history endpoint. Notes are for reference only and do not affect the post.