Skip to content

Create your first organization and workspace

What you will end up with

An organization, a workspace inside it, an owner binding at each scope, and a CLI profile whose active scope points at both. This is the state every later day-0 step assumes.

Prerequisites

Confirm the resolved actor before continuing:

xratu auth whoami

actor_id must be something other than system. If it still reports system, your token is not being accepted, and the organization you are about to create will be created without an owner binding. Fix authentication before continuing.

Choose the two names now:

export ORG=acme
export WS=payments

Names are permanent. The tenancy API surface is create, get, and list. An organization name is unique across the whole deployment; a workspace name is unique within its organization.

1. Create the organization

xratu create organization "${ORG}" --set-active

Expected output

{
  "status_code": 200,
  "body": {
    "organization_uuid": "6f2a7c3e-1b54-4a29-9f0d-7c83b1e5a412",
    "name": "acme",
    "status": "accepted"
  }
}

--set-active writes organization_uuid and the name into the current profile, so the next command does not need to name the organization again. Without it you would pass --organization "${ORG}" to everything that follows.

Metadata may be attached to record ownership or a ticket reference on the organization itself:

xratu create organization "${ORG}" --set-active \
  --metadata-json '{"cost_center":"CC-1042","owner_team":"platform"}'

What the call wrote

Three records, in this order: the organization row, an owner binding for your actor at organization scope, and an audit record for organization.create. The binding is what gives you rights in the new organization. See The owner role.

2. Create the workspace

xratu create workspace "${WS}" --organization "${ORG}" --set-active

Step 1 already set the active scope; --organization names it explicitly.

Expected output

{
  "status_code": 200,
  "body": {
    "workspace_uuid": "b91d4f07-2c65-4e13-8a77-05ce9d2b6f38",
    "organization_uuid": "6f2a7c3e-1b54-4a29-9f0d-7c83b1e5a412",
    "name": "payments",
    "status": "accepted"
  }
}

--set-active here writes the workspace name and UUID, and re-writes the organization UUID, into the profile.

3. Verify

Three checks:

The objects exist and you can see them. Listing returns only scopes you hold a binding in, so a non-empty result proves both existence and the binding:

xratu get organizations
{
  "status_code": 200,
  "body": {
    "items": [
      {
        "organization_uuid": "6f2a7c3e-1b54-4a29-9f0d-7c83b1e5a412",
        "name": "acme",
        "metadata": {},
        "created_at": "2026-09-18 09:14:22"
      }
    ],
    "limit": 200
  }
}
xratu get workspaces

The workspace is attached to the right organization. Compare organization_uuid in the workspace record against the organization's:

xratu get workspace "${WS}"

The profile points at both. Later commands read the active scope from it:

xratu config view --show-ids
{
  "api_version": "xratu.config/v2",
  "current_profile": "default",
  "effective": {
    "endpoint": "http://127.0.0.1:18080",
    "token": "***",
    "actor_id": "user:alice@acme.example",
    "organization": "acme",
    "workspace": "payments",
    "organization_uuid": "6f2a7c3e-1b54-4a29-9f0d-7c83b1e5a412",
    "workspace_uuid": "b91d4f07-2c65-4e13-8a77-05ce9d2b6f38"
  }
}

config view resolves the stored UUIDs back to names against the live API. If organization and workspace come back empty while the UUIDs are set, the profile is pointing at a control plane that does not hold those scopes.

A single scripted gate for all of it:

xratu config view --show-ids \
  | jq -e '.effective.organization_uuid != "" and .effective.workspace_uuid != ""' \
    >/dev/null && echo "active scope set"

If it fails

Symptom Cause Fix
409 organization name already exists: acme The name is taken deployment-wide, possibly by an organization you cannot see Choose another name; the existing one keeps its name permanently
409 workspace name already exists in organization: payments The name is taken inside this organization Choose another, or use the existing workspace
403 forbidden: actor 'user:...' cannot perform 'workspace.create' on organization '...' You hold no binding in that organization You are not its owner; ask an owner to bind you. See Bind additional RBAC
organization not found by name or uuid: acme Resolution failed in the CLI before any request was sent The organization does not exist, or you cannot see it because you hold no binding
organization scope is required for workspace create No active organization and no --organization Pass --organization, or xratu config set organization acme
Created successfully but xratu get organizations is empty The request resolved to the system actor, so no owner binding was written Fix authentication, then have a system principal bind you

Creating a workspace in an organization that does not exist also returns 403 rather than 404, because the permission check runs before the existence check and an unknown organization holds no bindings for anyone. A 403 on workspace creation means either that the organization is not yours or that it does not exist.

The declarative alternative

On a first install, the organization, the workspace, and the owner binding can be provisioned from the bootstrap reconcile contract instead of by hand:

root_tenancy:
  contract_version: bootstrap.root_tenancy.xratu/v1
  create_if_missing: true
  organization:
    name: acme
  workspace:
    name: payments
  initial_owner_binding:
    actor_id: user:alice@acme.example
    organization_role: owner
    workspace_role: owner

This is submitted with the control-plane and data-plane bootstrap specs to POST /v1/system/bootstrap/specs/reconcile, and it is idempotent: existing scopes are resolved by name rather than recreated, and the response reports created: true or false for each.

Two constraints make it a first-install path only. It is refused once bootstrap specs are active:

forbidden: bootstrap specs already active; bootstrap reconcile is reserved for
first-install platform-admin activation

It also writes scopes through the store directly, so the owner binding comes from initial_owner_binding in the contract. Include it, and the resulting scopes have an owner from the first moment. The contract applies to first-install provisioning; the commands above apply in every other case.

What changed

Object State
Organization acme Created, with organization_uuid
Workspace payments Created, bound to that organization
Your actor owner at organization scope, owner at workspace scope
Audit organization.create and workspace.create recorded
Local profile organization, organization_uuid, workspace, workspace_uuid set

Next

Bind additional RBAC grants access to other actors. Bootstrap authority is the next day-0 step.