Skip to main content
Tenants are the top-level organisational unit in LaraCopilot. Every extension, DID number, call queue, rate plan, and call detail record belongs to exactly one tenant. The tenant’s slug and domain must be globally unique across the platform. All endpoints require an active admin session — include the session cookie obtained from POST /api/admin/login with every request. The list endpoint supports an optional search query parameter that filters across name, slug, and domain. List responses include computed counts for extensions_count, dids_count, and queues_count. The show endpoint additionally eager-loads the full extensions, dids, queues, and rates relations.

GET /api/tenants

Returns all tenants ordered by creation date descending, with relation counts attached. Query parameters
Optional. Filters tenants whose name, slug, or domain contains the given string (case-insensitive).
string
Value is "Tenants fetched successfully.".
array
Array of tenant objects.

POST /api/tenants

Creates a new tenant. Returns 201 Created with the new tenant record on success.
string
required
Human-readable name for the tenant. Maximum 255 characters.
string
required
URL-safe unique identifier. Must be unique across all tenants. Maximum 255 characters.
string
required
Fully-qualified domain name for the tenant. Must be unique across all tenants. Maximum 255 characters.
string
required
Lifecycle status, e.g. active, suspended. Maximum 50 characters.
string
required
IANA timezone identifier, e.g. America/Chicago. Maximum 100 characters.
integer
required
Maximum number of extensions the tenant can provision. Minimum value: 1.
object
Optional. Arbitrary JSON object for tenant-level configuration. Stored as-is.
string
Value is "Tenant created successfully.".
object
The newly created tenant record. Contains the same fields as described in the list response above, without relation counts.

GET /api/tenants/

Fetches a single tenant by its ID. The response eager-loads the full extensions, dids, queues, and rates relations. Path parameters
integer
required
The numeric ID of the tenant to retrieve.
string
Value is "Tenant loaded successfully.".
object
The tenant record with extensions, dids, queues, and rates arrays included.

PUT /api/tenants/

Replaces all fields on an existing tenant. Accepts the same body as POST /api/tenants. PATCH /api/tenants/{tenant} is also accepted and uses the same handler. Path parameters
integer
required
The numeric ID of the tenant to update.
string
required
Human-readable name. Maximum 255 characters.
string
required
Must be unique across all tenants, excluding the current record. Maximum 255 characters.
string
required
Must be unique across all tenants, excluding the current record. Maximum 255 characters.
string
required
Lifecycle status. Maximum 50 characters.
string
required
IANA timezone identifier. Maximum 100 characters.
integer
required
Minimum value: 1.
object
Optional. Replaces the existing settings object entirely.
string
Value is "Tenant updated successfully.".
object
The updated tenant record.

DELETE /api/tenants/

Permanently deletes the specified tenant. This action cannot be undone. Path parameters
integer
required
The numeric ID of the tenant to delete.
string
Value is "Tenant deleted successfully.".