Skip to content
Get Started

Line Provisioning

Add and remove inbound_only / Agent plan phone lines via API

Credential-based line management is available for eligible inbound_only / Agent plan accounts. Provisioning adds paid inbound-only phone lines. Accounts with automatic line provisioning enabled use shared quantity billing and also support API deprovisioning. Legacy accounts may still provision lines through the same preview/confirm flow, but do not support API deprovisioning.

Deprecated: The previous ticket-based POST /accounts/lines/add-line and GET /accounts/lines/line-request/:lineRequestTicketId flows have been deprecated for direct line purchases. Use the preview and confirm endpoints below for API line provisioning.

Line provisioning and deprovisioning use a two-step flow. Preview validates eligibility and issues a short-lived token. Confirm consumes that token and performs the line operation.

Preview tokens are valid for 10 minutes and can be used once.

Provisioning charges the card on file and assigns an inbound-only phone number to the account. Automatic line provisioning accounts use shared quantity billing and invoice the prorated cost immediately. Legacy accounts create a per-line subscription and return a top-level subscription_id instead of a billing object.

Validate that the account is eligible and that a line is currently available.

POST /accounts/lines/provision-preview
Terminal window
curl -X POST "https://api.sendblue.com/accounts/lines/provision-preview" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET"

Success Response (200, Automatic Line Provisioning)

Section titled “Success Response (200, Automatic Line Provisioning)”
{
"status": "OK",
"preview_token": "lpv_abc123...",
"expires_at": "2026-05-18T14:30:00.000Z",
"billing": {
"model": "quantity",
"current_line_count": 41,
"new_quantity": 42,
"line_minimum": 1
},
"message": "Call /accounts/lines/provision-confirm with this token within 10 minutes to complete the purchase. The added line is prorated and invoiced immediately."
}
FieldTypeDescription
statusstringOK
preview_tokenstringSingle-use token for the confirm step
expires_atstringISO 8601 expiration timestamp
billing.modelstringBilling model for the account
billing.current_line_countnumberCurrent paid line quantity
billing.new_quantitynumberPaid line quantity after confirm succeeds
billing.line_minimumnumberMinimum paid line quantity for the account
messagestringHuman-readable next step

Success Response (200, Legacy Provisioning)

Section titled “Success Response (200, Legacy Provisioning)”
{
"status": "OK",
"preview_token": "lpv_abc123...",
"expires_at": "2026-05-18T14:30:00.000Z",
"message": "Call /accounts/lines/provision-confirm with this token within 10 minutes to complete the purchase."
}

Consume the preview_token, charge the card on file, and provision the line.

POST /accounts/lines/provision-confirm
ParameterTypeRequiredDescription
preview_tokenstringYesToken returned by POST /accounts/lines/provision-preview
Terminal window
curl -X POST "https://api.sendblue.com/accounts/lines/provision-confirm" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"preview_token": "lpv_abc123..."
}'

Success Response (200, Automatic Line Provisioning)

Section titled “Success Response (200, Automatic Line Provisioning)”
{
"status": "OK",
"phone_number": "+14155551234",
"worker_id": "worker_abc123",
"billing": {
"model": "quantity",
"subscription_id": "sub_abc123",
"subscription_item_id": "si_abc123",
"quantity": 42
}
}
FieldTypeDescription
statusstringOK
phone_numberstringThe newly provisioned Sendblue phone number
worker_idstringInternal worker ID for the new line
billing.modelstringBilling model for the account
billing.subscription_idstringStripe subscription ID
billing.subscription_item_idstringStripe subscription item ID
billing.quantitynumberPaid line quantity after the line is added

Success Response (200, Legacy Provisioning)

Section titled “Success Response (200, Legacy Provisioning)”
{
"status": "OK",
"phone_number": "+14155551234",
"worker_id": "worker_abc123",
"subscription_id": "sub_abc123"
}
FieldTypeDescription
statusstringOK
phone_numberstringThe newly provisioned Sendblue phone number
worker_idstringInternal worker ID for the new line
subscription_idstringStripe subscription ID for the line

Deprovisioning releases an assigned phone number and lowers the paid line quantity by one. The released phone number cannot be recovered. No prorated refund or credit is issued; the lower quantity applies at the next renewal.

Use deprovisioning only for paid/API-billed lines. Do not use API deprovisioning for lines added by Sendblue support as free, comped, or replacement lines unless support has explicitly confirmed that the exact phone number is API-billed and safe to release.

Validate that the phone number is assigned to the account and that removing it would not go below the account’s line minimum.

