Posts

Change a post (JSON Merge Patch)

patch/posts/{id}

Request

  • Base URL
    https://gorest.co.in/public/v3
  • URL
    https://gorest.co.in/public/v3/posts/{id}
  • Auth
    HTTP bearer

Headers

If-Matchstring

The strong ETag the change is based on, from a read without include or from the last write; when the item changed since, the answer is 412. A weak ETag never matches.

Prefer'return=minimal' | 'return=representation'

return=minimal for an answer with no body, return=representation (the default) for the full item (RFC 7240).

Request body

bodystring
status'draft' | 'published'

Back to draft clears published_at.

titlestring

Not blank; spaces at the ends are dropped.

user_idstring uuid

Response

The changed post.

bodystring
created_atstring date-time
idstring uuid required
published_atstring date-time nullable

Set by the server when the post is first published; null for a draft.

read_onlyboolean

True for sample data (the seed); it cannot be changed.

status'draft' | 'published'
titlestring
updated_atstring date-time
user_idstring uuid

The author; a user you can see.

Example response

{
  "comments": [
    {
      "post": {
        "title": "Cursor paging in five minutes",
        "user": {
          "email": "aarav.sharma@example.com",
          "name": "Aarav Sharma"
        }
      },
      "user": {
        "email": "aarav.sharma@example.com",
        "name": "Aarav Sharma"
      }
    }
  ],
  "title": "Cursor paging in five minutes",
  "user": {
    "email": "aarav.sharma@example.com",
    "name": "Aarav Sharma"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.