v1

latestOpenAPI 3.0.1MIT2026-07-1712915.9 KB
Comments

Create a comment

Add a comment to a post to share your thoughts

post/posts/{postId}/comments

Path parameters

postIdstring uuid required
Example:123e4567-e89b-12d3-a456-426614174000

Unique identifier of the post

Request body

usernamestring required

Username of the comment author

contentstring required

Content of the comment

Example request

{
  "username": "jane_smith",
  "content": "Great photo! Where was this taken?"
}

Response

Comment created successfully

idstring uuid required

Unique identifier for the comment

postIdstring uuid required

ID of the post this comment belongs to

usernamestring required

Username of the comment author

contentstring required

Content of the comment

createdAtstring date-time required

Timestamp when the comment was created

updatedAtstring date-time required

Timestamp when the comment was last updated

Example response

{
  "id": "987fcdeb-51a2-43d1-9f6b-123456789abc",
  "postId": "123e4567-e89b-12d3-a456-426614174000",
  "username": "jane_smith",
  "content": "Great photo! Where was this taken?",
  "createdAt": "2025-06-01T11:15:00Z",
  "updatedAt": "2025-06-01T11:15:00Z"
}