Skip to main content

BLOCK API Reference

Module Information

Service Files:

Available Services: 16 Documented Services: 15


block.assembly

Assemble and return a composed block structure for the current hub. Implementation details are resolved at runtime by the platform.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (0)

Endpoint:

https://hostname/-/svc/block.assembly

block.content

Retrieve block content for a given hashtag, device, and language. Resolves the correct JSON file (published, draft, or versioned) and delivers it via an nginx internal redirect (X-Accel-Redirect). Falls back across languages and devices when the exact file is not found.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (0)

Endpoint:

https://hostname/-/svc/block.content

Parameters

ParameterTypeRequiredDefaultDescription
namestringNo-Block identifier. Resolved in order: name, then hashtag, then id.
hashtagstringNo-Block hashtag identifier. Used when name is not provided.
idstringNo-Block ID. Used as fallback when neither name nor hashtag is provided. At least one of name, hashtag, or id must be present.
statusstring (published, draft, )No""Content status filter. Use published to retrieve the online version or draft to retrieve the current draft.
serialnumberNo0History version serial number. When greater than 0, retrieves the specific versioned JSON file.

Returns

FieldTypeDescription
filebinaryBlock JSON content delivered as text/plain via nginx X-Accel-Redirect. Response includes Content-Disposition, Cache-Control, and Content-Length headers.

Possible Errors

Error CodeHTTP StatusDescription
BLOCK_NOT_FOUND404No content file found for the requested hashtag, device, and language combination

block.copy

Copy a versioned block history entry to a new page or as a new revision. Writes the copied JSON file to the filesystem under the destination locale and device path, updating all meta fields accordingly.

PropertyValue
ScopeHub (requires hub context)
PermissionAdmin (6)

Endpoint:

https://hostname/-/svc/block.copy

Parameters

ParameterTypeRequiredDefaultDescription
history_idstringYes-ID of the source history entry to copy from
localestringYes-Target locale code for the copied content (e.g. fr, en)
hashtagstringNo""Hashtag for the destination block. If empty, the source block hashtag is reused.
optionnumber (0, 1, 2)No0Copy mode: 0 = default, 1 = copy as new page, 2 = copy as new revision history

Returns

FieldTypeDescription
idstringID of the destination block
serialstringSerial number assigned to the copied version
devicestringDevice type of the copied entry
langstringLanguage of the copied entry

Possible Errors

Error CodeHTTP StatusDescription
BLOCK_NAME_EXIST409A block with the given hashtag already exists
CONFIRM_COPY_AS_NEW_PAGE409Confirmation required to copy as a new page
INTERNAL_ERROR500Copy operation failed due to an internal error

block.delete

Delete a block entry for a specific device and locale. The block must not be in published state; call unpublish first if needed. On success, removes the corresponding filesystem directory for the given device and locale.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.delete

Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Block ID to delete
localestringYes-Locale code of the block version to delete (e.g. fr, en)
devicestring (desktop, mobile)No"desktop"Device type of the block version to delete

Returns

FieldTypeDescription
idstringID of the deleted block
devicestringDevice type that was deleted
langstringLocale of the deleted block version

Possible Errors

Error CodeHTTP StatusDescription
UNPUBLISH_TO_DELETE409Block must be unpublished before it can be deleted

block.exists

Check whether a block identified by a string value exists. Uses the block_exists stored procedure and returns the result directly.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (0)

Endpoint:

https://hostname/-/svc/block.exists

Parameters

ParameterTypeRequiredDefaultDescription
valuestringNo"*"Primary lookup value. Falls back to string if not provided.
stringstringNo-String to check for existence. Defaults to value when not provided.

Returns

FieldTypeDescription
dataobjectResult from the block_exists stored procedure indicating whether the block exists

block.filter

List platform block models from the yellow-page database, paginated. Calls the yp.plf_list_models stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.filter

Parameters

ParameterTypeRequiredDefaultDescription
pagenumber (min: 1)No1Page number for pagination

Returns

FieldTypeDescription
dataarray<object>Paginated list of platform block models

block.history

Retrieve the edit history log for a block, optionally filtered by device, language, month, and year. Calls the block_history_log stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.history

Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Block ID to retrieve history for
pagenumber (min: 1)No1Page number for pagination
monthnumberNo0Month filter (1-12). When non-zero, year becomes required.
yearnumberNo0Year filter. Required when month is non-zero.
devicestring (desktop, mobile)No"desktop"Device type filter
langstringNo-Language code filter. Defaults to the hub default language.

Returns

FieldTypeDescription
dataarray<object>Paginated history log entries for the block

Possible Errors

Error CodeHTTP StatusDescription
MISSING_PARAM400year is required when month is non-zero

block.info

Get metadata information for a block identified by its hashtag. Calls the block_info stored procedure.

PropertyValue
ScopeHub (requires hub context)
PermissionRead (2)

Endpoint:

https://hostname/-/svc/block.info

Parameters

ParameterTypeRequiredDefaultDescription
hashtagstringYes-Hashtag identifier of the block to retrieve info for

Returns

FieldTypeDescription
dataobjectBlock metadata record returned by the block_info stored procedure

Possible Errors

Error CodeHTTP StatusDescription
MISSING_PARAM400hashtag is required

block.list

List blocks filtered by editor type, with pagination and sort order. Calls the block_list stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.list

