Medium Integration with SmythOS
Want to automate your content distribution on Medium? Connect Medium to SmythOS and empower your agents to publish articles directly to your profile or publications.
List of Medium Components
Quickly compare Medium 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 |
---|---|---|---|---|---|
Publish Blog Post | Write | Publishes an article directly to a user's profile or publication. | required title , content optional userId | blogId , blogUrl | Syndicating content from another blog. |
Get User Details | Read | Retrieves the profile details of the authenticated user. | required trigger | userId | Verifying the authenticated user's ID. |
Prerequisites
Before you begin, please ensure you have the following:
- An active SmythOS account. (Sign up here).
- A Medium account.
- Your Medium Integration Token.
Getting Started With Medium
The connection between SmythOS and Medium is configured using a secure Integration Token.
Step 1: Get Your Medium Integration Token
- Log in to your Medium account.
- Navigate to your Settings by clicking your profile picture.
- In the "Security and apps" section, find the Integration tokens area. The direct link is
https://medium.com/me/settings/security
. - Enter a description for your token (e.g., "SmythOS Agent") and click Get integration token.
- Medium will generate a token for you. Copy it to your clipboard.
Step 2: Store Your Token in SmythOS Vault
Your Integration Token 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 Medium Integration Token as the value. Give it a memorable name, like
medium_integration_token
. - For more details, see the Vault Documentation.
Step 3: Configure a Medium Component
- In your SmythOS agent graph, drag and drop any Medium component.
- Click the component to open its Settings panel.
- In the
Integration Token
field, select the secret you saved in the Vault (e.g.,medium_integration_token
). - Your connection is now configured for that component.
Which Medium Component Should I Use?
If you need to… | Target | Use this Component | Why this one? |
---|---|---|---|
Publish a new article | A title and content | Publish Blog Post | The core component for programmatically publishing content to Medium. |
Confirm which user is authenticated | Your own account | Get User Details | A simple way to verify your connection and retrieve your own user ID. |
Component Details
This section provides detailed information for each Medium component.
Publish Blog Post
Publishes a new post to the authenticated user's profile or, if a publicationId
is provided, to a specific publication.
Component-Specific Settings
- Content Format: Select the format of your
content
input.html
: For content written with HTML tags.markdown
: For content written in Markdown.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
title | string | Yes | The title of the post. This is used for SEO but will not appear in the post body itself. |
content | string | Yes | The body of the post. To have a title appear on the page, you must include it here (e.g., as an <h1> tag or # heading). |
userId | string | Optional | The ID of the user to publish as. You must get this from the "Get User Details" component first. Defaults to the authenticated user. |
Outputs
Field | Type | Description |
---|---|---|
blogId | string | The unique ID of the newly published post. |
blogUrl | string | The direct URL to the live post on Medium. |
Response | object | The full, raw JSON response from the Medium API. |
Headers | object | The HTTP headers from the API response. |
{
"component": "medium.publishBlog",
"title": "My New Post on AI Agents",
"content": "# My New Post on AI Agents\\n\\nThis is the first paragraph of my amazing new article.",
"userId": "1a2b3c4d5e6f"
}
Get User Details
Retrieves the profile information of the user authenticated by the Integration Token.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
trigger | any | Yes | Any input value can be used to trigger the component's execution. It does not affect the output. |
Outputs
Field | Type | Description |
---|---|---|
userId | string | The unique identifier for the authenticated user. |
Response | object | The full, raw JSON response from the Medium API, containing username, name, URL, and image URL. |
Headers | object | The HTTP headers from the API response. |
{
"component": "medium.getUserDetails",
"trigger": "get my id"
}
Best Practices & Advanced Tips
- Secure Your Integration Token: Always store your Medium Integration Token in the SmythOS
Vault
. - Content Formatting: Decide whether you want to provide your content as HTML or Markdown and set the "Content Format" setting accordingly. For blog posts, Markdown is often easier to generate and manage.
- Include the Title in the Body: This is the most common point of confusion. Remember to add your article's title as a heading (e.g.,
# My Title
) at the top of yourcontent
input if you want it to be visible on the published page. - Publishing to Publications: To publish to a specific Medium Publication you own or contribute to, you first need to get that publication's ID. You can do this by using a custom API call to list the user's publications, then passing that ID into an advanced input field for the
Publish Blog Post
component.
Troubleshooting Common Issues
-
Error:
401 Unauthorized
- Cause: The Integration Token is incorrect, has been revoked, or is missing.
- Solution: Verify that the token in your SmythOS Vault is correct and active. Generate a new token in your Medium settings if necessary and update your Vault secret.
-
Error:
400 Bad Request
- Cause: A required field like
title
orcontent
is missing from the request. - Solution: Check that all required inputs are provided and are not empty strings.
- Cause: A required field like
-
Article is Published Without a Title
- Cause: The title was provided in the
title
input but was not included in thecontent
input. - Solution: Add the title as a Markdown heading (
# My Title
) or an HTML tag (<h1>My Title</h1>
) at the beginning of thecontent
string.
- Cause: The title was provided in the
What's Next?
You are now ready to build powerful content automation pipelines with the SmythOS Medium Integration!
Consider these ideas:
-
Build an Agent That...
- Connects to your Dev.to account. When you publish an article there, an agent is triggered to re-publish the same content to Medium.
- Generates a weekly "Best of" digest. The agent finds your top-performing blog posts from the past, combines them into a new summary article, and publishes it to Medium.
-
Explore Other Integrations:
- After an agent publishes a new article to Medium, it can take the
blogUrl
output and share it across your social media channels using the Ayrshare Integration. - Keep a log of all published articles by having your agent write the
blogId
andblogUrl
to a Google Sheet or Notion database.
- After an agent publishes a new article to Medium, it can take the