Spatio.Api.Workspaces (spatio_sdk v0.0.2)
API calls for all endpoints tagged Workspaces.
Summary
Functions
Accept a workspace invitation by token. The signed-in user's email must match the invitation. Organization-token accept lives at POST /v1/organizations/{org}/accept-invitation.
Add a member directly (skips invitation flow).
Create a workspace. Requires organizationId in the body — bare "personal" workspaces aren't supported on the public API.
Invite a user to a workspace.
Fetch invitation details by token (unauthenticated). Used by the renderer to show invitation context before the user signs in.
Fetch a single workspace by id.
List the caller's workspaces (across organizations).
List pending workspace invitations.
List members of a workspace.
Remove a member from the workspace.
Revoke a pending workspace invitation.
Update workspace metadata.
Functions
@spec accept_workspace_invitation(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Accept a workspace invitation by token. The signed-in user's email must match the invitation. Organization-token accept lives at POST /v1/organizations/{org}/accept-invitation.
Parameters
connection(Spatio.Connection): Connection to servertoken(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec add_workspace_member( Tesla.Env.client(), String.t(), Spatio.Model.AddWorkspaceMemberRequest.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Add a member directly (skips invitation flow).
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):add_workspace_member_request(AddWorkspaceMemberRequest):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec create_workspace( Tesla.Env.client(), Spatio.Model.CreateWorkspaceRequest.t(), keyword() ) :: {:ok, Spatio.Model.WorkspaceEnvelope.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Create a workspace. Requires organizationId in the body — bare "personal" workspaces aren't supported on the public API.
Parameters
connection(Spatio.Connection): Connection to servercreate_workspace_request(CreateWorkspaceRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceEnvelope.t}on success{:error, Tesla.Env.t}on failure
create_workspace_invitation(connection, workspace_id, create_workspace_invitation_request, opts \\ [])
@spec create_workspace_invitation( Tesla.Env.client(), String.t(), Spatio.Model.CreateWorkspaceInvitationRequest.t(), keyword() ) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.WorkspaceInvitation.t()} | {:error, Tesla.Env.t()}
Invite a user to a workspace.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):create_workspace_invitation_request(CreateWorkspaceInvitationRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceInvitation.t}on success{:error, Tesla.Env.t}on failure
@spec get_public_invitation(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.PublicInvitationPayload.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Fetch invitation details by token (unauthenticated). Used by the renderer to show invitation context before the user signs in.
Parameters
connection(Spatio.Connection): Connection to servertoken(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.PublicInvitationPayload.t}on success{:error, Tesla.Env.t}on failure
@spec get_workspace(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.WorkspaceEnvelope.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Fetch a single workspace by id.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceEnvelope.t}on success{:error, Tesla.Env.t}on failure
@spec list_my_workspaces( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.WorkspaceListResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List the caller's workspaces (across organizations).
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceListResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_workspace_invitations(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.WorkspaceInvitationListResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List pending workspace invitations.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceInvitationListResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_workspace_members(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.WorkspaceMemberListResponse.t()} | {:error, Tesla.Env.t()}
List members of a workspace.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceMemberListResponse.t}on success{:error, Tesla.Env.t}on failure
@spec remove_workspace_member(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Remove a member from the workspace.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):member_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec revoke_workspace_invitation( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Revoke a pending workspace invitation.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):invitation_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec update_workspace( Tesla.Env.client(), String.t(), Spatio.Model.UpdateWorkspaceRequest.t(), keyword() ) :: {:ok, Spatio.Model.WorkspaceEnvelope.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update workspace metadata.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):update_workspace_request(UpdateWorkspaceRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.WorkspaceEnvelope.t}on success{:error, Tesla.Env.t}on failure
update_workspace_member(connection, workspace_id, member_id, update_workspace_member_request, opts \\ [])
@spec update_workspace_member( Tesla.Env.client(), String.t(), String.t(), Spatio.Model.UpdateWorkspaceMemberRequest.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a member's role.
Parameters
connection(Spatio.Connection): Connection to serverworkspace_id(String.t):member_id(String.t):update_workspace_member_request(UpdateWorkspaceMemberRequest):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure