Organizations inside other apps
An app can use its existing Silicon Accounts session to read its user's current organization, members, teams and roles, and perform authorized management actions. No second Organizations session or app-specific Organizations backend is needed. Accounts owns login and refresh; Organizations owns membership, permissions and app policy.
HTTP API
Call the Organizations origin with Authorization: Bearer <app-access-token>.
Replace {app} with the exact Accounts app ID, such as briefcase, write,
calc, dm or a registered third-party app ID.
| Route | Result |
|---|---|
GET /v1/integrations/{app}/me | account_uuid, direct organizations with capabilities, groups and share_targets |
GET /v1/integrations/{app}/orgs/{org} | Current role-filtered organization, visible members, teams and capabilities |
POST /v1/integrations/{app}/orgs/{org}/actions | An existing organization action with Idempotency-Key |
The token must belong to both the selected account and the app in the path.
A Write token cannot be used on the Briefcase route by changing a header, query
parameter or JSON field. The ordinary /v1/orgs and /v1/auth/* routes still
use Organizations sessions. /v1/integrations/briefcase/* remains compatible
with the Briefcase integration.
Organizations uses the official Accounts client to verify the bearer token
through live /v1/userinfo on each request, with redirects disabled and a
10-second total timeout. It checks sub == uuid and
membership_id == {app}:{uuid} in that verified response. Accounts verifies
signature, expiry, revocation, account/app status, app membership and current
work-account app policy. No app secret or extra login token is returned.
An expired/revoked session returns 401 app_session_ended; a token belonging to
another app returns 401 app_session_required. Missing credentials return
401 authentication_required. Accounts failures return 503 accounts_unavailable.
All integration responses use Cache-Control: no-store.
Membership and permissions
Membership is looked up by the exact authenticated account UUID. Linked personal or other work accounts confer no authority and are never expanded. A personal account without a direct membership gets empty lists; select the intended work account through the app's ordinary Accounts login to use it.
Removed members and accounts currently excluded from the calling app contribute
no groups or sharing targets. Direct organization reads/actions return 403
when membership or app access is missing. These checks use Organizations' own
current policy, including team/member exclusions, even while policy delivery to
Accounts is pending. Excluding Write does not exclude Briefcase or vice versa.
Group IDs are organization:{org_id} and team:{org_id}/{team_id}. Team IDs are
stable across renames. Members discover their own teams; organization admins
can discover all teams. Group membership only includes teams the account
actually belongs to. Returned capabilities are UI hints: every action checks
current authority again. Apps should refresh context after sign-in, account
switches and relevant operations; they must not treat a stored group list as
permanent authorization.
Management actions
The integration supports update, team_create, team_update, team_delete,
team_member_add, team_member_remove, team_admin_set, admin_set,
member_update, invite, invite_cancel, invite_resend, member_remove
and policy_update. Use the same action bodies documented in the ordinary API.
Owners, admins, team admins and members retain their existing permissions.
Organization creation, credential issuance/rotation/linking, ownership governance, account switching and invitation acceptance stay in Organizations and Accounts. An app session does not grant these operations through this API.
Actions reuse the existing transaction locks, domain rules, audit log, outbox and idempotency machinery. Use a unique key per logical operation and retain it for retries; keys are scoped to the account across Organizations surfaces. Membership and calling-app policy are checked before dispatch, under the organization lock for new actions, and again before returning a saved result. Saved results are filtered against current roles. Audit events record the verified calling app; clients cannot supply that field themselves.
Rust client
use silicon_organizations_client::{OrganizationsClient, DEFAULT_URL};
let client = OrganizationsClient::new(DEFAULT_URL)?.with_token(token);
let app = client.integration("write")?;
let context = app.me().await?;
let organization = app.organization("example").await?;
let result = app.action("example", &serde_json::json!({
"action": "team_create", "name": "Design"
}), "persisted-unique-operation-key").await?;
Keep refreshing the token through the original app's Accounts session. The
Organizations client does not store refresh credentials or sign into a second
app. The CLI bundles this guide at silicon-organizations docs integrations.
Verification and rollout
Deploy the Organizations API before deploying apps that call these routes.
The existing /v1/* reverse-proxy mapping covers them. Each app still needs
to call this integration and display the returned context in its own UI.
Run with a dedicated local test database:
ORGANIZATIONS_TEST_DATABASE_URL=postgres://postgres@127.0.0.1:PORT/DATABASE \
cargo test --locked --workspace
The integration tests use a local Accounts stand-in and real PostgreSQL; they do not establish production deployment or external provider login behavior.