Skip to content

Organizations (Tenants)

An organization lets several people share triggers and groups. The app calls it an organization, the API calls it a tenant (/tenants). Same thing.

  • It owns triggers and groups, next to the ones that belong to your personal account
  • Every member has a role that decides what they can do
  • It has a name, a unique slug, an optional description and an optional color
  • It has its own plan, free when created, and the trigger limit follows that plan

An organization does not share anything by itself with the outside: its triggers are private unless you make one public, as for a personal trigger (see Triggers & Events).

  1. Open Organizations in the sidebar
  2. Type the name in New organization name, then click Create
  3. You land on the organization page. Description and color are edited in Settings

The web interface sends the name only: the slug is generated from it.

name is required. slug (3 to 50 characters: lowercase letters, digits and hyphens), description and color (hex, #rrggbb) are optional. Without a slug, it is generated from the name.

Terminal window
curl -X POST https://ostrakon.example.com/api/v1/tenants \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme",
"slug": "acme",
"color": "#6366f1"
}'

The response is 201 and contains the tenant id. You become its owner.

Code Meaning
400 name missing, invalid slug or invalid color
403 You reached the number of organizations your plan allows (limit_reached)
409 This slug already exists (slug_exists)

GET /tenants lists the organizations you belong to, each with your role. GET /tenants/{id} returns one, PATCH /tenants/{id} edits name, description and color.

Capability Owner Admin Member Viewer
See the organization, its triggers and its members Yes Yes Yes Yes
Send events Yes Yes Yes No
Create, edit and delete triggers and groups Yes Yes Yes No
Edit the organization settings Yes Yes No No
Invite people, change roles, remove members Yes Yes No No
Transfer a trigger in or out Yes Yes No No
Delete the organization Yes No No No

The owner is the account that created the organization. There is exactly one: nobody can be promoted to owner, the owner's role cannot be changed, and the owner cannot be removed. No endpoint hands the ownership over to someone else.

Admins manage members and viewers only. Only the owner can promote, demote, remove or invite an admin.

Open the organization page, Members tab.

  • Everyone sees the list: member, role and join date
  • Owners and admins change a role with the selector in the row, and remove a member with the remove icon
  • You cannot change your own role or remove yourself here: use Leave organization (below)
  • Each member shows their display name when they set one (account settings, or ostra account set-name), with the full account id and a copy button underneath. Without a name, the full id is all you get
  • The API returns display_name next to the account_id, only to members of the organization, never an email. Names are not unique: two members can share one, the id is what tells them apart
Terminal window
curl https://ostrakon.example.com/api/v1/tenants/{tenantId}/members \
-H "Authorization: Bearer TOKEN"

To change a role, PATCH /tenants/{id}/members/{mid} with {"role": "viewer"} (admin, member or viewer). DELETE /tenants/{id}/members/{mid} removes a member, mid being the member id of the list, not the account_id.

A removed member loses access at once, and their open live streams of this organization are closed.

Settings tab, Your membership, Leave organization. The API equivalent is POST /tenants/{id}/leave. The owner cannot leave: they delete the organization instead.

Ostrakon does not send emails. An invitation is a link you hand to the person yourself.

  1. Invitations tab (owners and admins only)
  2. Pick the Role and the expiry (Expires in 1 day, Expires in 7 days or Expires in 30 days)
  3. Click Create invite link, then Copy link

The full link is shown once, at creation. Afterwards the list only shows a preview of the token, and the copy button stays disabled.

The link opens /#/invitations/<token> in the app. The person logs in first (registering is one step: POST /auth/register creates an account and returns the password to log in with), then checks the organization, the role and the expiry, and sees who invited them when you set a display name (inviter_display_name in the preview, nothing else about your account), then clicks Accept invitation.

  • A link works for one person only, and until it expires (7 days by default)
  • Anyone holding the link can accept it, so send it through a channel you trust
  • Revoke invitation stops an unused link. Whoever already accepted keeps their access
  • An invitation stops working if the person who created it is demoted or removed from the organization, or can no longer grant that role
  • The owner role cannot be invited, and an admin cannot invite another admin
  • Expired invitations stay in the list with the Expired status

