Ayrshare Integration with SmythOS
Want to put your social media on autopilot? Connect Ayrshare to SmythOS and empower your agents to schedule and publish content across all your social platforms from a single, unified workflow.
List of Ayrshare Components
Quickly compare Ayrshare components by what they do and their key I/O. Click any component name to jump directly to its detailed guide.
| Component | Action | What it Does | Inputs | Key Outputs | Use Case | 
|---|---|---|---|---|---|
| Send a Post | Write | Publishes a text-based post to one or more social platforms. | required postoptional platforms | id,status | Posting daily announcements or text updates. | 
| Send Post With Media | Write | Publishes a post that includes images or videos. | required post,mediaUrls | id,status | Sharing visual content like infographics or ads. | 
| Send YouTube Post | Write | Uploads and publishes a video specifically to YouTube. | required post,mediaUrls,title | id,status | Automating video content distribution. | 
| Get a Post | Read | Retrieves the status and details of a previously sent post. | required id | status,postIds | Checking if a scheduled post was successful. | 
| Delete a Post | Write | Removes a specific post from social media platforms. | required postId | status | Retracting a post made in error. | 
Prerequisites
Before you begin, please ensure you have the following:
- An active SmythOS account. (Sign up here).
- An Ayrshare account.
- Your Ayrshare API Key.
Getting Started With Ayrshare
The connection between SmythOS and Ayrshare is configured using a secure API Key.
Step 1: Get Your Ayrshare API Key
- Log in to your Ayrshare Dashboard.
- Your API Key is displayed on this page. Click to copy it.
Step 2: Store Your API Key in SmythOS Vault
Your API Key is a sensitive credential. Use the SmythOS Vault to store it securely.
- In your SmythOS dashboard, navigate to the Vault.
- Create a new secret and paste your Ayrshare API Key as the value. Give it a memorable name, like ayrshare_api_key.
- For more details, see the Vault Documentation.
Step 3: Configure an Ayrshare Component
- In your SmythOS agent graph, drag and drop any Ayrshare component.
- Click the component to open its Settings panel.
- In the Ayrshare API keyfield, select the secret you saved in the Vault (e.g.,ayrshare_api_key).
- Your connection is now configured for that component.
Which Ayrshare Component Should I Use?
| If you need to… | Target | Use this Component | Why this one? | 
|---|---|---|---|
| Post a simple text update | Twitter, Facebook, etc. | Send a Post | The most direct way to publish text-only content to multiple platforms. | 
| Share an image or video clip | Instagram, LinkedIn, etc. | Send Post With Media | Specifically designed to handle media URLs along with your text. | 
| Upload a video to your YouTube channel | YouTube | Send YouTube Post | Includes YouTube-specific fields like title,tags, andplaylistId. | 
| Check if a scheduled post went live | A post idfrom a previous step | Get a Post | The primary method for retrieving the status and live URLs of a post. | 
| Remove a post that was published by mistake | A postIdfrom Ayrshare | Delete a Post | The standard way to programmatically delete content. | 
Component Details
This section provides detailed information for each Ayrshare component.
Send a Post
Publishes a text-based post to your chosen social media platforms.
Component-Specific Settings
- Platforms: Select which social media platforms to post to from a dropdown list (e.g., twitter,linkedin,facebook, orall).
Inputs
| Field | Type | Required | Notes | 
|---|---|---|---|
| post | string | Yes | The text content to be published. URLs will be automatically shortened. | 
Outputs
| Field | Type | Description | 
|---|---|---|
| id | string | A unique ID for the Ayrshare post job. Use this with "Get a Post" to check status. | 
| status | string | The status of the request (e.g., success,error). | 
| postIds | array | An array of objects containing the ID of the live post on each platform. | 
| Response | object | The full, raw JSON response from the Ayrshare API. | 
| Headers | object | The HTTP headers from the API response. | 
{
  "component": "ayrshare.sendPost",
  "platforms": ["twitter", "linkedin"],
  "post": "New blog post alert! Check out our latest guide to building AI agents: [https://example.com/blog/ai-agents](https://example.com/blog/ai-agents)"
}
Send Post With Media
Publishes a post that includes one or more images or videos.
Component-Specific Settings
- Platforms: Select which social media platforms to post to.
Inputs
| Field | Type | Required | Notes | 
|---|---|---|---|
| post | string | Yes | The text content for the post. | 
| mediaUrls | array | Yes | An array of strings, where each string is a public URL to an image or video file. | 
Outputs
| Field | Type | Description | 
|---|---|---|
| id | string | A unique ID for the Ayrshare post job. | 
| status | string | The status of the request (e.g., success). | 
| postIds | array | An array containing the live post IDs for each platform. | 
| Response | object | The full, raw JSON response from the Ayrshare API. | 
| Headers | object | The HTTP headers from the API response. | 
{
  "component": "ayrshare.sendPostWithMedia",
  "platforms": ["facebook", "instagram"],
  "post": "Check out our new feature! #AI #Automation",
  "mediaUrls": ["[https://example.com/images/new-feature.jpg](https://example.com/images/new-feature.jpg)"]
}
Send YouTube Post
Uploads and publishes a video specifically to a YouTube channel.
Component-Specific Settings
- Visibility: Set the video's visibility on YouTube (public,unlisted, orprivate).
Inputs
| Field | Type | Required | Notes | 
|---|---|---|---|
| post | string | Yes | The description for the YouTube video. | 
| mediaUrls | array | Yes | An array containing one public URL to the video file. | 
| title | string | Yes | The title of the YouTube video. | 
| thumbNailUrl | string | Optional | URL of the video's custom thumbnail image. | 
| playlistId | string | Optional | The ID of a YouTube playlist to add the video to. | 
| tags | array | Optional | An array of string tags for the video. | 
| categoryId | string | Optional | The YouTube category ID for the video. | 
Outputs
| Field | Type | Description | 
|---|---|---|
| id | string | A unique ID for the Ayrshare post job. | 
| status | string | The status of the request. | 
| postIds | array | Contains the post ID for the published YouTube video. | 
| Response | object | The full, raw JSON response from the Ayrshare API. | 
| Headers | object | The HTTP headers from the API response. | 
Get a Post
Retrieves the current status and details of a post previously sent via Ayrshare.
Inputs
| Field | Type | Required | Notes | 
|---|---|---|---|
| id | string | Yes | The unique ID of the post job, obtained from the output of a "Send Post" component. | 
Outputs
| Field | Type | Description | 
|---|---|---|
| status | string | The current status of the post (e.g., success,error,scheduled). | 
| postIds | array | An array of objects containing the live post ID and URL for each platform where the post was successful. | 
| Response | object | The full, raw JSON response from the Ayrshare API. | 
| Headers | object | The HTTP headers from the API response. | 
Delete a Post
Removes a specific post from your social media platforms.
Inputs
| Field | Type | Required | Notes | 
|---|---|---|---|
| postId | string | Yes | The unique identifier of the post to be deleted. This ID comes from the postIdsoutput of a "Send Post" component. | 
Outputs
| Field | Type | Description | 
|---|---|---|
| status | string | The status of the deletion request (e.g., success). | 
| Response | object | The raw JSON response from the Ayrshare API. | 
| Headers | object | The HTTP headers from the API response. | 
Best Practices & Advanced Tips
- Secure Your API Key: Always store your Ayrshare API Key in the SmythOS Vault.
- Use a URL Shortener: While Ayrshare shortens URLs, for advanced tracking and analytics, consider using a dedicated URL shortener service first and including the shortened link in your posttext.
- Scheduling Posts: To schedule a post for the future, include a scheduleDateparameter in theBodyof your request. This is an advanced input you can add. The date should be in ISO 8601 format.
- Check Post Status: After sending a post, it's good practice to use the returned idwith theGet a Postcomponent after a short delay to confirm that it was published successfully on all platforms.
Troubleshooting Common Issues
- 
Error: 401 Unauthorized- Cause: The API Key is incorrect, invalid, or missing.
- Solution: Verify that the API Key in your SmythOS Vault is correct and matches the one in your Ayrshare dashboard.
 
