Favorite an article

POST /articles/{slug}/favorite

Favorite an article. Auth is required

Path parameters

  • slug string Required

    Slug of the article that you want to favorite

Responses

POST /articles/{slug}/favorite
curl \
 --request POST '/api/articles/{slug}/favorite' \
 --header "Authorization: $API_KEY"
Response examples (200)
{
  "article": {
    "slug": "how-to-train-your-dragon",
    "title": "How to train your dragon",
    "description": "Ever wonder how?",
    "body": "It takes a Jacobian",
    "tags": [
      "dragons",
      "training"
    ],
    "createdAt": "2025-05-04T09:42:00Z",
    "updatedAt": "2025-05-04T09:42:00Z",
    "favorited": false,
    "favoritesCount": 42,
    "author": {
      "bio": "I work at State Farm.",
      "image": "https://api.realworld.io/images/smiley-cyrus.jpg",
      "username": "jake",
      "following": false
    }
  }
}
Response examples (422)
{
  "errors": {
    "body": [
      "string"
    ]
  }
}