Mastodon icon

Mastodon

Consume Mastodon API

Actions5

Overview

This n8n node allows you to interact with the Mastodon API. It is designed to facilitate automation workflows that need to connect to a Mastodon instance, such as posting content, searching for posts, or managing user interactions. Common scenarios include automating social media publishing, monitoring hashtags, or integrating Mastodon data into other systems.

Practical examples:

  • Automatically post updates to your Mastodon account when new content is published on your website.
  • Search for specific hashtags and trigger notifications or further actions in your workflow.
  • Manage favourites or boosts (reblogs) programmatically.

Properties

Name Type Meaning
Mastodon URL String The base URL of the Mastodon instance you want to connect to (e.g., https://mastodon.example). This is required to direct API requests to the correct server.

Output

The node outputs a JSON object (or array of objects) containing the results from the Mastodon API operation performed. The exact structure of the output depends on the specific resource and operation selected, but typically includes fields returned by the Mastodon API, such as post content, user information, or status metadata.

If the node supports binary data (such as media uploads), it will summarize the meaning of the binary output (e.g., uploaded file details).

Dependencies

  • External Service: Requires access to a Mastodon instance via its public API.
  • Credentials: Optionally uses mastodonOAuth2Api credentials if authentication is needed for the chosen operation.
  • n8n Configuration: Ensure the Mastodon node is properly configured with the correct instance URL and, if necessary, OAuth2 credentials.

Troubleshooting

  • Common Issues:

    • Invalid Mastodon URL: If the provided Mastodon URL is incorrect or unreachable, API requests will fail.
    • Missing Credentials: Some operations may require authentication; ensure credentials are set up if needed.
    • API Rate Limits: Excessive requests may be rate-limited by the Mastodon instance.
  • Error Messages:

    • "401 Unauthorized": Indicates missing or invalid credentials. Check your OAuth2 setup.
    • "404 Not Found": The specified resource or endpoint does not exist on the Mastodon instance. Verify the URL and parameters.
    • "Network Error": The Mastodon instance may be down or the URL is incorrect.

Links and References

Discussion