Posts

Update a post

Update an existing post content

patch/posts/{postId}

Request body

usernamestring required

Username of the post author (for validation)

contentstring required

Updated content of the post

Example request

{
  "username": "john_doe",
  "content": "Just had an amazing hiking experience with Contoso gear! Highly recommend their backpacks."
}

Response

Post updated successfully

idstring uuid required

Unique identifier for the post

usernamestring required

Username of the post author

contentstring required

Content of the post

createdAtstring date-time required

Timestamp when the post was created

updatedAtstring date-time required

Timestamp when the post was last updated

likesCountinteger required

Number of likes on the post

commentsCountinteger required

Number of comments on the post

Example response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "username": "john_doe",
  "content": "Just had an amazing hiking experience with Contoso gear!",
  "createdAt": "2025-05-30T10:30:00Z",
  "updatedAt": "2025-05-30T10:30:00Z",
  "likesCount": 15,
  "commentsCount": 3
}

Changes