Skip to main content
Rates define the per-minute charge applied to calls that match a given dialled prefix. Each rate is scoped to a single tenant and associates a destination label with a cost_per_minute and a billing_increment (the granularity in seconds at which the call is metered). The platform evaluates CDRs against the tenant’s rate table at call completion to calculate the cost value stored on the CDR. All endpoints require an active admin session. The list endpoint supports an optional search parameter that matches against prefix, destination, and status.

GET /api/rates

Returns all rates ordered by creation date descending, with the parent tenant relation included. Query parameters
Optional. Filters rates whose prefix, destination, or status contains the given string (case-insensitive).
message
string
Value is "Rates fetched successfully.".
data
array
Array of rate objects.
curl https://your-instance.laracopilot.com/api/rates \
  -H "Accept: application/json" \
  -b cookies.txt

POST /api/rates

Creates a new rate and returns 201 Created with the record.
tenant_id
integer
required
ID of the tenant to assign this rate to. Must reference an existing tenant.
prefix
string
required
The dialled-number prefix that triggers this rate, e.g. "44". Maximum 50 characters.
destination
string
required
Human-readable destination label. Maximum 255 characters.
cost_per_minute
number
required
Per-minute charge as a decimal number. Must be 0 or greater.
billing_increment
integer
required
Billing granularity in seconds. Minimum value: 1. Common values are 6, 30, or 60.
status
string
required
Lifecycle status, e.g. active or inactive. Maximum 50 characters.
message
string
Value is "Rate created successfully.".
data
object
The newly created rate record.
curl -X POST https://your-instance.laracopilot.com/api/rates \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "prefix": "44",
    "destination": "UK Landline",
    "cost_per_minute": 0.0250,
    "billing_increment": 60,
    "status": "active"
  }'

GET /api/rates/

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

PUT /api/rates/

Replaces all fields on an existing rate. PATCH /api/rates/{rate} is also accepted and uses the same handler. Path parameters
rate
integer
required
The numeric ID of the rate to update.
tenant_id
integer
required
Must reference an existing tenant.
prefix
string
required
Maximum 50 characters.
destination
string
required
Maximum 255 characters.
cost_per_minute
number
required
Must be 0 or greater.
billing_increment
integer
required
Minimum value: 1.
status
string
required
Maximum 50 characters.
message
string
Value is "Rate updated successfully.".
data
object
The updated rate record.
curl -X PUT https://your-instance.laracopilot.com/api/rates/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -b cookies.txt \
  -d '{
    "tenant_id": 1,
    "prefix": "44",
    "destination": "UK Landline",
    "cost_per_minute": 0.0300,
    "billing_increment": 30,
    "status": "active"
  }'

DELETE /api/rates/

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