Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Ayrshare

Scalekit connector
Open markdown

The Ayrshare connector lets your AI agent act in each user's Ayrshare account. Each user connects their own Ayrshare access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 58 tools.

Tools
58
What they doRead · write · destructive
36 · 15 · 736 read15 write7 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Ayrshare connection

    In AgentKit > Connections, create an Ayrshare connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'ayrshare'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Ayrshare:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'ayrshare_auto_schedule_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Ayrshare credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • ayrshare_auto_schedule_listList active auto schedules.Read-only

    List Auto Schedules

    List active auto schedules. Returns each schedule's title, times, days and last scheduled date. Use ayrshare_auto_schedule_set to change one.

    Inputs

    This tool takes no inputs.

  • ayrshare_auto_schedule_pending_listList auto-scheduled posts that are still pending.Read-only

    List Pending Auto-Scheduled Posts

    List auto-scheduled posts that are still pending. Returns each pending post's id, text and scheduled time. Use ayrshare_post_delete to remove one.

    Inputs

    This tool takes no inputs.

  • ayrshare_comments_getGet comments on a post by Ayrshare post ID, network post ID or comment ID.Read-only

    Get Comments

    Get comments on a post by Ayrshare post ID, network post ID or comment ID. Returns comments per network with id, text, author, created time and replies. Set search_platform_id or comment_id with platform when using network IDs.

    Inputs

    idstringrequired
    Ayrshare post ID, network post ID (with search_platform_id true) or network comment ID (with comment_id true). Example: TBEAAqAMMJoweA9wKHUl.
    comment_idboolean
    true when id is a network comment ID. Requires search_platform_id true and platform. Example: true.
    platformstring
    Required if searchPlatformId or commentId is true. When to use: ; If using the Social Post ID and "searchPlatformId": true field. Supported platforms: bluesky, facebook, instagram, linkedin, reddit, threads, tiktok, twitter, youtube. ; If using the Social Comment ID and "searchPlatformId": true and "commentId": true fields. Supported platforms: facebook, instagram, l. Example: facebook.one of blueskyfacebookinstagramlinkedinredditthreadstiktoktwitteryoutube
    search_platform_idboolean
    If getting comments on a post published via Ayrshare and using the Ayrshare Post ID, do not include this field - it defaults to false. If getting comments using the Social Post ID or Social Comment ID, which is the ID generated by the social networks, set to true. Example: true.
  • ayrshare_content_moderateCheck text, and optionally an image, for harmful content categories with AI moderation.Read-only

    Moderate Content

    Check text, and optionally an image, for harmful content categories with AI moderation. Returns whether it was flagged and the category scores. Use before publishing user-generated content.

    Inputs

    textstringrequired
    The text to analyze for moderation. Example: Check out our new sneakers!.
    image_urlstring
    The URL of the image. Must begin with https://. Example: https://img.ayrshare.com/012/gb.jpg.
  • ayrshare_feeds_listList the RSS feeds registered to the account.Read-only

    List RSS Feeds

    List the RSS feeds registered to the account. Returns each feed's id, URL, title, autoHashtag and useFirstImage settings. Use ayrshare_feed_update or ayrshare_feed_delete with the id.

    Inputs

    This tool takes no inputs.

  • ayrshare_hashtag_banned_checkCheck whether a hashtag is banned on Instagram or other networks.Read-only

    Check Banned Hashtag

    Check whether a hashtag is banned on Instagram or other networks. Returns whether the hashtag is banned. Use before adding hashtags to a post.

    Inputs

    hashtagstringrequired
    The hashtag to check, with or without #. Example: #bikinibody.
  • ayrshare_hashtags_auto_addAdd relevant AI-chosen hashtags to post text.Read-only

    Add Hashtags to Post

    Add relevant AI-chosen hashtags to post text. Returns the post text with hashtags added. Use ayrshare_hashtags_recommend for TikTok suggestions.

    Inputs

    poststringrequired
    Post text to add the hashtags. Max length 1,000 characters. Example: Big news: our spring collection is live! Shop now at https://example.com/spring.
    languagestring
    Specify the language code of the language of the post to assist the hashtag algorithm. Example: en.
    maxinteger
    Integer of max number of Hashtags to add. Max value range 1 to 10. Note: Instagram allows a maximum of 5 hashtags per post. Example: 3.
    positionstring
    Where to put the hashtags: auto (inside the text where relevant) or end. Example: auto.one of autoend
  • ayrshare_hashtags_recommendGet hashtag suggestions from TikTok for a keyword, with view counts.Read-only

    Recommend Hashtags

    Get hashtag suggestions from TikTok for a keyword, with view counts. Returns recommended hashtags and their data. Use ayrshare_hashtags_auto_add to insert hashtags into text.

    Inputs

    keywordstringrequired
    A single keyword; spaces are removed. Example: apple.