⚠️ Porta is in beta — APIs and features may change before v1.0
Skip to content

CLI: Organizations

Manage tenant organizations via the porta org command.

Mode: HTTP (requires porta login)

porta org create

bash
porta org create --name "Acme Corp" [--locale en] [--login-methods password,magic_link]
FlagRequiredDescription
--nameOrganization name
--localeDefault locale (e.g., en)
--login-methodsComma-separated login methods

porta org list

bash
porta org list [--status active] [--search "acme"] [--page 1] [--page-size 20]
FlagDescription
--statusFilter by status
--searchSearch by name or slug
--pagePage number
--page-sizeItems per page

porta org show

bash
porta org show --id <org-id>

porta org update

bash
porta org update --id <org-id> [--name "New Name"] [--locale en] [--default-login-methods password,magic_link]

porta org suspend

bash
porta org suspend --id <org-id>

Suspends the organization. All authentication requests will be rejected until reactivated.

porta org activate

bash
porta org activate --id <org-id>

Reactivates a suspended organization.

porta org archive

bash
porta org archive --id <org-id>

DANGER

Archiving is permanent and cannot be undone. The CLI will prompt for confirmation unless --force is used.

porta org branding

bash
# View branding
porta org branding --id <org-id>

# Update branding
porta org branding --id <org-id> \
  --logo-url "https://example.com/logo.png" \
  --primary-color "#0078d4" \
  --company-name "Acme Corp"
FlagDescription
--logo-urlLogo URL
--favicon-urlFavicon URL
--primary-colorPrimary accent color (hex)
--company-nameDisplay name on login pages
--custom-cssCustom CSS for login pages

porta org destroy

Permanently destroy an organization and all its child entities (applications, clients, users, roles, permissions, claim definitions). Uses PostgreSQL CASCADE deletion. The super-admin organization is protected and cannot be destroyed.

bash
# Preview what will be destroyed (no changes)
porta org destroy <id-or-slug> --dry-run

# Destroy with type-to-confirm safety prompt
porta org destroy acme-corp

# Skip confirmation (for scripting)
porta org destroy acme-corp --force
FlagDescription
--dry-runPreview cascade counts without deleting
--forceSkip the type-to-confirm safety prompt

Cascade Preview

The command always shows what will be destroyed before prompting:

⚠️  This will PERMANENTLY destroy the following:

  Organization:      Acme Corp (acme-corp)
  Applications:      3
  Clients:           5
  Users:             42
  Roles:             8
  Permissions:       16
  Claim Definitions: 4

Type the organization slug "acme-corp" to confirm destruction:

Safety

  • The super-admin organization cannot be destroyed (enforced at both SQL and application level)
  • An audit log entry is written before deletion (the organization ID is preserved in the audit trail)
  • The --force flag skips the interactive prompt but still requires admin authentication and the ORG_ARCHIVE permission

Released under the MIT License.