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).
message
string
Value is "Tenants fetched successfully.".
data
array
Array of tenant objects.
curl https://your-instance.laracopilot.com/api/tenants \
  -H "Accept: application/json" \
  -b cookies.txt

POST /api/tenants

Creates a new tenant. Returns 201 Created with the new tenant record on success.
name
string
required
Human-readable name for the tenant. Maximum 255 characters.
slug
string
required
URL-safe unique identifier. Must be unique across all tenants. Maximum 255 characters.
domain
string
required
Fully-qualified domain name for the tenant. Must be unique across all tenants. Maximum 255 characters.
status
string
required
Lifecycle status, e.g. active, suspended. Maximum 50 characters.
timezone
string
required
IANA timezone identifier, e.g. America/Chicago. Maximum 100 characters.
max_extensions
integer
required
Maximum number of extensions the tenant can provision. Minimum value: 1.
settings
object
Optional. Arbitrary JSON object for tenant-level configuration. Stored as-is.
message
string
Value is "Tenant created successfully.".
data
object
The newly created tenant record. Contains the same fields as described in the list response above, without relation counts.
curl -X POST https://your-instance.laracopilot.com/api/tenants \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "name": "Globex Telecom",
    "slug": "globex-telecom",
    "domain": "globex.laracopilot.com",
    "status": "active",
    "timezone": "America/Chicago",
    "max_extensions": 100,
    "settings": { "record_calls": false }
  }'

GET /api/tenants/

Fetches a single tenant by its ID. The response eager-loads the full extensions, dids, queues, and rates relations. Path parameters
tenant
integer
required
The numeric ID of the tenant to retrieve.
message
string
Value is "Tenant loaded successfully.".
data
object
The tenant record with extensions, dids, queues, and rates arrays included.
curl https://your-instance.laracopilot.com/api/tenants/2 \
  -H "Accept: application/json" \
  -b cookies.txt

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
tenant
integer
required
The numeric ID of the tenant to update.
name
string
required
Human-readable name. Maximum 255 characters.
slug
string
required
Must be unique across all tenants, excluding the current record. Maximum 255 characters.
domain
string
required
Must be unique across all tenants, excluding the current record. Maximum 255 characters.
status
string
required
Lifecycle status. Maximum 50 characters.
timezone
string
required
IANA timezone identifier. Maximum 100 characters.
max_extensions
integer
required
Minimum value: 1.
settings
object
Optional. Replaces the existing settings object entirely.
message
string
Value is "Tenant updated successfully.".
data
object
The updated tenant record.
curl -X PUT https://your-instance.laracopilot.com/api/tenants/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "name": "Globex Telecom",
    "slug": "globex-telecom",
    "domain": "globex.laracopilot.com",
    "status": "suspended",
    "timezone": "America/Chicago",
    "max_extensions": 100,
    "settings": { "record_calls": false }
  }'

DELETE /api/tenants/

Permanently deletes the specified tenant. This action cannot be undone. Path parameters
tenant
integer
required
The numeric ID of the tenant to delete.
message
string
Value is "Tenant deleted successfully.".
curl -X DELETE https://your-instance.laracopilot.com/api/tenants/2 \
  -H "Accept: application/json" \
  -b cookies.txt