Skip to content
vocapable.Docs

Buy a number on your Twilio account; it becomes a line

POST
/v1/workspace/numbers/purchases
curl --request POST \
--url https://api.vocapable.com/v1/workspace/numbers/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "phone_e164": "example", "number_type": "local", "line_name": "example", "accept_carrier_charges": true, "quoted_monthly_price": "example" }'
Idempotency-Key
required
string
<= 255 characters

Unique key for this request, so a retry replays the original result instead of repeating the work. Stored for 24 hours; a replayed response carries Idempotent-Replay: true. A UUID is the documented shape. Required on this endpoint: a retry without one would dial a human twice or spend money twice.

Media typeapplication/json
WorkspaceNumberPurchaseCreate
object
phone_e164
required
Phone E164
string
/^\+1[2-9]\d{9}$/
number_type
required
Number Type
string
Allowed values: local toll_free
line_name
Any of:
string
>= 1 characters <= 60 characters
accept_carrier_charges
required
Accept Carrier Charges
boolean
quoted_monthly_price
Any of:
string
<= 16 characters

Successful Response

Media typeapplication/json
WorkspaceNumberPurchase
object
id
required
Id
string
phone_e164
required
Phone E164
string
number_type
required
Number Type
string
Allowed values: local toll_free
line_name
required
Any of:
string
state
required
State
string
Allowed values: started unresolved acquired refused
line_id
required
Any of:
string
messaging_enrollment
required
Messaging Enrollment
string
Allowed values: pending not_applicable enrolled failed
failure_reason
required
Any of:
string
emergency_address_required
required
Emergency Address Required
boolean
requested_by
required
Any of:
WorkspacePersonRef

A teammate named on a record: the id the server holds and the name to show.

object
user_id
required
User Id
string
name
required
Name
string
created_at
required
Created At
string format: date-time
acquired_at
required
Any of:
string format: date-time
Example
{
"number_type": "local",
"state": "started",
"messaging_enrollment": "pending"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}