Spatio.Api.Channels (spatio_sdk v0.0.2)

API calls for all endpoints tagged Channels.

Summary

Functions

Dispatch a channel action by id. Generic action-execution endpoint. params shape varies per action_id; consult GET /v1/channels/actions for the per-id contract.

Discover the action catalog for the Channels platform. Returns the action descriptors the agent layer dispatches via POST /v1/channels/execute. Same pattern as the DirectMessages action surface.

List messages in a channel. Channel ids are provider-scoped; pass ?accountId= (preferred) or ?accountIds= to disambiguate when the same id exists on multiple connected accounts (rare).

List group channels across connected chat providers. Fan-out list. The Channels surface filters to channel-type conversations only (type: channel | private); for direct messages use /v1/direct-messages.

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):
  • 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
    • :body (%{optional(String.t) => any()}):

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
    • :body (%{optional(String.t) => any()}):

Returns

  • {:ok, nil} 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):
  • 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

Functions

create_channel(connection, create_channel_request, opts \\ [])

Create a channel.

Parameters

  • connection (Spatio.Connection): Connection to server
  • create_channel_request (CreateChannelRequest):
  • opts (keyword): Optional parameters

Returns

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

execute_channel_action(connection, execute_chat_action_request, opts \\ [])

Dispatch a channel action by id. Generic action-execution endpoint. params shape varies per action_id; consult GET /v1/channels/actions for the per-id contract.

Parameters

  • connection (Spatio.Connection): Connection to server
  • execute_chat_action_request (ExecuteChatActionRequest):
  • opts (keyword): Optional parameters

Returns

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

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

@spec join_channel(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.ApiError.t()}
  | {:ok, Spatio.Model.SuccessFlag.t()}
  | {:error, Tesla.Env.t()}

Join a channel.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t): Channel id (provider-scoped).
  • opts (keyword): Optional parameters
    • :body (ChannelMembershipRequest):

Returns

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

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

@spec leave_channel(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.ApiError.t()}
  | {:ok, Spatio.Model.SuccessFlag.t()}
  | {:error, Tesla.Env.t()}

Leave a channel.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t): Channel id (provider-scoped).
  • opts (keyword): Optional parameters
    • :body (ChannelMembershipRequest):

Returns

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

list_channel_actions(connection, opts \\ [])

@spec list_channel_actions(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.ChatActionsList.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Discover the action catalog for the Channels platform. Returns the action descriptors the agent layer dispatches via POST /v1/channels/execute. Same pattern as the DirectMessages action surface.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

list_channel_messages(connection, channel, opts \\ [])

@spec list_channel_messages(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.ListMessagesResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List messages in a channel. Channel ids are provider-scoped; pass ?accountId= (preferred) or ?accountIds= to disambiguate when the same id exists on multiple connected accounts (rare).

Parameters

  • connection (Spatio.Connection): Connection to server
  • channel (String.t): Channel id.
  • opts (keyword): Optional parameters
    • :accountId (String.t):
    • :accountIds ([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal to providers — when both are set the intersection is used.
    • :providers ([String.t]): Repeatable. Restrict to these provider ids (gmail, outlook).
    • :"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.
    • :limit (integer()):
    • :cursor (String.t):
    • :oldestFirst (boolean()):

Returns

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

list_channels(connection, opts \\ [])

@spec list_channels(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.ListChannelsResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List group channels across connected chat providers. Fan-out list. The Channels surface filters to channel-type conversations only (type: channel | private); for direct messages use /v1/direct-messages.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :accountIds ([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal to providers — when both are set the intersection is used.
    • :providers ([String.t]): Repeatable. Restrict to these provider ids (gmail, outlook).
    • :"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.
    • :limit (integer()):
    • :cursor (String.t): Provider-specific pagination cursor.
    • :includeArchived (boolean()):
    • :types ([String.t]): Repeatable filter on Channel.type. Defaults applied by the platform exclude DMs; passing this overrides.

Returns

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

send_channel_message(connection, send_chat_message_request, opts \\ [])

Send a message to a channel.

Parameters

  • connection (Spatio.Connection): Connection to server
  • send_chat_message_request (SendChatMessageRequest):
  • opts (keyword): Optional parameters

Returns

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

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

@spec workspace_create_channel(
  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_execute_channel_action(connection, org, workspace, request_body, opts \\ [])

@spec workspace_execute_channel_action(
  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_join_channel(connection, org, workspace, id, opts \\ [])

@spec workspace_join_channel(
  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
    • :body (%{optional(String.t) => any()}):

Returns

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

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

@spec workspace_leave_channel(
  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
    • :body (%{optional(String.t) => any()}):

Returns

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

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

@spec workspace_list_channel_actions(
  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_channel_messages(connection, org, workspace, opts \\ [])

@spec workspace_list_channel_messages(
  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_channels(connection, org, workspace, opts \\ [])

@spec workspace_list_channels(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_send_channel_message(connection, org, workspace, request_body, opts \\ [])

@spec workspace_send_channel_message(
  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