Overview
Tenants represent individual organizations or companies in the multi-tenant SaaS platform. Each tenant has its own isolated database schema, subscription plan, and user assignments. The tenant architecture uses PostgreSQL schema-per-tenant isolation to ensure complete data separation between organizations.Schema Isolation
Each tenant is provisioned with:- A unique PostgreSQL schema (e.g.,
tenant_123) - Isolated tables for all operational data (invoices, products, users, etc.)
- Dedicated DTE (electronic tax document) configuration
- Plan-based resource limits (users, documents, etc.)
schema_name field determines which physical PostgreSQL schema the tenant’s data resides in, enabling complete data isolation while sharing the same database instance.
Create Tenant
Registers a new tenant organization in the SaaS platform. This endpoint provisions a new tenant with an exclusive database schema and migrates all operational tables into the tenant’s isolated environment.Headers
Bearer token for authenticated superuser
Body
Company or organization name
Chilean tax identification number (RUT)
Physical address of the organization
Commune (municipality) where the organization is located
City where the organization is located
Business line or industry description
Day of the month for billing and invoicing (1-31)
List of ACTECO economic activity codes and details. Each activity should include:
code(string): ACTECO codename(string): Activity descriptioncategory(string): Activity category (e.g., “1ra”)taxable(boolean): Whether the activity is taxable
Response
Unique tenant identifier
Tenant organization name
Chilean tax identification number
PostgreSQL schema name for this tenant (e.g., “tenant_123”)
Whether the tenant is currently active
Associated subscription plan ID
Custom user limit override (null uses plan default)
Maximum users allowed based on plan or override
Physical address
Commune/municipality
City
Business line description
Day of month for billing (1-31)
Array of economic activity objects with code, name, category, and taxable fields
ISO 8601 timestamp of tenant creation
Error Responses
400 Bad Request
Returned when tenant creation fails due to validation errors or provisioning issues.
403 Forbidden
Returned when the authenticated user is not a superuser.
List Tenants
Retrieves a list of all tenant organizations. This endpoint is restricted to superusers only.Headers
Bearer token for authenticated superuser
Response
Returns an array of tenant objects with the same structure as the Create Tenant response.Error Responses
403 Forbidden
Returned when the authenticated user is not a superuser.
Update Tenant
Updates tenant information. When DTE-related fields (name, address, commune, city, giro, economic_activities) are updated, the changes are automatically synchronized to the tenant’s local database schema, updating the issuer information.Headers
Bearer token for authenticated superuser
Path Parameters
The unique identifier of the tenant to update
Body
All fields are optional. Only include fields you want to update.Updated company name
Whether the tenant should be active
Custom user limit (overrides plan default)
Updated physical address
Updated commune/municipality
Updated city
Updated business line description
Updated billing day (1-31)
Updated list of economic activities
Response
Returns the updated tenant object with the same structure as the Create Tenant response.Error Responses
403 Forbidden
Returned when the authenticated user is not a superuser.
404 Not Found
Returned when the specified tenant does not exist.
Deactivate Tenant
Performs a soft delete on a tenant by settingis_active to false. The tenant’s data and schema are preserved but the organization is marked as inactive.
Headers
Bearer token for authenticated superuser
Path Parameters
The unique identifier of the tenant to deactivate
Response
Returns HTTP 204 No Content on success.Error Responses
403 Forbidden
Returned when the authenticated user is not a superuser.
404 Not Found
Returned when the specified tenant does not exist.