Skip to content

Assign up to 15 numbers to accounts

POST
/v1/Accounts/{auth_id}/PhoneNumbers/BulkBuy
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkBuy \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "application_type": "ContactCenter", "customers": [ { "customer_id": "AC000000000000000001", "numbers": [ "+15555550100", "+15555550101" ] } ], "modified_by": "jane@example.com", "route_list": "12", "route_tag": "3" }'

Vendor accounts only. Assigns numbers from your inventory to your own account or to direct child accounts, each with the same rules as Assign (buy) a phone number; route_list, route_tag and application_type apply to every new subscription. Up to 15 numbers in total. Each number is handled on its own, so the response lists which were assigned and which failed (wrong account, duplicate in the request, not available, document not verified); the call succeeds even when every number fails.

auth_id
required
string

Your Auth ID.

Example

AC000000000000000000

Accounts and the numbers to assign to each

Media type application/json
object
application_type

Product label such as ContactCenter or FrontDesk, used when an inventory number has none.

string

Example

ContactCenter
customers
required

1 to 15 entries; at most 15 numbers in total across all entries.

Array<object>
>= 1 items <= 15 items
object
customer_id
required

Auth ID of the account to assign the numbers to: yours or a direct child’s.

string

Example

AC000000000000000001
numbers
required

1 to 15 numbers from your inventory.

Array<string>
>= 1 items <= 15 items

Example

[
"+15555550100",
"+15555550101"
]
modified_by

Optional name of the person making the change, recorded in the audit log.

string

Example

jane@example.com
route_list

ID of a SIP route list to attach to every new subscription.

string

Example

12
route_tag

ID of a SIP route tag to attach to every new subscription.

string

Example

3

Per-number results

Media type application/json
object
failed

The numbers not assigned, with reasons.

Array<object>
object
customer_id

The account it was to be assigned to.

string
phone_number

The number as sent.

string
reason

Why it was not assigned, e.g. “record not found” when it is not available in your inventory.

string
failedCount

Number of numbers that could not be assigned.

integer
message

Summary, e.g. “1 purchased successfully, 1 could not be purchased”.

string
purchased

The numbers assigned.

Array<string>
purchasedCount

Number of numbers assigned.

integer

Example

{
"failed": [
{
"customer_id": "AC000000000000000001",
"phone_number": "+15555550101",
"reason": "record not found"
}
],
"failedCount": 1,
"message": "1 purchased successfully, 1 could not be purchased",
"purchased": [
"+15555550100"
],
"purchasedCount": 1
}

Body not valid JSON, a validation rule failed, more than 15 numbers, or the gateway could not resolve your company (company id is empty)

Media type application/json
object
message

Human-readable result or error.

string
status

Success or failed.

string

Example

{
"message": "phone number not found",
"status": "failed"
}

Missing or invalid credentials (returned by the API gateway)

Media type application/json
string

Example generated

example