Mastodon icon

Mastodon

Consume Mastodon API

Actions5

Overview

This n8n node allows you to interact with the Mastodon API, specifically to "favourite" (like) a status. The "Favourite" operation for the "Status" resource enables users to mark a specific Mastodon post as a favourite by providing its ID and the instance URL. This is useful for automating social media engagement, such as automatically liking posts that match certain criteria or integrating Mastodon interactions into broader workflows.

Example scenarios:

  • Automatically favourite posts containing specific hashtags.
  • Like posts from a particular user as part of a monitoring or engagement workflow.
  • Integrate Mastodon activity with other platforms (e.g., favourite a post when a related event happens elsewhere).

Properties

Name Type Meaning
Mastodon URL String The base URL of the Mastodon instance you want to interact with.
Status ID String The unique identifier of the status (post) you wish to favourite/like.

Output

The node outputs a JSON object representing the result of the "favourite" action on the specified status. The structure typically includes details about the favourited status, such as its ID, content, and updated favourite count. The exact fields depend on the Mastodon API response, but you can expect at least:

{
  "id": "string",
  "content": "string",
  "favourites_count": number,
  // ...other Mastodon status fields
}

Dependencies

  • External Service: Requires access to a Mastodon instance via its public API.
  • Authentication: Optionally uses mastodonOAuth2Api credentials if authentication is required by the instance.
  • n8n Configuration: No special environment variables are required unless your Mastodon instance needs custom OAuth settings.

Troubleshooting

  • Invalid Mastodon URL: Ensure the "Mastodon URL" is correct and points to a valid Mastodon instance.
  • Missing or Invalid Status ID: If the "Status ID" is missing or incorrect, the node will fail to find the status and may return an error like "Status not found."
  • Authentication Errors: If the instance requires authentication and credentials are missing or invalid, you may see errors related to authorization.
  • API Rate Limits: Excessive requests may trigger rate limiting on some Mastodon instances.

Links and References

Discussion