Skip to main content

ActionBlocks API

Action Blocks API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
getDetailRetrieves detailed information for a specific action block.
getExecutionsRetrieves execution records for action blocks.
getStatsRetrieves aggregate statistics about action blocks.
getTypesRetrieves the list of available action block types.
listRetrieves all registered action blocks.
refreshRefreshes the action block registry.
stopStops a currently running action block execution.

Methods


getDetail

client.actionBlocks.getDetail(identifier: string): Promise<ActionBlockDetail>

Retrieves detailed information for a specific action block.

Returns the full configuration, metadata, and current state of the action block identified by the given identifier string.

ParameterTypeRequiredDescription
identifierstringYesThe unique identifier or name of the action block

Returns: Promise<ActionBlockDetail> — A promise that resolves to the detailed ActionBlockDetail object

Full reference →


getExecutions

client.actionBlocks.getExecutions(params?: Record<string, unknown>): Promise<ActionBlockExecution[]>

Retrieves execution records for action blocks.

Returns a list of past and current executions, useful for monitoring which action blocks have run and their outcomes.

ParameterTypeRequiredDescription
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns: Promise<ActionBlockExecution[]> — A promise that resolves to an array of ActionBlockExecution records

Full reference →


getStats

client.actionBlocks.getStats(): Promise<ActionBlockStats>

Retrieves aggregate statistics about action blocks.

Returns counts, success rates, and other summary metrics for all action blocks in the system.

No parameters.

Returns: Promise<ActionBlockStats> — A promise that resolves to an ActionBlockStats object with summary metrics

Full reference →


getTypes

client.actionBlocks.getTypes(): Promise<string[]>

Retrieves the list of available action block types.

Returns the distinct type identifiers that can be used when creating or filtering action blocks.

No parameters.

Returns: Promise<string[]> — A promise that resolves to an array of type name strings

Full reference →


list

client.actionBlocks.list(params?: Record<string, unknown>): Promise<ActionBlock[]>

Retrieves all registered action blocks.

Returns the full list of action blocks available in the current workspace. Use optional query parameters to paginate or filter the results.

ParameterTypeRequiredDescription
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns: Promise<ActionBlock[]> — A promise that resolves to an array of ActionBlock objects

Full reference →


refresh

client.actionBlocks.refresh(data?: Record<string, unknown>): Promise<unknown>

Refreshes the action block registry.

Forces a re-scan and reload of all registered action blocks, picking up any newly added or modified block definitions.

ParameterTypeRequiredDescription
dataRecord<string, unknown>NoOptional configuration for the refresh operation

Returns: Promise<unknown> — A promise that resolves when the refresh is complete

Full reference →


stop

client.actionBlocks.stop(data: StopActionBlockRequest): Promise<unknown>

Stops a currently running action block execution.

Sends a stop signal to the specified action block execution, causing it to terminate gracefully. Use this to cancel long-running or stuck executions.

ParameterTypeRequiredDescription
dataStopActionBlockRequestYesThe stop request containing the execution identifier to halt

Returns: Promise<unknown> — A promise that resolves when the stop signal has been sent

Full reference →