Skip to main content
The 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

Retrieve every task in the workspace.
  • HTTP endpoint: GET /api/tasks
  • Signature: suspend fun list(options: RequestOptions = RequestOptions()): List<Task>
list_tasks.kt
Returns a list of Task values.
Fetch a lightweight summary of all tasks.
  • HTTP endpoint: GET /api/tasks/list
  • Signature: suspend fun listSummaries(options: RequestOptions = RequestOptions()): List<TaskSummary>
list_summaries.kt
Each TaskSummary contains id, name, and an optional description.
Create or update a task. Pass createVersion = true to snapshot the current version before saving.
  • HTTP endpoint: POST /api/tasks (with ?version=true when createVersion is set)
  • Signature: suspend fun save(task: Task, createVersion: Boolean = false, options: RequestOptions = RequestOptions()): Task
save_task.kt
Returns the saved Task, including any server-generated id. For more about building actions, see Actions. For variable substitution, see Variables.
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
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
Remove a task by ID.
  • HTTP endpoint: DELETE /api/tasks/{id}
  • Signature: suspend fun delete(id: String, options: RequestOptions = RequestOptions()): JsonObject
delete_task.kt
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
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
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
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
Execute a task and return its result. This is the public execution endpoint, reachable at /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
The 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

The Figranium client exposes runTask as a convenience wrapper around tasks.run:
shortcut.kt

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.