Spatio.Api.Organizations (spatio_sdk v0.0.2)

API calls for all endpoints tagged Organizations.

Summary

Functions

Invite a user to the organization. Pending invitations count toward seat cap. Free-tier callers at the cap receive a 402 with billing-upgrade payload; paid-tier auto-scales the Stripe quantity.

Create a workspace inside an organization. Requires the OrgActionCreateWorkspace action permission. Slug collisions auto-suffix (-2, -3, ...).

Fetch a single organization. Wire format note: response uses PascalCase keys (ID, Name, Slug, ...) — distinct from the rest of the SpatioAPI's camelCase convention. Documented as-is; a future cleanup will harmonize.

List the caller's organizations.

Read the organization audit log (admin / billing-admin only).

List org-brain concepts (curated knowledge surfaced to agents).

List custom roles defined on the organization.

List pending invitations for an organization.

List workspaces in an organization.

Revoke and reissue an invitation with a fresh token.

Upload (or replace) the organization logo. Multipart.

Functions

accept_organization_invitation(connection, org, accept_organization_invitation_request, opts \\ [])

@spec accept_organization_invitation(
  Tesla.Env.client(),
  String.t(),
  Spatio.Model.AcceptOrganizationInvitationRequest.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Accept an invitation to this organization.

Parameters

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

Returns

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

add_organization_member(connection, org, add_organization_member_request, opts \\ [])

@spec add_organization_member(
  Tesla.Env.client(),
  String.t(),
  Spatio.Model.AddOrganizationMemberRequest.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 server
  • org (String.t):
  • add_organization_member_request (AddOrganizationMemberRequest):
  • opts (keyword): Optional parameters

Returns

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

create_organization(connection, create_organization_request, opts \\ [])

@spec create_organization(
  Tesla.Env.client(),
  Spatio.Model.CreateOrganizationRequest.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create an organization.

Parameters

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

Returns

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

create_organization_concept(connection, org, request_body, opts \\ [])

@spec create_organization_concept(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create an org-brain concept (admin+ only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

create_organization_custom_role(connection, org, request_body, opts \\ [])

@spec create_organization_custom_role(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create a custom role (admin+ only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

create_organization_invitation(connection, org, create_organization_invitation_request, opts \\ [])

Invite a user to the organization. Pending invitations count toward seat cap. Free-tier callers at the cap receive a 402 with billing-upgrade payload; paid-tier auto-scales the Stripe quantity.

Parameters

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

Returns

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

create_organization_workspace(connection, org, create_workspace_request, opts \\ [])

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

Create a workspace inside an organization. Requires the OrgActionCreateWorkspace action permission. Slug collisions auto-suffix (-2, -3, ...).

Parameters

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

Returns

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

delete_organization(connection, org, opts \\ [])

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

Delete an organization.

Parameters

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

Returns

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

delete_organization_concept(connection, org, slug, opts \\ [])

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

Delete a concept (admin+ only).

Parameters

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

Returns

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

delete_organization_custom_role(connection, org, role_id, opts \\ [])

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

Delete a custom role (admin+ only).

Parameters

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

Returns

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

delete_organization_logo(connection, org, opts \\ [])

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

Delete the organization logo.

Parameters

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

Returns

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

get_organization(connection, org, opts \\ [])

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

Fetch a single organization. Wire format note: response uses PascalCase keys (ID, Name, Slug, ...) — distinct from the rest of the SpatioAPI's camelCase convention. Documented as-is; a future cleanup will harmonize.

Parameters

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

Returns

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

get_organization_concept(connection, org, slug, opts \\ [])

@spec get_organization_concept(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch a concept.

Parameters

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

Returns

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

list_my_organizations(connection, opts \\ [])

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

List the caller's organizations.

Parameters

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

Returns

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

list_organization_audit_log(connection, org, opts \\ [])

@spec list_organization_audit_log(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Read the organization audit log (admin / billing-admin only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • opts (keyword): Optional parameters
    • :limit (integer()):
    • :cursor (String.t):

Returns

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

list_organization_concepts(connection, org, opts \\ [])

@spec list_organization_concepts(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List org-brain concepts (curated knowledge surfaced to agents).

Parameters

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

Returns

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

list_organization_custom_roles(connection, org, opts \\ [])

@spec list_organization_custom_roles(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List custom roles defined on the organization.

Parameters

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

Returns

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

list_organization_invitations(connection, org, opts \\ [])

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

List pending invitations for an organization.

Parameters

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

Returns

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

list_organization_members(connection, org, opts \\ [])

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

List members of an organization.

Parameters

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

Returns

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

list_organization_workspaces(connection, org, opts \\ [])

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

List workspaces in an organization.

Parameters

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

Returns

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

remove_organization_member(connection, org, member_id, opts \\ [])

@spec remove_organization_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 organization.

Parameters

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

Returns

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

resend_organization_invitation(connection, org, invitation_id, opts \\ [])

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

Revoke and reissue an invitation with a fresh token.

Parameters

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

Returns

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

revoke_organization_invitation(connection, org, invitation_id, opts \\ [])

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

Revoke a pending invitation.

Parameters

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

Returns

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

update_organization(connection, org, update_organization_request, opts \\ [])

@spec update_organization(
  Tesla.Env.client(),
  String.t(),
  Spatio.Model.UpdateOrganizationRequest.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Update organization metadata.

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t): Organization id or slug.
  • update_organization_request (UpdateOrganizationRequest):
  • opts (keyword): Optional parameters

Returns

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

update_organization_concept(connection, org, slug, request_body, opts \\ [])

@spec update_organization_concept(
  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()}

Update a concept (admin+ only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • slug (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

update_organization_custom_role(connection, org, role_id, request_body, opts \\ [])

@spec update_organization_custom_role(
  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()}

Update a custom role (admin+ only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • role_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

update_organization_member(connection, org, member_id, update_organization_member_request, opts \\ [])

@spec update_organization_member(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  Spatio.Model.UpdateOrganizationMemberRequest.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 server
  • org (String.t):
  • member_id (String.t):
  • update_organization_member_request (UpdateOrganizationMemberRequest):
  • opts (keyword): Optional parameters

Returns

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

upload_organization_logo(connection, org, opts \\ [])

@spec upload_organization_logo(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Upload (or replace) the organization logo. Multipart.

Parameters

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

Returns

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