Skip to content

Upload your outbound voice rates

POST
/v1/Accounts/{auth_id}/Rates/Upload
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/Rates/Upload \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file

Uploads a CSV of outbound voice rates that become your account’s own rate plan, used to rate your outbound calls ahead of your vendor’s default plan. The upload replaces all your previous own rates; destinations whose prefix is not in the file then have no rate, so the file should cover every destination you call. The CSV needs a header row with at least prefix (digits, + allowed), country_iso (two letters) and rate (US dollars per minute, 0 or more); country, country_code, initial_pulse and sub_pulse (seconds, 1 to 3600, default 60) are optional. Aliases dial_prefix, iso, cc, rate_per_minute, usd_per_minute and *_in_seconds are accepted. Up to 50,000 rows; a duplicate prefix or bad value rejects the whole file with the line number.

auth_id
required
string

Your account Auth ID (20 characters). The request always acts on the authenticated account.

Media type multipart/form-data
object
file
required

CSV file of rates

string format: binary

OK

Media type application/json
object
plan_id

ID of the account’s own rate plan.

integer
rates

How many rates the file held; they replace all the account’s previous own rates.

integer
status

Always “success”.

string

Example

{
"plan_id": 117,
"rates": 245,
"status": "success"
}

No file field, unreadable file, or a CSV error such as ‘line 12: prefix 44x is not digits’

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}

Missing or wrong Auth ID / Auth Secret (answered by the API gateway)

Media type application/json
string

Example generated

example

Signed in as a sub-user (portal login) rather than the account owner: only the owner can change rates

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}

The rates could not be saved

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}

The account’s vendor could not be looked up

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}