Download OpenAPI specification:Download
Creates a new user account and returns JWT authentication tokens.
Returns a token pair upon successful registration:
| username required | string [ 3 .. 16 ] characters Unique username (3-16 alphanumeric characters) |
| password required | string <password> [ 8 .. 2147483647 ] characters Account password (minimum 8 characters) |
| email required | string <email> non-empty Valid email address (must be unique) |
{- "username": "johndoe",
- "password": "SecurePass123!",
- "email": "john.doe@example.com"
}Returns JWT tokens for immediate authentication
{- "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzAzMjU2MDAwLCJleHAiOjE3MDMyNTY5MDB9.signature",
- "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzAzMjU2MDAwLCJleHAiOjE3MDM4NjA4MDB9.signature"
}Generates a new access token using a valid refresh token.
Returns a new access token with updated expiration:
Use this endpoint when your access token has expired but your refresh token is still valid. This allows maintaining user session without requiring re-authentication.
| refreshToken required | string non-empty Long-lived refresh token used to obtain a new access token |
{- "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjMiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTcwMzI1NjAwMCwiZXhwIjoxNzA1ODQ4MDAwfQ.signature"
}Fresh access token with updated expiration
{- "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjMiLCJ1c2VybmFtZSI6ImpvaG5kb2UiLCJpYXQiOjE3MDMyNTYwMDAsImV4cCI6MTcwMzI1NjkwMH0.signature"
}Revokes a refresh token to invalidate all active sessions using that token.
Returns HTTP 204 No Content on successful revocation
Use this endpoint when a user explicitly logs out or when you need to invalidate a specific refresh token for security purposes (e.g., device logout).
| refreshToken required | string non-empty Refresh token to be revoked and invalidated |
{- "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Missing Refresh Token
{- "timestamp": "2026-01-16T16:16:26",
- "status": 400,
- "error": "Bad Request",
- "message": "Validation Failed",
- "path": "/auth/logout",
- "errors": [
- "Refresh token is required"
]
}Authenticates an existing user and returns JWT authentication tokens.
Returns a token pair upon successful authentication:
| usernameOrEmail required | string non-empty Username or email address |
| password required | string non-empty User password |
{- "usernameOrEmail": "string",
- "password": "string"
}Returns JWT tokens for authentication
{- "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzAzMjU2MDAwLCJleHAiOjE3MDMyNTY5MDB9.signature",
- "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huZG9lIiwiaWF0IjoxNzAzMjU2MDAwLCJleHAiOjE3MDM4NjA4MDB9.signature"
}Returns the currently authenticated user's principal information extracted from the JWT token.
Returns user principal containing:
User details extracted from JWT token
{- "id": 123,
- "username": "johndoe",
- "email": "johndoe@example.com",
}Creates a new blog post with a preview image uploaded to S3 storage.
Returns the created post details with generated slug and preview image URL upon success (201).
required | object (PostCreateRequestDTO) Request DTO for creating a new post |
| previewImage required | string <binary> |
Returns complete post details including generated slug and image URL
{- "id": 1,
- "title": "My First Blog Post",
- "description": "An introduction to my blog",
- "content": "This is the full content of my first blog post...",
- "slug": "my-first-blog-post",
- "createdAt": "2026-01-21T23:00:00"
}Deletes a specific post from the system by its unique identifier.
Returns no content (204) upon successful deletion.
| postId required | integer <int64> |
Invalid JWT Token
{- "timestamp": "2026-01-16T16:15:06",
- "status": 401,
- "error": "Unauthorized",
- "message": "Invalid or expired JWT token",
- "path": "/posts/7"
}Updates a specific post with partial field updates by its unique identifier. Accepts multipart/form-data with JSON post data and optional preview image.
post (required): JSON object with PostUpdateRequestDTOpreviewImage (optional): Multipart file (JPEG, PNG, GIF)Returns the updated post details (200) upon success.
| postId required | integer <int64> |
required | object (PostUpdateRequestDTO) Request DTO for updating a post |
| previewImage | string <binary> |
Returns updated post with all current field values and new preview image URL
{- "id": 1,
- "title": "Updated Title",
- "description": "Updated description",
- "content": "Updated content with more details",
- "slug": "updated-title",
- "updatedAt": "2026-01-17T00:45:00"
}Retrieves a specific post from the system by its unique slug identifier, including all associated comments.
Returns the post details with associated comments (200) upon success.
| slug required | string |
Post Not Found
{- "timestamp": "2026-01-16T16:16:26",
- "status": 404,
- "error": "Not Found",
- "message": "Post not found",
- "path": "/posts/my-post-slug"
}Sets or updates the authenticated user's reaction on a specific post.
Returns the created or updated reaction details (200) upon success.
| postId required | integer <int64> |
| reactionType required | string Enum: "LIKE" "DISLIKE" Type of the reaction |
{- "reactionType": "LIKE"
}Returns the reaction with all details
{- "id": 1,
- "reactionType": "LIKE",
- "userId": 7,
- "postId": 42
}Creates a new comment on a specific post by the authenticated user.
Returns the created comment details (201) upon success.
| postId required | integer <int64> |
| content required | string non-empty The content of the comment |
{- "content": "This is a comment."
}Returns the created comment with metadata
{- "id": 1,
- "content": "This is a great post! Thanks for sharing.",
- "postId": 42,
- "authorId": 7,
- "createdAt": "2026-02-10T00:30:00",
- "updatedAt": "2026-02-10T00:30:00",
- "edited": false
}Deletes a specific comment from the system by its unique identifier.
Returns no content (204) upon successful deletion.
| commentId required | integer <int64> |
Invalid JWT Token
{- "timestamp": "2026-02-10T15:07:00",
- "status": 401,
- "error": "Unauthorized",
- "message": "Invalid or expired JWT token",
- "path": "/comments/42"
}Updates a specific comment's content by its unique identifier.
Returns the updated comment details (200) upon success.
| commentId required | integer <int64> |
| content required | string non-empty The content of the comment |
{- "content": "This is a comment."
}Returns the updated comment with edited flag set to true
{- "id": 42,
- "content": "This is the updated comment content.",
- "postId": 7,
- "authorId": 3,
- "createdAt": "2026-02-10T10:00:00",
- "updatedAt": "2026-02-10T22:55:00",
- "edited": true
}Updates the authenticated user's profile information including bio, email, username, password, and profile picture.
Requires a valid JWT access token in the Authorization header.
All fields are optional. Only provide the fields you want to update. Omitted fields will retain their current values.
required | object (UpdateUserRequestDTO) |
| profilePicture | string <binary> |
Returns updated profile information
{- "username": "newusername",
- "bio": "Updated bio: Senior Software Engineer specializing in microservices",
}Retrieves complete user profile information including bio, profile picture, and all posts.
Returns user profile data including:
Use this endpoint to display a user's profile page with their posts.
| username required | string |
Returns user information and their published posts
{- "username": "johndoe",
- "bio": "Software developer passionate about clean code and best practices.",
- "posts": [
- {
- "id": 1,
- "title": "Getting Started with Spring Boot",
- "description": "A comprehensive guide to building REST APIs",
- "createdAt": "2024-12-01T10:30:00",
- "updatedAt": "2024-12-01T10:30:00"
}, - {
- "id": 2,
- "title": "Java Best Practices in 2024",
- "description": "Modern Java development techniques",
- "createdAt": "2024-12-15T14:20:00",
- "updatedAt": "2024-12-15T14:20:00"
}
]
}