Spatio.Api.Sheets (spatio_sdk v0.0.2)
API calls for all endpoints tagged Sheets.
Summary
Functions
Create a sheet.
Creates a new sheet under the target account. Target resolution mirrors POST /v1/notes: body accountId → ?accountId= → body provider → ?provider= → caller's single connected account (errors with ambiguous_account if more than one is connected and no selector is supplied).
Insert a row.
Inserts a row at index (zero-based) or appends to the end when index is omitted.
Delete a sheet.
Delete a row.
Fetch one sheet.
List rows in a sheet.
Single-account row list. Unlike GET /v1/sheets, row listing always targets the one account that owns the sheet, so the response is a plain { rows, total } rather than a fan-out envelope.
List sheets across connected accounts.
Fan-out list. Returns every sheet visible to the caller across every connected sheets provider, paginated by limit / offset. Pass ?accountId= or ?provider= to scope to a single source.
Update a sheet (partial).
Partial update of sheet metadata. The renderer also calls this via PUT /v1/sheets/{id} for autosave parity; both verbs invoke the same handler. Per-cell and per-row mutations live on their dedicated endpoints, not here.
Update a single cell.
Update a row (sparse).
Sparse update — keys present in cells overwrite that column; keys absent are preserved.
Functions
@spec create_sheet(Tesla.Env.client(), Spatio.Model.CreateSheetRequest.t(), keyword()) :: {:ok, Spatio.Model.Sheet.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Create a sheet.
Creates a new sheet under the target account. Target resolution mirrors POST /v1/notes: body accountId → ?accountId= → body provider → ?provider= → caller's single connected account (errors with ambiguous_account if more than one is connected and no selector is supplied).
Parameters
connection(Spatio.Connection): Connection to servercreate_sheet_request(CreateSheetRequest):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 withprovider. 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 withaccountId.:"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.Sheet.t}on success{:error, Tesla.Env.t}on failure
@spec create_sheet_row( Tesla.Env.client(), String.t(), Spatio.Model.CreateRowRequest.t(), keyword() ) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.Row.t()} | {:error, Tesla.Env.t()}
Insert a row.
Inserts a row at index (zero-based) or appends to the end when index is omitted.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet id.create_row_request(CreateRowRequest):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 withprovider. 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.Row.t}on success{:error, Tesla.Env.t}on failure
@spec delete_sheet(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Delete a sheet.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet 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 withprovider. 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
@spec delete_sheet_row(Tesla.Env.client(), String.t(), integer(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Delete a row.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet id.row_index(integer()): Zero-based row index.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 withprovider. 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
@spec get_sheet(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.Sheet.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Fetch one sheet.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet 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 withprovider. 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.Sheet.t}on success{:error, Tesla.Env.t}on failure
@spec list_sheet_rows(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.RowList.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List rows in a sheet.
Single-account row list. Unlike GET /v1/sheets, row listing always targets the one account that owns the sheet, so the response is a plain { rows, total } rather than a fan-out envelope.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet 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 withprovider. 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.:limit(integer())::offset(integer()):
Returns
{:ok, Spatio.Model.RowList.t}on success{:error, Tesla.Env.t}on failure
@spec list_sheets( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.SheetListEnvelope.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List sheets across connected accounts.
Fan-out list. Returns every sheet visible to the caller across every connected sheets provider, paginated by limit / offset. Pass ?accountId= or ?provider= to scope to a single source.
Parameters
connection(Spatio.Connection): Connection to serveropts(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 withprovider. 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 withaccountId.:"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())::offset(integer()):
Returns
{:ok, Spatio.Model.SheetListEnvelope.t}on success{:error, Tesla.Env.t}on failure
@spec update_sheet( Tesla.Env.client(), String.t(), Spatio.Model.UpdateSheetRequest.t(), keyword() ) :: {:ok, Spatio.Model.Sheet.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a sheet (partial).
Partial update of sheet metadata. The renderer also calls this via PUT /v1/sheets/{id} for autosave parity; both verbs invoke the same handler. Per-cell and per-row mutations live on their dedicated endpoints, not here.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet id.update_sheet_request(UpdateSheetRequest):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 withprovider. 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.Sheet.t}on success{:error, Tesla.Env.t}on failure
@spec update_sheet_cell( Tesla.Env.client(), String.t(), integer(), String.t(), Spatio.Model.UpdateCellRequest.t(), keyword() ) :: {:ok, Spatio.Model.Cell.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a single cell.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet id.row_index(integer()): Zero-based row index.column(String.t): Column identifier. Provider-specific — usually a letter (A,AB) for spreadsheet providers or a column key string for structured providers.update_cell_request(UpdateCellRequest):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 withprovider. 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.Cell.t}on success{:error, Tesla.Env.t}on failure
@spec update_sheet_row( Tesla.Env.client(), String.t(), integer(), Spatio.Model.UpdateRowRequest.t(), keyword() ) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.Row.t()} | {:error, Tesla.Env.t()}
Update a row (sparse).
Sparse update — keys present in cells overwrite that column; keys absent are preserved.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Sheet id.row_index(integer()): Zero-based row index.update_row_request(UpdateRowRequest):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 withprovider. 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.Row.t}on success{:error, Tesla.Env.t}on failure