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).

Delete a task comment. Allowed for the comment author and (for native comments) for the task owner.

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.

Edit a task comment. Only the comment author can edit.

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (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 server
  • org (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

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (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 server
  • org (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 server
  • org (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 server
  • org (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 server
  • org (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

Functions

bulk_delete_tasks(connection, bulk_delete_tasks_request, opts \\ [])

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 server
  • bulk_delete_tasks_request (BulkDeleteTasksRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.BulkDeleteTasksResponse.t} on success
  • {:error, Tesla.Env.t} on failure

bulk_update_tasks(connection, bulk_update_tasks_request, opts \\ [])

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 server
  • bulk_update_tasks_request (BulkUpdateTasksRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.BulkUpdateTasksResponse.t} on success
  • {:error, Tesla.Env.t} on failure

complete_task(connection, id, opts \\ [])

@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 server
  • id (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 with provider. 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

create_task(connection, create_task_request, opts \\ [])

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 server
  • create_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 with provider. 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 with accountId.
    • :"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

create_task_comment(connection, id, task_comment_request, opts \\ [])

Create a comment.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (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 with provider. 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

delete_task(connection, id, opts \\ [])

@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 server
  • id (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 with provider. 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

delete_task_comment(connection, id, comment_id, opts \\ [])

@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 server
  • id (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 with provider. 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

get_task(connection, id, opts \\ [])

@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 server
  • id (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 with provider. 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

list_task_comments(connection, id, opts \\ [])

@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 server
  • id (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 with provider. 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

list_task_providers(connection, opts \\ [])

@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 server
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.TaskProvidersInfo.t} on success
  • {:error, Tesla.Env.t} on failure

list_tasks(connection, opts \\ [])

@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 server
  • 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 with provider. 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 with accountId.
    • :"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. Default false (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 with sourcePlatform for an exact match.
    • :limit (integer()):
    • :offset (integer()):

Returns

  • {:ok, Spatio.Model.TaskListEnvelope.t} on success
  • {:error, Tesla.Env.t} on failure

update_task(connection, id, update_task_request, opts \\ [])

Update a task (partial).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (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 with provider. 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

update_task_comment(connection, id, comment_id, task_comment_request, opts \\ [])

Edit a task comment. Only the comment author can edit.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (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 with provider. 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

workspace_complete_task(connection, org, workspace, id, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_complete_task_alias(connection, org, workspace, request_body, opts \\ [])

@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 server
  • org (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

workspace_create_task(connection, org, workspace, request_body, opts \\ [])

@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 server
  • org (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

workspace_create_task_alias(connection, org, workspace, request_body, opts \\ [])

@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 server
  • org (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

workspace_delete_task(connection, org, workspace, id, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

workspace_get_task(connection, org, workspace, id, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_task_providers(connection, org, workspace, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_tasks(connection, org, workspace, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_tasks_alias(connection, org, workspace, opts \\ [])

@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 server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_update_task(connection, org, workspace, id, request_body, opts \\ [])

@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 server
  • org (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

workspace_update_task_alias(connection, org, workspace, id, request_body, opts \\ [])

@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 server
  • org (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