Create a new page
Contents
Create a new page.
All requests to the API need the API Token. You can find the token in the API plugin settings.
Admin panel > Plugins > API > API TokenFor all requests to the API for write content, you'll need to provide the Authentication Token. To get this token, you need a user with Administrator role. Get the Authentication Token from the user profile.
Admin panel > Manage > Users > {Username} > Security > Authentication TokenHTTP Request
POST /api/pages/{key}Parameters
| key | value | Default value | 
|---|---|---|
| requiredtoken | stringAPI Token. | |
| requiredauthentication | stringAuthentication token. | |
| title | stringPage title. | |
| content | stringPage content. | |
| tags | stringPage tags, separated by comma. | |
| type | stringPage type. | |
| date | stringPage date (formatted as "YYYY-MM-DD Hours:Minutes:Seconds"). | |
| slug | stringPage URL slug. | (Derived from lowercased title) | 
| dateModified | stringPage modified date. | |
| position | stringPage position. | |
| coverImage | stringPage cover image. | |
| category | stringPage category. | |
| template | stringPage template. | |
| noindex | stringPage noindex. | |
| nofollow | stringPage nofollow. | |
| noarchive | stringPage noarchive. | 
Response
HTTP Code: 200
Content-Type: application/json
Body:
{
    "status": "0",
    "message": "Page created.",
    "data": {
        "key": "<page key>"
    }
}CURL command example
Here is an example that shows you how to create a new page via the command line with the curl command. The data.json file has the basic data needed to create a new page.
Content of file data.json:
{
    "token": "24a8857ed78a8c89a91c99afd503afa7",
    "authentication": "193569a9d341624e967486efb3d36d75",
    "title": "My dog",
    "content": "Content of the page here, support Markdown code and HTML code."
}Execute the command and attach the data.json file:
$ curl  -X POST \
    -H "Content-Type: application/json" \
    -d @data.json \
    "https://www.example.com/api/pages"Response Body
{
    "status": "0",
    "message": "Page created.",
    "data": {
        "key": "my-dog"
    }
}