Skip to main content
DID numbers (Direct Inward Dialing) are publicly routable phone numbers assigned to a tenant. Each DID tracks the originating carrier or provider, an optional human-readable description, and a status indicating whether it is active and accepting inbound calls. All endpoints require an active admin session. The list endpoint supports an optional search parameter that filters across number, provider, and description. List and show responses include the parent tenant object and any configured routes.

GET /api/dids

Returns all DID numbers ordered by creation date descending, with tenant and routes relations included. Query parameters
Optional. Filters DIDs whose number, provider, or description contains the given string (case-insensitive).
message
string
Value is "DIDs fetched successfully.".
data
array
Array of DID objects.
curl https://your-instance.laracopilot.com/api/dids \
  -H "Accept: application/json" \
  -b cookies.txt

POST /api/dids

Creates a new DID number and returns 201 Created with the record.
tenant_id
integer
required
ID of the tenant to assign this DID to. Must reference an existing tenant.
number
string
required
The phone number string, e.g. "+12125551234". Maximum 50 characters.
provider
string
required
The carrier or SIP trunk name, e.g. "Twilio" or "Bandwidth". Maximum 255 characters.
description
string
Optional. Free-text description of the DID’s purpose. No length limit enforced at the API layer.
status
string
required
Lifecycle status, e.g. active or inactive. Maximum 50 characters.
message
string
Value is "DID created successfully.".
data
object
The newly created DID record.
curl -X POST https://your-instance.laracopilot.com/api/dids \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "number": "+13125559876",
    "provider": "Bandwidth",
    "description": "Chicago sales line",
    "status": "active"
  }'

GET /api/dids/

Fetches a single DID by its ID. Includes the parent tenant and any configured routes. Path parameters
did
integer
required
The numeric ID of the DID to retrieve.
message
string
Value is "DID loaded successfully.".
data
object
The DID record with tenant and routes relations included.
curl https://your-instance.laracopilot.com/api/dids/2 \
  -H "Accept: application/json" \
  -b cookies.txt

PUT /api/dids/

Replaces all fields on an existing DID. PATCH /api/dids/{did} is also accepted and uses the same handler. Path parameters
did
integer
required
The numeric ID of the DID to update.
tenant_id
integer
required
Must reference an existing tenant.
number
string
required
Maximum 50 characters.
provider
string
required
Maximum 255 characters.
description
string
Optional. Free-text description.
status
string
required
Maximum 50 characters.
message
string
Value is "DID updated successfully.".
data
object
The updated DID record.
curl -X PUT https://your-instance.laracopilot.com/api/dids/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "number": "+13125559876",
    "provider": "Bandwidth",
    "description": "Chicago sales line — decommissioned",
    "status": "inactive"
  }'

DELETE /api/dids/

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