API reference
Carrier rates
Define the per-unit prices your carrier charges for each event type (voice per minute, SMS per message, etc.).
Rate resource
Ratejson
{
"data": {
"id": "RATE…",
"type": "rate",
"attributes": {
"event_type": "voice_call_minute",
"rate_cents": "12.50",
"unit": "minute",
"currency": "NGN"
}
}
}Event types
| event_type | Unit | Description |
|---|---|---|
voice_call_minute | minute | Per-minute voice rate. |
sms_message | message | Per-message SMS rate. |
tts_char | char | Per-character text-to-speech rate. |
recording_minute | minute | Per-minute recording rate. |
Create a rate
POST/carrier/v1/rates
| Parameter | Type | Description |
|---|---|---|
data.type required | string | rate |
data.attributes.event_type required | string | The event type being priced. |
data.attributes.rate_cents required | decimal | Price in minor units (e.g. kobo/cents). |
data.attributes.unit required | string | Billing unit (minute, message, char). |
data.attributes.currency required | string | ISO currency code (e.g. NGN). |
List rates
GET/carrier/v1/rates
Return all rates, optionally scoped to an account.
| Parameter | Type | Description |
|---|---|---|
account_id optional | string | Restrict to one account's rates. |
Fetch a rate
GET/carrier/v1/rates/{id}
Return a single rate.
Update a rate
PATCH/carrier/v1/rates/{id}
Change the rate or unit for an event type.
Delete a rate
DELETE/carrier/v1/rates/{id}
Remove the rate. Future usage of the event type will fall back to the carrier default.
Rates can also be scoped per account via /carrier/v1/accounts/{id}/rates.