reactions

Toggle a reaction on a target resource (Article, Comment, or User) on behalf of the authenticated user.

    ### Toggle Logic:
    - **First Request**: Creates a new reaction of the specified category on the reactable target.
    - **Second Request (with same parameters)**: Deletes the existing reaction.
    - Particularly useful for simple, interactive UI buttons like "Like", "Unicorn", or "Save" where clicking toggles the active state.
post/api/reactions/toggle

Request

  • Base URL
    https://dev.to
  • Auth
    • API key in header api-key
    • or HTTP bearer

Query parameters

category'like' | 'unicorn' | 'exploding_head' | 'raised_hands' | 'fire' required

The type of reaction (e.g. like for standard likes, unicorn for outstanding posts, save for bookmarking to the reading list).

reactable_idinteger required

The unique numerical ID of the target resource (Article, Comment, or User) being reacted to.

reactable_type'Comment' | 'Article' | 'User' required

The class name of the target resource being reacted to (e.g. Article, Comment, User).

Response

successful

Changes

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status

    • info

      added the media type application/json for the response with the status