Skip to main content

Portal builder

The workspace's portal builder: the draft, the published versions and the theme. list returns the full state (including the revision that guards saving), draft update replaces the whole draft and publish create puts it live as a new version. The tools commands edit the draft piece by piece — a page, a block, a field — and are the same ones the builder's AI chat uses.

Draft, publishing and theme​

CommandHTTPDescription
builder listGET /v1/builderGet the portal builder
builder draft updatePUT /v1/builder/draftSave the portal draft
builder og-image createPOST /v1/builder/og_imageUpload an og:image
builder publish createPOST /v1/builder/publishPublish the portal
builder secrets createPOST /v1/builder/secretsSeal a block secret
builder theme updatePATCH /v1/builder/themeUpdate the portal theme colors

Testing the draft​

They really run the action of a draft Action button or Form, flagged as preview: true.

CommandHTTPDescription
builder action-runs createPOST /v1/builder/action_runsTest a draft action button
builder form-submissions createPOST /v1/builder/form_submissionsTest a draft form

Versions​

versions restore copies a version into the draft without touching what is live; versions rollback puts the version back live right away.

CommandHTTPDescription
builder versions getGET /v1/builder/versions/{number}Get a published version
builder versions restorePOST /v1/builder/versions/{number}/restoreRestore a version into the draft
builder versions rollbackPOST /v1/builder/versions/{number}/rollbackRoll back to a version

Tools — pages​

CommandHTTPDescription
builder tools create-page createPOST /v1/builder/tools/create_pageCreate a page
builder tools delete-page createPOST /v1/builder/tools/delete_pageDelete a page
builder tools get-page listGET /v1/builder/tools/get_pageGet a draft page
builder tools list-pages listGET /v1/builder/tools/list_pagesList the draft pages
builder tools move-page createPOST /v1/builder/tools/move_pageMove a page in the menu
builder tools update-page createPOST /v1/builder/tools/update_pageUpdate a page

Tools — blocks​

CommandHTTPDescription
builder tools describe-block-type listGET /v1/builder/tools/describe_block_typeDescribe a block type
builder tools duplicate-block createPOST /v1/builder/tools/duplicate_blockDuplicate a block
builder tools insert-block createPOST /v1/builder/tools/insert_blockInsert a block
builder tools list-actions listGET /v1/builder/tools/list_actionsList button actions
builder tools list-block-types listGET /v1/builder/tools/list_block_typesList block types
builder tools move-block createPOST /v1/builder/tools/move_blockMove a block
builder tools remove-block createPOST /v1/builder/tools/remove_blockRemove a block
builder tools update-block createPOST /v1/builder/tools/update_blockUpdate a block

Tools — theme, files and entities​

CommandHTTPDescription
builder tools get-theme listGET /v1/builder/tools/get_themeGet the theme colors
builder tools preview-portal-user-mapping listGET /v1/builder/tools/preview_portal_user_mappingPreview the portal user mapping
builder tools read-asset listGET /v1/builder/tools/read_assetRead the content of a file
builder tools register-entity createPOST /v1/builder/tools/register_entityRegister an entity from a data source
builder tools rename-entity-fields createPOST /v1/builder/tools/rename_entity_fieldsRename the fields of an entity
builder tools save-computed-field createPOST /v1/builder/tools/save_computed_fieldSave a computed field

Examples​

--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# Get the portal builder
kobana dashboards builder list --fields "draft,live_version,versions"

# List the draft pages
kobana dashboards builder tools list-pages list

# Create a page
kobana dashboards builder tools create-page create \
--json '{"name": "Faturas", "template": "list", "entity": "faturas"}'

# Insert a block
kobana dashboards builder tools insert-block create \
--json '{"page_id": "PAGE_ID", "type": "Text", "props": {"text": "Bem-vindo!"}}'

# Publish the portal
kobana dashboards builder publish create \
--json '{"revision": 12, "pages": [], "note": "Nova página de faturas"}' \
--dry-run

# Roll back to a version
kobana dashboards builder versions rollback --params '{"number": 3}' --dry-run

Next steps​