Parameters

ParameterTypeRequiredDefaultDescription
editorstringNo"creator"Editor type filter (e.g. creator)
pagenumber (min: 1)No1Page number for pagination
orderstring (D, A)No"D"Sort order: D for descending, A for ascending

Returns

FieldTypeDescription
dataarray<object>Paginated list of block records

block.list_by

List blocks by locale and published state, with optional name filter, sort field, sort direction, and pagination. Calls the block_get_draft_publish stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.list_by

Parameters

ParameterTypeRequiredDefaultDescription
localestringNo-Locale code to filter blocks by (e.g. fr, en). Falls back to request language.
publishedstringYes-Publication state filter. Passed directly to the stored procedure.
namestringNo""Optional name substring filter
sort_bystringNo"date"Field to sort results by
sortstringYes-Sort direction (e.g. ASC or DESC)
pagenumber (min: 1)No1Page number for pagination

Returns

FieldTypeDescription
dataarray<object>Filtered and paginated list of block records

block.log

Retrieve the global block activity log, paginated and sorted. Calls the block_log stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.log

Parameters

ParameterTypeRequiredDefaultDescription
pagenumber (min: 1)No1Page number for pagination
orderstring (D, A)No"D"Sort order: D for descending, A for ascending

Returns

FieldTypeDescription
dataarray<object>Paginated block activity log entries

block.purge

Permanently delete a block and remove its entire filesystem directory. Calls the block_purge stored procedure, then removes the block root directory via fsx.remove.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.purge

Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Block ID or hashtag to purge

Returns

FieldTypeDescription
dataobjectResult data returned by the block_purge stored procedure after filesystem cleanup

Possible Errors

Error CodeHTTP StatusDescription
FAILED500Purge failed because the block record has no ID

block.rename

Rename a block by updating its hashtag in the database and rewriting the hashtag field in all existing JSON content files on the filesystem. Calls the block_rename_new stored procedure.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.rename

Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Block ID to rename
namestringNo-New hashtag value. Takes precedence over hashtag when provided.
hashtagstringNo-New hashtag value. Required when name is not provided.

Returns

FieldTypeDescription
dataobjectUpdated block record with the new hashtag

Possible Errors

Error CodeHTTP StatusDescription
BLOCK_NAME_EXIST409A block with the requested hashtag already exists
INVALID_DATA422Block record returned by the procedure is empty or invalid

block.search

Full-text search over blocks. Hyphens in the search string are replaced with spaces before calling the block_search stored procedure.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (0)

Endpoint:

https://hostname/-/svc/block.search

Parameters

ParameterTypeRequiredDefaultDescription
stringstringNo"*"Search string. Hyphens are replaced with spaces before the query. Defaults to wildcard.
pagenumber (min: 1)No1Page number for pagination

Returns

FieldTypeDescription
dataarray<object>Paginated search results from the block_search stored procedure

block.store

Create or update a block content version. Writes the letc JSON content object to the filesystem under the resolved device and language path, creates symlinks for current and optionally online versions, updates the full-text search index via block_index, and dispatches to block_save_int or block_update_new depending on the status flag.

PropertyValue
ScopeHub (requires hub context)
Permissiondelete

Endpoint:

https://hostname/-/svc/block.store

Parameters

ParameterTypeRequiredDefaultDescription
idstringNo"0"Block ID. When 0 or absent, a new block is created.
hashtagstringNo-Block hashtag. Takes precedence from name; required when name is not provided and id is 0.
namestringNo-Block name used as the hashtag. Takes precedence over hashtag.
letcobjectYes-Block content object to persist. Written to the filesystem as a JSON file. Meta fields (device, lang, serial, id, hashtag) are injected automatically.
devicestring (desktop, mobile)No"desktop"Target device type
langstringNo-Target language code. Defaults to the hub default language.
serialnumberNo-Version serial number. Required when id is non-zero.
statusstring (publish_with_history, publish_without_history, draft_without_history, )No-Publication status controlling which stored procedure branch is executed.
editorstringNo-Editor identifier (e.g. creator)
typestringNo-Block type identifier
versionstringNo-Schema version of the letc format. Defaults to the platform LETC version constant.
commentstringNo-Optional change comment for the version

Returns

FieldTypeDescription
idstringBlock ID
activestringSerial number of the saved version, used as the JSON filename
hashtagstringCanonical hashtag of the block

Possible Errors

Error CodeHTTP StatusDescription
BLOCK_NAME_EXIST409A block with the requested hashtag already exists

block.unpublish

Unpublish a block for a specific device and locale. Verifies the block is currently published, removes the online.json symlink, and re-links the current.json to the previous history entry via the block_unpublish stored procedure.

PropertyValue
ScopeHub (requires hub context)
PermissionAdmin (6)

Endpoint:

https://hostname/-/svc/block.unpublish

Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Block ID to unpublish
localestringYes-Locale code of the block version to unpublish (e.g. fr, en)
devicestring (desktop, mobile)No"desktop"Device type of the block version to unpublish

Returns

FieldTypeDescription
dataobjectUpdated block record returned by the block_unpublish stored procedure

Possible Errors

Error CodeHTTP StatusDescription
NOT_PUBLISHED409Block is not currently in published state and cannot be unpublished

  • ACL System - Permission model
  • Service Routing - URL patterns
  • Error Handling - Error codes