OptimoCMSDocs

Custom Blocks

Reusable content blocks

GET
/v1/sites/{siteId}/blocks/custom

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/blocks/custom"
{
  "data": [
    {
      "id": "string",
      "label": "string",
      "description": "string",
      "createdBy": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "usageCount": 0
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  },
  "pagination": {
    "total": 0,
    "limit": 0,
    "nextCursor": "string"
  }
}
POST
/v1/sites/{siteId}/blocks/custom

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

curl -X POST "https://example.com/v1/sites/string/blocks/custom" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "template": {},    "label": "string"  }'
{
  "data": {
    "id": "string",
    "label": "string",
    "description": "string"
  },
  "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"
  }
}