---
title: "Get a post"
method: GET
path: "/posts/{id}"
tags: ["Posts"]
---

# Get a post

`GET /posts/{id}`

## Request

- Base URL: `https://gorest.co.in/public/v3`
- URL: `https://gorest.co.in/public/v3/posts/{id}`
- Auth: one of:
  - none
  - HTTP bearer

## Query parameters

- `fields` object
  - `posts` string
- `include` string

## Headers

- `If-None-Match` string

## Response `200`

The post. With `include` the ETag is weak, as it covers the included items too.

- Post: Every field is present unless `fields[posts]` asks for fewer. `user` and `comments` are there only with `include`.
  - `body` string
  - `comments` Comment[]: The comments you can see, oldest first.
    - `body` string
    - `created_at` string, date-time
    - `id` string, uuid, required
    - `post` NullablePost: Every field is present unless `fields[posts]` asks for fewer. `user` and `comments` are there only with `include`.
      - `body` string
      - `comments` Comment[]: The comments you can see, oldest first.
      - `created_at` string, date-time
      - `id` string, uuid, required
      - `published_at` string, date-time, nullable: Set by the server when the post is first published; null for a draft.
      - `read_only` boolean: True for sample data (the seed); it cannot be changed.
      - `status` 'draft' | 'published'
      - `title` string
      - `updated_at` string, date-time
      - `user` NullableUser: Every field is present unless `fields[users]` asks for fewer.
        - `created_at` string, date-time
        - `email` string, email
        - `id` string, uuid, required
        - `name` string
        - `read_only` boolean: True for sample data (the seed); it cannot be changed.
        - `status` 'active' | 'inactive'
        - `updated_at` string, date-time
      - `user_id` string, uuid: The author; a user you can see.
    - `post_id` string, uuid
    - `read_only` boolean: True for sample data (the seed); it cannot be changed.
    - `updated_at` string, date-time
    - `user` NullableUser: Every field is present unless `fields[users]` asks for fewer.
      - `created_at` string, date-time
      - `email` string, email
      - `id` string, uuid, required
      - `name` string
      - `read_only` boolean: True for sample data (the seed); it cannot be changed.
      - `status` 'active' | 'inactive'
      - `updated_at` string, date-time
    - `user_id` string, uuid, nullable: Who wrote it; null once that user is deleted.
  - `created_at` string, date-time
  - `id` string, uuid, required
  - `published_at` string, date-time, nullable: Set by the server when the post is first published; null for a draft.
  - `read_only` boolean: True for sample data (the seed); it cannot be changed.
  - `status` 'draft' | 'published'
  - `title` string
  - `updated_at` string, date-time
  - `user` NullableUser: Every field is present unless `fields[users]` asks for fewer.
    - `created_at` string, date-time
    - `email` string, email
    - `id` string, uuid, required
    - `name` string
    - `read_only` boolean: True for sample data (the seed); it cannot be changed.
    - `status` 'active' | 'inactive'
    - `updated_at` string, date-time
  - `user_id` string, uuid: The author; a user you can see.

## Other responses

- `304`: Not changed since the ETag in `If-None-Match`; no body.
- `400`: A parameter is wrong, unknown or out of range.
- `401`: No token, or the token is wrong, expired or revoked.
- `403`: The token lacks the scope this operation needs.
- `404`: No such item, or not one this token may see.
- `429`: Over the rate limit; wait `Retry-After` seconds.
- `500`: Something failed on the server.

---

[API](https://skmtc.dev/gorest/apis/gorest-api-v3.md) - [All operations](https://skmtc.dev/gorest/apis/gorest-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/gorest/apis/gorest-api-v3/revisions/89aa429755a6?raw)
