Skip to main content
Extensions represent individual SIP user accounts within a tenant. Each extension has a unique extension_number scoped to its tenant, a SIP secret used for device registration, and an optional voicemail mailbox. All endpoints require an active admin session. The list endpoint accepts an optional search parameter that matches against extension_number, display_name, and email. List responses include the associated tenant and registered devices objects. The show endpoint additionally loads queueAgents and cdrs relations.

GET /api/extensions

Returns all extensions ordered by creation date descending. Query parameters
Optional. Filters extensions whose extension_number, display_name, or email contains the given string (case-insensitive).
message
string
Value is "Extensions fetched successfully.".
data
array
Array of extension objects.
curl https://your-instance.laracopilot.com/api/extensions \
  -H "Accept: application/json" \
  -b cookies.txt

POST /api/extensions

Creates a new extension and returns 201 Created with the record.
tenant_id
integer
required
ID of the tenant to assign this extension to. Must reference an existing tenant.
extension_number
string
required
The dialable extension number, e.g. "1001". Maximum 20 characters.
display_name
string
required
Human-readable label for the extension. Maximum 255 characters.
email
string
Optional. Valid email address for voicemail-to-email. Maximum 255 characters.
secret
string
required
SIP registration password used by devices to authenticate. Maximum 255 characters.
status
string
required
Lifecycle status, e.g. active or disabled. Maximum 50 characters.
voicemail_enabled
boolean
Optional. Whether voicemail is enabled. Coerced to a boolean; defaults to false when omitted.
message
string
Value is "Extension created successfully.".
data
object
The newly created extension record.
curl -X POST https://your-instance.laracopilot.com/api/extensions \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "extension_number": "1002",
    "display_name": "Bob Jones",
    "email": "bob@acme.com",
    "secret": "p@ssw0rd99",
    "status": "active",
    "voicemail_enabled": true
  }'

GET /api/extensions/

Fetches a single extension by its ID. The response includes the tenant, devices, queueAgents, and cdrs relations. Path parameters
extension
integer
required
The numeric ID of the extension to retrieve.
message
string
Value is "Extension loaded successfully.".
data
object
The extension record with tenant, devices, queueAgents, and cdrs arrays included.
curl https://your-instance.laracopilot.com/api/extensions/2 \
  -H "Accept: application/json" \
  -b cookies.txt

PUT /api/extensions/

Replaces all fields on an existing extension. PATCH /api/extensions/{extension} is also accepted and uses the same handler. Path parameters
extension
integer
required
The numeric ID of the extension to update.
tenant_id
integer
required
Must reference an existing tenant.
extension_number
string
required
Maximum 20 characters.
display_name
string
required
Maximum 255 characters.
email
string
Optional. Valid email address. Maximum 255 characters.
secret
string
required
Maximum 255 characters.
status
string
required
Maximum 50 characters.
voicemail_enabled
boolean
Optional. Coerced to boolean.
message
string
Value is "Extension updated successfully.".
data
object
The updated extension record.
curl -X PUT https://your-instance.laracopilot.com/api/extensions/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "extension_number": "1002",
    "display_name": "Bob Jones",
    "email": "bob@acme.com",
    "secret": "newP@ss999",
    "status": "disabled",
    "voicemail_enabled": false
  }'

DELETE /api/extensions/

Permanently deletes the specified extension. Path parameters
extension
integer
required
The numeric ID of the extension to delete.
message
string
Value is "Extension deleted successfully.".
curl -X DELETE https://your-instance.laracopilot.com/api/extensions/2 \
  -H "Accept: application/json" \
  -b cookies.txt