Publish a Post
Publish a post to social media platforms
Post to the social networks you have enabled. If you want to post to user profiles, please see the /profiles endpoint for more details.
Please be sure to add your API KEY in place of API_KEY
in the Authorization header. The API Key can be found in the Ayrshare Developer Dashboard under the API Key page.
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: facebook
, twitter
, linkedin
, instagram
, youtube
, reddit
, telegram
, gmb
, pinterest
, or tiktok
.
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 al 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 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 2023-07-08T12:30:00Z
.
Please 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 unsplash for details.
See Facebook details.
See Instagram details.
See YoutTube details.
See Reddit details.
See Pinterest details.
See X/Twitter details.
See TikTok details.
See LinkedIn details.
See Telegram 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 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.