Posts

Create a new post

Changed on

Create a new post to share something with others

post/posts

Request

  • Base URL
    http://localhost:8080/api
  • URL
    http://localhost:8080/api/posts
  • Auth
    none declared

Request body

usernamestring required

Username of the post author

contentstring required

Content of the post

Example request

{
  "username": "john_doe",
  "content": "Just had an amazing hike in the mountains! #outdoorlife"
}

Response

Post created 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 hike in the mountains! #outdoorlife",
  "createdAt": "2025-06-01T10:30:00Z",
  "updatedAt": "2025-06-01T10:30:00Z",
  "likesCount": 15,
  "commentsCount": 3
}

Changes

    • breaking

      the response property's maxLength was increased from 1000 to 2000 for the response status

    • breaking

      the response's property type changed from object to array for status

    • breaking

      the response's property type changed from object to array for status

    • info

      the request property's maxLength was increased from 1000 to 2000

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the response's property type changed from integer to string, and format from no format to uuid for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      the request property's maxLength was set to 1000

    • warning

      the request property's maxLength was set to 50

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status