TasksResource on the Figranium Kotlin SDK is the primary way to manage tasks. Use it to list, create, update, version, and run tasks. Every method is suspend and accepts an optional options parameter for per-request overrides such as custom headers or timeouts. The client-level convenience client.runTask(id, input, options) proxies directly to client.tasks.run(id, input, options).
TasksResource.kt
Methods
list
list
Retrieve every task in the workspace.Returns a list of
- HTTP endpoint:
GET /api/tasks - Signature:
suspend fun list(options: RequestOptions = RequestOptions()): List<Task>
list_tasks.kt
Task values.listSummaries
listSummaries
Fetch a lightweight summary of all tasks.Each
- HTTP endpoint:
GET /api/tasks/list - Signature:
suspend fun listSummaries(options: RequestOptions = RequestOptions()): List<TaskSummary>
list_summaries.kt
TaskSummary contains id, name, and an optional description.save
save
Create or update a task. Pass Returns the saved
createVersion = true to snapshot the current version before saving.- HTTP endpoint:
POST /api/tasks(with?version=truewhencreateVersionis set) - Signature:
suspend fun save(task: Task, createVersion: Boolean = false, options: RequestOptions = RequestOptions()): Task
save_task.kt
Task, including any server-generated id. For more about building actions, see Actions. For variable substitution, see Variables.touch
touch
Refresh a task’s
last_opened timestamp without changing its definition.- HTTP endpoint:
POST /api/tasks/{id}/touch - Signature:
suspend fun touch(id: String, options: RequestOptions = RequestOptions()): Task
touch_task.kt
update
update
Apply a partial patch to an existing task.
- HTTP endpoint:
PATCH /api/tasks/{id} - Signature:
suspend fun update(id: String, patch: JsonObject, options: RequestOptions = RequestOptions()): JsonObject
update_task.kt
delete
delete
Remove a task by ID.
- HTTP endpoint:
DELETE /api/tasks/{id} - Signature:
suspend fun delete(id: String, options: RequestOptions = RequestOptions()): JsonObject
delete_task.kt
versions
versions
List all saved versions for a task.
- HTTP endpoint:
GET /api/tasks/{id}/versions - Signature:
suspend fun versions(id: String, options: RequestOptions = RequestOptions()): List<TaskVersion>
list_versions.kt
version
version
Retrieve a specific version snapshot.
- HTTP endpoint:
GET /api/tasks/{id}/versions/{versionId} - Signature:
suspend fun version(id: String, versionId: String, options: RequestOptions = RequestOptions()): JsonObject
get_version.kt
clearVersions
clearVersions
Delete all stored versions for a task.
- HTTP endpoint:
POST /api/tasks/{id}/versions/clear - Signature:
suspend fun clearVersions(id: String, options: RequestOptions = RequestOptions()): JsonObject
clear_versions.kt
rollback
rollback
Restore a task to a previous version snapshot.
- HTTP endpoint:
POST /api/tasks/{id}/rollback - Signature:
suspend fun rollback(id: String, versionId: String, options: RequestOptions = RequestOptions()): Task
rollback_task.kt
run
run
Execute a task and return its result. This is the public execution endpoint, reachable at The
/tasks/{id}/api.- HTTP endpoint:
POST /tasks/{id}/api - Signature:
suspend inline fun <reified T> run(id: String, input: ExecuteTaskOptions = ExecuteTaskOptions(), options: RequestOptions = RequestOptions()): ExecutionResult<T>
run_task.kt
input object accepts variables, taskVariables, webhookUrl, and runId. For more about execution results and streaming, see ExecutionsResource. To learn about task variables and runtime substitution, see Variables and Actions. For per-request overrides, see RequestOptions.Client shortcut
TheFigranium client exposes runTask as a convenience wrapper around tasks.run:
shortcut.kt
Related resources
Actions
Build action lists with typed helpers.
Variables
Declare and reference task variables.
Executions
Inspect the runs produced by task execution.
Models
Reference for Task, Action, TaskVariable, and supporting types.
Request options
Pass custom headers and per-request timeouts.
Errors
Handle FigraniumException responses.