POST /accounts/lines/deprovision-preview
ParameterTypeRequiredDescription
phone_numberstringYesAssigned Sendblue phone number to remove, in E.164 format
Terminal window
curl -X POST "https://api.sendblue.com/accounts/lines/deprovision-preview" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234"
}'
{
"status": "OK",
"preview_token": "ldp_abc123...",
"expires_at": "2026-05-18T14:30:00.000Z",
"phone_number": "+14155551234",
"effect": {
"new_quantity": 41,
"proration": "none",
"note": "No refund or credit is issued; billing decreases at the next renewal. The phone number is released and cannot be recovered."
},
"message": "Call /accounts/lines/deprovision-confirm with this token within 10 minutes to remove the line. This is irreversible."
}
FieldTypeDescription
statusstringOK
preview_tokenstringSingle-use token for the confirm step
expires_atstringISO 8601 expiration timestamp
phone_numberstringPhone number that will be removed
effect.new_quantitynumberPaid line quantity after confirm succeeds
effect.prorationstringnone; no refund or credit is issued
effect.notestringHuman-readable billing and release effect
messagestringHuman-readable next step

Consume the preview_token, release the line, and lower the paid line quantity.

POST /accounts/lines/deprovision-confirm
ParameterTypeRequiredDescription
preview_tokenstringYesToken returned by POST /accounts/lines/deprovision-preview
Terminal window
curl -X POST "https://api.sendblue.com/accounts/lines/deprovision-confirm" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"preview_token": "ldp_abc123..."
}'
{
"status": "OK",
"phone_number": "+14155551234",
"billing": {
"model": "quantity",
"subscription_id": "sub_abc123",
"subscription_item_id": "si_abc123",
"quantity": 41
}
}
FieldTypeDescription
statusstringOK
phone_numberstringThe removed Sendblue phone number
billing.modelstringBilling model for the account
billing.subscription_idstringStripe subscription ID
billing.subscription_item_idstringStripe subscription item ID
billing.quantitynumberPaid line quantity after the line is removed

Line management limits are visible with GET /accounts/limits.

OperationWindowDefaultOverride
ProvisionDaily, rolling 24 hours3 linesSet limits.api_provision_daily on the account
ProvisionMonthly, rolling 30 days10 linesSet limits.api_provision_monthly on the account
DeprovisionDaily, rolling 24 hours3 linesSet limits.api_deprovision_daily on the account
DeprovisionMonthly, rolling 30 days10 linesSet limits.api_deprovision_monthly on the account

Limits are checked during both preview and confirm.

{
"status": "ERROR",
"error": "daily_limit_reached",
"message": "Maximum 3 lines can be added per day via API"
}
HTTP StatusErrorDescription
400-Required request fields are missing or invalid
401-Invalid API credentials
402no_card_on_fileNo card is available for the account
402billing_not_configuredAutomatic line provisioning is enabled but billing setup is incomplete
402billing_not_in_good_standingAccount has unpaid invoices that block provisioning
402payment_failedProvisioning charge was declined
403not_eligibleAccount is not eligible for this line management operation
403line_minimum_reachedDeprovisioning would go below the account’s line minimum
403-Preview token belongs to another account
404line_not_foundPhone number is not assigned to this account
409operation_in_progressAnother line operation is currently running for the account
409billing_not_operableBilling setup exists but is ambiguous or cannot be safely changed automatically
409billing_state_changedBilling state changed since preview; request a new token
409eligibility_changedAccount eligibility changed since preview; request a new token
410token_expiredToken expired or was already used
429daily_limit_reachedDaily line management limit reached
429monthly_limit_reachedMonthly line management limit reached
503no_lines_availableNo lines are currently available for provisioning
503deprovision_failed_retryableThe line could not be released and is still assigned; request a new token and retry
500provisioning_failedLine provisioning failed
500provisioning_inconsistentLine was assigned but billing could not be settled or recorded; contact support
500deprovisioning_failedLine deprovisioning failed
500deprovision_inconsistentLine was removed but billing could not be recorded; contact support
  • The account must be on an eligible inbound_only / Agent plan.
  • API deprovisioning requires automatic line provisioning to be enabled for the account.
  • Provisioned lines are inbound-only lines.
  • A card on file is required for provisioning; accounts without a card receive a 402.
  • Deprovisioning is available during payment grace periods because it lowers the paid line quantity.
  • Preview tokens are single-use. If confirm fails or the token expires, call preview again.
  • All line management endpoints use standard API key and secret authentication.