Spatio.Api.Account (spatio_sdk v0.0.2)

API calls for all endpoints tagged Account.

Summary

Functions

Atomic check + increment on the agent-task counter (one slot per turn).

The caller's subscription tier and status.

Capability + quota envelope for the caller's tier.

Today's usage counters across notes, sheets, slides, files, tasks, mail, API.

Free-trial agent-task counter snapshot. Read-only; does NOT consume a slot. Use POST /v1/account/usage/consume-agent-task atomically per turn to gate a tool-using turn.

List the linked sign-in methods (password + OAuth providers).

List the OAuth clients the calling user has granted access to.

List active sessions for the caller.

Revoke a connected app and all of its active tokens.

Revoke every session except the caller's current one.

Revoke a specific session.

Functions

change_password(connection, change_password_request, opts \\ [])

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

Change or set the account password.

Parameters

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

Returns

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

consume_agent_task(connection, opts \\ [])

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

Atomic check + increment on the agent-task counter (one slot per turn).

Parameters

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

Returns

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

get_account_plan(connection, opts \\ [])

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

The caller's subscription tier and status.

Parameters

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

Returns

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

get_account_tier(connection, opts \\ [])

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

Capability + quota envelope for the caller's tier.

Parameters

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

Returns

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

get_account_usage(connection, opts \\ [])

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

Today's usage counters across notes, sheets, slides, files, tasks, mail, API.

Parameters

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

Returns

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

get_agent_task_usage(connection, opts \\ [])

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

Free-trial agent-task counter snapshot. Read-only; does NOT consume a slot. Use POST /v1/account/usage/consume-agent-task atomically per turn to gate a tool-using turn.

Parameters

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

Returns

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

get_sign_in_methods(connection, opts \\ [])

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

List the linked sign-in methods (password + OAuth providers).

Parameters

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

Returns

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

list_connected_apps(connection, opts \\ [])

@spec list_connected_apps(
  Tesla.Env.client(),
  keyword()
) :: {:ok, Spatio.Model.ConnectedAppsListResponse.t()} | {:error, Tesla.Env.t()}

List the OAuth clients the calling user has granted access to.

Parameters

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

Returns

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

list_sessions(connection, opts \\ [])

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

List active sessions for the caller.

Parameters

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

Returns

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

revoke_connected_app(connection, client_id, opts \\ [])

@spec revoke_connected_app(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Revoke a connected app and all of its active tokens.

Parameters

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

Returns

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

revoke_other_sessions(connection, opts \\ [])

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

Revoke every session except the caller's current one.

Parameters

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

Returns

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

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

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

Revoke a specific session.

Parameters

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

Returns

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