Skip to main content
GET
/
api
/
recipes
/
{id}
/
comments
Recipe Comments
curl --request GET \
  --url https://api.example.com/api/recipes/{id}/comments

List Comments

GET /api/recipes//comments No authentication required.

Response

{
  "comments": [
    {
      "id": "uuid",
      "content": "This recipe is perfect for golden hour",
      "createdAt": "2025-01-15T10:30:00Z",
      "author": {
        "id": "uuid",
        "username": "fujifilmfan",
        "avatarUrl": "https://..."
      }
    }
  ],
  "total": 7
}

Create Comment

POST /api/recipes//comments Requires authentication.

Request Body

{
  "content": "Tried this on my X-T5, amazing results! @creator"
}

Mention Handling

Same as post comments — @username mentions are parsed, stored in recipe_comment_mentions, and trigger notifications via database triggers.

Response (201)

{
  "message": "Comment added successfully",
  "comment": {
    "id": "uuid",
    "content": "Tried this on my X-T5, amazing results! @creator",
    "createdAt": "2025-01-15T10:30:00Z",
    "author": {
      "id": "uuid",
      "username": "currentuser",
      "avatarUrl": "https://..."
    }
  }
}

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid comment content
401UNAUTHORIZEDNot authenticated
404NOT_FOUNDRecipe not found or deleted