The same flow through the API:

Terminal window
# Create the invitation (owner or admin), expires_in is in hours
curl -X POST https://ostrakon.example.com/api/v1/tenants/{tenantId}/invitations \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"role": "member", "expires_in": 168}'
# Preview it (needs a logged-in account)
curl https://ostrakon.example.com/api/v1/tenants/invitations/{token} \
-H "Authorization: Bearer TOKEN"
# Accept it
curl -X POST https://ostrakon.example.com/api/v1/tenants/invitations/{token}/accept \
-H "Authorization: Bearer TOKEN"

role defaults to member, expires_in to 168. The creation response carries the full token; GET /tenants/{id}/invitations only returns token_preview. DELETE /tenants/{id}/invitations/{iid} revokes one.

Code Meaning (preview and accept)
404 Unknown invitation
410 Invitation expired (expired) or already used (already_used)
409 You are already a member (accept only)

This is different from sharing one trigger with one person, which does not make them a member of anything (see Triggers & Events).

The workspace selector in the sidebar filters what you see: All workspaces, Personal, or one organization. On an organization page, Switch to this workspace does the same. An account that belongs to an organization starts on All workspaces.

Create triggers and groups in an organization

Section titled “Create triggers and groups in an organization”

The creation forms have a Workspace field: pick the organization. Viewers cannot create. In the API, owner is "personal" or "tenant:<id>":

Terminal window
curl -X POST https://ostrakon.example.com/api/v1/triggers \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Signups",
"owner": "tenant:{tenantId}"
}'

POST /groups takes the same owner field, and GET /triggers and GET /groups take ?owner=personal, ?owner=tenant:{tenantId} or ?owner=all. Names are unique per owner: two organizations (or an organization and your account) can each have a trigger with the same name.

In the trigger Settings, the Ownership section transfers it to an organization or to an account. Owners and admins only, with a JWT (see Triggers & Events). The trigger becomes private and leaves its group.

An organization's groups work like personal ones (see Groups). Panes stay personal to each member (see Panes).

An API key belongs to your account. For an organization it has two checks to pass: the scope of the key and your role in the organization. The scope can only narrow what your role allows, never widen it.

Scope Opens
tenant:read:* or tenant:read:<id> List and read organizations, list members, leave, list triggers and groups of the organization
tenant:write:<id> Edit the organization, create triggers and groups in it (includes read)
tenant:delete:<id> Delete the organization (includes write and read)
tenant:admin:* or tenant:admin:<id> Create organizations, manage members and invitations (includes everything above)

Notes:

  • Creating an organization needs tenant:admin:*, listing needs tenant:read:*
  • Editing or managing a trigger of an organization also needs trigger:manage and tenant:write on that organization
  • tenant:member:* scopes can be put on a key, but no route checks them
  • Transfers and the account's own sessions need a JWT, not a key (see API Keys)
Plan Organizations you can create Triggers in an organization
Free 1 5
Premium 10 100
Enterprise 50 500

The first column is your account plan and counts the organizations you own. The second column is the plan of the organization, which is free at creation. Creating a trigger past the limit answers 403.

Also worth knowing:

  • Members of an organization do not count against their personal trigger limit when they create triggers in it
  • The default invitation lifetime is 7 days
  • An account that owns an organization shared with other members cannot be deleted (409): delete or empty the organization first

Settings tab, Danger zone, Delete organization (owner only).

  • The web interface moves the organization's triggers to your personal account, private and out of any group. If one of them has the same name as a trigger you already own, the dialog lists the names: rename them and retry, nothing is changed meanwhile
  • Members, invitations and the organization's groups (with their panes) are removed
  • Through the API, DELETE /tenants/{id} without a body deletes the triggers with their events. Send {"transfer_triggers": true} to keep them. The response is 204

Warning: deleting an organization through the API without transfer_triggers erases its triggers and their events.

ostra tenants creates, updates and deletes organizations and manages their members and invitations from the terminal (see CLI (ostra)).