---
title: "Like a post"
method: POST
path: "/posts/{postId}/likes"
tags: ["Likes"]
---

# Like a post

`POST /posts/{postId}/likes`

Like a post to show appreciation

## Path parameters

- `postId` string, uuid, required

## Request body

- LikeRequest
  - `username` string, required — Username of the user liking the post

## Response `201`

Post liked successfully

- LikeResponse
  - `postId` string, uuid, required — ID of the liked post
  - `username` string, required — Username who liked the post
  - `likedAt` string, date-time, required — Timestamp when the post was liked

## Other responses

- `400` — Bad request - invalid input or validation error
- `404` — Resource not found
- `500` — Internal server error

## Changes

- **2026-07-17** `41c89b420e85` — 4 breaking
  - added the new path request parameter `postId`
  - the `details` response's property type changed from `object` to `array` for status `400`
  - the `details` response's property type changed from `object` to `array` for status `404`
  - the `details` response's property type changed from `object` to `array` for status `500`
- **2025-05-30** `2775bd09f55e` — 1 breaking, 2 warning, 7 info
  - the `username` request property's minLength was increased from `0` to `1`
  - deleted the `path` request parameter `postId`
  - the `username` request property's maxLength was set to `50`
  - added the media type `application/json` for the response with the status `201`
  - …6 more
- **2025-05-30** `dbaf42ae4311` — 5 breaking, 3 warning, 1 info
  - for the `path` request parameter `postId`, the type changed from `string` to `integer`, and format from `uuid` to no format
  - removed the media type `application/json` for the response with the status `201`
  - removed the required property `error` from the response with the `400` status
  - removed the required property `error` from the response with the `404` status
  - …5 more

[Change history](https://skmtc.dev/azure/apis/simple-social-media-api/changes/posts/:postId/likes/post.md)

---

[API](https://skmtc.dev/azure/apis/simple-social-media-api.md) · [All operations](https://skmtc.dev/azure/apis/simple-social-media-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/simple-social-media-api/revisions/41c89b420e85/schema)
