Spatio.Api.Tasks (spatio_sdk v0.0.2)
API calls for all endpoints tagged Tasks.
Summary
Functions
Delete multiple tasks in one call.
Replaces the legacy BFF that looped DELETE /v1/tasks/:id. Per-id errors are collected in failed rather than failing the whole call — partial success is the norm.
Apply the same update to multiple tasks.
Same updates payload applied to every id in taskIds. As with bulk delete, per-id failures collect in failed.
Mark a task complete.
Idempotent — completing an already-completed task is a no-op that still returns success. The legacy POST /v1/tasks/complete/task endpoint accepts the same operation with the task id in the JSON body instead of the URL; that variant is a renderer-compat shim and is not modeled in the spec.
Create a task.
Creates a new task under the target account. Target resolution mirrors POST /v1/notes: body accountId → ?accountId= → body provider → ?provider= → caller's single connected account (errors ambiguous_account if more than one and no selector).
Create a comment.
Delete a task.
Delete a task comment. Allowed for the comment author and (for native comments) for the task owner.
Fetch one task.
List comments on a task.
Returns active comments. When ?accountId= targets an external provider that supports comments (e.g. Linear), the provider is queried directly; otherwise the native TaskComment table is used.
List supported task providers.
Returns the registered task-provider ids and the platform's own metadata. Useful for clients that need to render provider-specific UI (icons, capability flags) before committing to a particular provider.
List tasks across connected accounts.
Fan-out list. Returns every task visible to the caller across every connected tasks provider. Pass ?accountId= or ?provider= to scope to a single source.
Update a task (partial).
Edit a task comment. Only the comment author can edit.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Renderer-compat alias for /tasks/{id}/complete.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Renderer-compat alias for POST /tasks.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Renderer-compat alias for /tasks.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Renderer-compat alias for PATCH /tasks/{id}.
Functions
@spec bulk_delete_tasks( Tesla.Env.client(), Spatio.Model.BulkDeleteTasksRequest.t(), keyword() ) :: {:ok, Spatio.Model.BulkDeleteTasksResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Delete multiple tasks in one call.
Replaces the legacy BFF that looped DELETE /v1/tasks/:id. Per-id errors are collected in failed rather than failing the whole call — partial success is the norm.
Parameters
connection(Spatio.Connection): Connection to serverbulk_delete_tasks_request(BulkDeleteTasksRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.BulkDeleteTasksResponse.t}on success{:error, Tesla.Env.t}on failure
@spec bulk_update_tasks( Tesla.Env.client(), Spatio.Model.BulkUpdateTasksRequest.t(), keyword() ) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.BulkUpdateTasksResponse.t()} | {:error, Tesla.Env.t()}
Apply the same update to multiple tasks.
Same updates payload applied to every id in taskIds. As with bulk delete, per-id failures collect in failed.
Parameters
connection(Spatio.Connection): Connection to serverbulk_update_tasks_request(BulkUpdateTasksRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.BulkUpdateTasksResponse.t}on success{:error, Tesla.Env.t}on failure
@spec complete_task(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Mark a task complete.
Idempotent — completing an already-completed task is a no-op that still returns success. The legacy POST /v1/tasks/complete/task endpoint accepts the same operation with the task id in the JSON body instead of the URL; that variant is a renderer-compat shim and is not modeled in the spec.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SuccessFlag.t}on success{:error, Tesla.Env.t}on failure
@spec create_task(Tesla.Env.client(), Spatio.Model.CreateTaskRequest.t(), keyword()) :: {:ok, Spatio.Model.Task.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Create a task.
Creates a new task under the target account. Target resolution mirrors POST /v1/notes: body accountId → ?accountId= → body provider → ?provider= → caller's single connected account (errors ambiguous_account if more than one and no selector).
Parameters
connection(Spatio.Connection): Connection to servercreate_task_request(CreateTaskRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:provider(String.t): Provider id (e.g.native-notes,notion). Selects every connected account for the provider. Mutually exclusive withaccountId.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.Task.t}on success{:error, Tesla.Env.t}on failure
@spec create_task_comment( Tesla.Env.client(), String.t(), Spatio.Model.TaskCommentRequest.t(), keyword() ) :: {:ok, Spatio.Model.TaskCommentMutationResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Create a comment.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.task_comment_request(TaskCommentRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.TaskCommentMutationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_task(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Delete a task.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SuccessFlag.t}on success{:error, Tesla.Env.t}on failure
@spec delete_task_comment(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Delete a task comment. Allowed for the comment author and (for native comments) for the task owner.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.comment_id(String.t): Comment id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SuccessFlag.t}on success{:error, Tesla.Env.t}on failure
@spec get_task(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.Task.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Fetch one task.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.Task.t}on success{:error, Tesla.Env.t}on failure
@spec list_task_comments(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.TaskCommentList.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List comments on a task.
Returns active comments. When ?accountId= targets an external provider that supports comments (e.g. Linear), the provider is queried directly; otherwise the native TaskComment table is used.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.TaskCommentList.t}on success{:error, Tesla.Env.t}on failure
@spec list_task_providers( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.TaskProvidersInfo.t()} | {:error, Tesla.Env.t()}
List supported task providers.
Returns the registered task-provider ids and the platform's own metadata. Useful for clients that need to render provider-specific UI (icons, capability flags) before committing to a particular provider.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.TaskProvidersInfo.t}on success{:error, Tesla.Env.t}on failure
@spec list_tasks( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.TaskListEnvelope.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List tasks across connected accounts.
Fan-out list. Returns every task visible to the caller across every connected tasks provider. Pass ?accountId= or ?provider= to scope to a single source.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:provider(String.t): Provider id (e.g.native-notes,notion). Selects every connected account for the provider. Mutually exclusive withaccountId.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.:completed(boolean()): Include completed tasks. Defaultfalse(active tasks only).:labels([String.t]): Repeatable. Filter to tasks carrying every label listed.:parentTaskId(String.t): Filter to subtasks of this parent.:type(String.t): Discriminator filter (todo,reminder,issue).:sourcePlatform(String.t): Filter to tasks linked to a given source platform.:sourceId(String.t): Filter to tasks linked to a specific source artifact id. Pair withsourcePlatformfor an exact match.:limit(integer())::offset(integer()):
Returns
{:ok, Spatio.Model.TaskListEnvelope.t}on success{:error, Tesla.Env.t}on failure
@spec update_task( Tesla.Env.client(), String.t(), Spatio.Model.UpdateTaskRequest.t(), keyword() ) :: {:ok, Spatio.Model.Task.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a task (partial).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.update_task_request(UpdateTaskRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.Task.t}on success{:error, Tesla.Env.t}on failure
@spec update_task_comment( Tesla.Env.client(), String.t(), String.t(), Spatio.Model.TaskCommentRequest.t(), keyword() ) :: {:ok, Spatio.Model.TaskCommentMutationResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Edit a task comment. Only the comment author can edit.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Task id.comment_id(String.t): Comment id.task_comment_request(TaskCommentRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.TaskCommentMutationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec workspace_complete_task( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_complete_task_alias( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Renderer-compat alias for /tasks/{id}/complete.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_create_task( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_create_task_alias( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Renderer-compat alias for POST /tasks.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_delete_task( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_task( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_task_providers( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_tasks(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_tasks_alias( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Renderer-compat alias for /tasks.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_update_task( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_update_task_alias( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Renderer-compat alias for PATCH /tasks/{id}.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure