OptimoCMSDocs

Pages

Page CRUD operations

GET
/v1/sites/{siteId}/pages

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

limit?integer
Default25
Rangevalue <= 100
cursor?string
orderBy?string
Default"updatedAt"
Value in"updatedAt" | "createdAt" | "title"
direction?string
Default"desc"
Value in"asc" | "desc"
status?string
Value in"draft" | "published" | "archived"

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/pages"
{
  "data": [
    {
      "id": "string",
      "title": "string",
      "slug": "string",
      "status": "draft",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  },
  "pagination": {
    "total": 0,
    "limit": 0,
    "nextCursor": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
POST
/v1/sites/{siteId}/pages

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Header Parameters

Idempotency-Key*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sites/string/pages" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "slug": "string"  }'
{
  "data": {
    "id": "string",
    "title": "string",
    "slug": "string",
    "status": "draft",
    "blocks": {},
    "seo": {
      "title": "string",
      "description": "string",
      "ogImage": "string"
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/pages/{pageId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
pageId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/pages/string"
{
  "data": {
    "id": "string",
    "title": "string",
    "slug": "string",
    "status": "draft",
    "blocks": {},
    "seo": {
      "title": "string",
      "description": "string",
      "ogImage": "string"
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
DELETE
/v1/sites/{siteId}/pages/{pageId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
pageId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/v1/sites/string/pages/string"
{
  "data": {
    "id": "string",
    "status": "archived",
    "archivedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PUT
/v1/sites/{siteId}/pages/{pageId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
pageId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/sites/string/pages/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "data": {
    "id": "string",
    "title": "string",
    "slug": "string",
    "status": "draft",
    "blocks": {},
    "seo": {
      "title": "string",
      "description": "string",
      "ogImage": "string"
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PATCH
/v1/sites/{siteId}/pages/{pageId}/content

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
pageId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/sites/string/pages/string/content" \  -H "Content-Type: application/json" \  -d '{}'
{
  "data": {
    "id": "string",
    "title": "string",
    "slug": "string",
    "status": "draft",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}