POST
/
wp
/
v2
/
posts
/
{id}
curl --request POST \
  --url https://headlesswp.com/wp-json/wp/v2/posts/{id} \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data date=2023-11-07T05:31:56Z \
  --data date_gmt=2023-11-07T05:31:56Z \
  --data 'slug=<string>' \
  --data status=publish \
  --data 'password=<string>' \
  --data 'title={
  "raw": "<string>",
  "rendered": "<string>"
}' \
  --data 'content={
  "raw": "<string>",
  "rendered": "<string>",
  "block_version": 123,
  "protected": true
}' \
  --data author=123 \
  --data 'excerpt={
  "raw": "<string>",
  "rendered": "<string>",
  "protected": true
}' \
  --data featured_media=123 \
  --data comment_status=open \
  --data ping_status=open \
  --data format=standard \
  --data 'meta={
  "footnotes": ""
}' \
  --data sticky=true \
  --data 'template=<string>' \
  --data 'categories=[
  123
]' \
  --data 'tags=[
  123
]'
{
  "date": "2023-11-07T05:31:56Z",
  "date_gmt": "2023-11-07T05:31:56Z",
  "guid": {
    "raw": "<string>",
    "rendered": "<string>"
  },
  "id": 123,
  "link": "<string>",
  "modified": "2023-11-07T05:31:56Z",
  "modified_gmt": "2023-11-07T05:31:56Z",
  "slug": "<string>",
  "status": "publish",
  "type": "<string>",
  "password": "<string>",
  "permalink_template": "<string>",
  "generated_slug": "<string>",
  "class_list": [
    "<string>"
  ],
  "title": {
    "raw": "<string>",
    "rendered": "<string>"
  },
  "content": {
    "raw": "<string>",
    "rendered": "<string>",
    "block_version": 123,
    "protected": true
  },
  "author": 123,
  "excerpt": {
    "raw": "<string>",
    "rendered": "<string>",
    "protected": true
  },
  "featured_media": 123,
  "comment_status": "open",
  "ping_status": "open",
  "format": "standard",
  "meta": {
    "footnotes": ""
  },
  "sticky": true,
  "template": "<string>",
  "categories": [
    123
  ],
  "tags": [
    123
  ]
}

Path Parameters

id
any
required

Unique identifier for the post.

Body

application/x-www-form-urlencoded

Response

200 - application/json
OK

The response is of type object.