Spatio.Api.Channels (spatio_sdk v0.0.2)
API calls for all endpoints tagged Channels.
Summary
Functions
Create a channel.
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.
Join a channel.
Leave a channel.
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.
Send a message to a channel.
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
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
Parameters
connection(Spatio.Connection): Connection to serverorg(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 serverorg(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 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
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):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Functions
@spec create_channel( Tesla.Env.client(), Spatio.Model.CreateChannelRequest.t(), keyword() ) :: {:ok, Spatio.Model.CreateChannelResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Create a channel.
Parameters
connection(Spatio.Connection): Connection to servercreate_channel_request(CreateChannelRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.CreateChannelResponse.t}on success{:error, Tesla.Env.t}on failure
@spec execute_channel_action( Tesla.Env.client(), Spatio.Model.ExecuteChatActionRequest.t(), keyword() ) :: {:ok, Spatio.Model.ExecuteChatActionResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
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 serverexecute_chat_action_request(ExecuteChatActionRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.ExecuteChatActionResponse.t}on success{:error, Tesla.Env.t}on failure
@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 serverid(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
@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 serverid(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
@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 serveropts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.ChatActionsList.t}on success{:error, Tesla.Env.t}on failure
@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 serverchannel(String.t): Channel id.opts(keyword): Optional parameters:accountId(String.t)::accountIds([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal toproviders— 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
@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 serveropts(keyword): Optional parameters:accountIds([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal toproviders— 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 onChannel.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
@spec send_channel_message( Tesla.Env.client(), Spatio.Model.SendChatMessageRequest.t(), keyword() ) :: {:ok, Spatio.Model.SendChatMessageResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Send a message to a channel.
Parameters
connection(Spatio.Connection): Connection to serversend_chat_message_request(SendChatMessageRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.SendChatMessageResponse.t}on success{:error, Tesla.Env.t}on failure
@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 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_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 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_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 serverorg(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
@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 serverorg(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
@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 serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@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 serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@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 serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@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 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