POST
/
post
Available on Basic, Premium, Business, Enterprise plans.

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

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY
Profile-Key
string
Profile Key of a User Profile.

Format: Profile-Key: PROFILE_KEY

Body Parameters

post
string
required

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.

platforms
array
required

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.

mediaUrls
array

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.

isVideo
boolean
default: false

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.

scheduleDate
string

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.

firstComment
object

Add in a first comment automatically after posting. See first comment for details.

disableComments
boolean
default: false

Disable comments for the post. Only available for Instagram, LinkedIn, and TikTok.

shortenLinks
boolean
default: false

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.

autoSchedule
object

Please see auto-schedule for details.

autoRepost
object

Also known as Evergreen Content, automatically repost n times every x days. A paid plan is required.

Parameters:

  • repeat: (required) integer n times, max 10
  • days: (required) integer x times, min 3
  • startDateTime: (optional) as an ISO-8601 UTC date time. If not present, the first post will send immediately.
{
  "repeat": 3,
  "days": 5,
  "startDateTime": "2021-07-08T12:30:00Z"
}

Please be careful when using this capability to stay in compliance with the social networks.

autoHashtag
object

See auto hashtags for details.

unsplash
string

See unsplash for details.

faceBookOptions
object
instagramOptions
object
gmbOptions
object
youTubeOptions
object
redditOptions
object
pinterestOptions
object
twitterOptions
object
tikTokOptions
object
linkedInOptions
object
telegramOptions
object
requiresApproval
boolean
default: false

See approval workflow for details.

randomPost
boolean
default: false

Generate random post text for testing. randomPost: true will ignore the post field.

randomMediaUrl
boolean
default: false

Generate a random media image for testing. randomMediaUrl: true will ignore the mediaUrls field.

idempotencyKey
string

An optional unique ID associated with the post. Duplicate IDs will be rejected. Please idempotency for details.

notes
string

Set notes on a post that can be retrieved via the /history endpoint. Notes are for reference only and do not affect the post.