Buy a number on your Twilio account; it becomes a line
POST
/v1/workspace/numbers/purchases
const url = 'https://api.vocapable.com/v1/workspace/numbers/purchases';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"phone_e164":"example","number_type":"local","line_name":"example","accept_carrier_charges":true,"quoted_monthly_price":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Idempotency-Key
required
string
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.
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
WorkspaceNumberPurchase
object
id
required
Id
string
phone_e164
required
Phone E164
string
number_type
required
Number Type
string
state
required
State
string
messaging_enrollment
required
Messaging Enrollment
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
null
created_at
required
Created At
string format: date-time
Example
{ "number_type": "local", "state": "started", "messaging_enrollment": "pending"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
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": {} } ]}