- 
Error: 400 Bad Request- Cause: A required input is missing (e.g., no posttext), amediaUrlslink is invalid or not publicly accessible, or the post violates a platform's rules (e.g., text is too long for Twitter).
- Solution: Check all inputs. Ensure media URLs are public and direct links to the media file. Check the Responseobject for a more detailed error message from Ayrshare.
 
- Cause: A required input is missing (e.g., no 
- 
Post Fails on One Platform but Not Others - Cause: The social media account for that platform may have become disconnected, or the content violates a specific rule for that platform.
- Solution: Log in to your Ayrshare dashboard to check the status of your linked social accounts. Re-link any that show an error. Adjust your content to meet the specific platform's guidelines.
 
What's Next?
You are now ready to build a powerful social media automation engine with the SmythOS Ayrshare Integration!
Consider these ideas:
- 
Build an Agent That... - Creates a "content machine." It uses an AI model from OpenRouter to write a short social media tip, generates a relevant background image with Stability AI, and posts the final image and text to Instagram and LinkedIn.
- Monitors an RSS feed of your company's press releases. When a new one is published, it posts the title and a link to your corporate Twitter account.
- Connects to your e-commerce platform. When a new 5-star product review is submitted, it formats the review into a nice graphic and posts it to Facebook.
 
- 
Explore Other Integrations: - Use the Google Sheets Integration to create a simple content calendar. Your agent can read rows from the sheet daily and post the content via Ayrshare.
- Connect to Ahrefs or another SEO tool. When your website earns a new, high-quality backlink, post a "Thank You" message mentioning the linking site on Twitter.