Before You Request Lines
The line-request API is for workspaces that already exist in Tuco. That means the normal first step is still:- Sign in to Tuco.
- Create or join a workspace.
- Buy a base plan for that workspace.
- Use your workspace API key to request lines.
subscription_required and does not create the request.
What the Lines API Does
Lines are the sending identities you use in Tuco, such as phone numbers and email addresses. Through the API, you can:- Request a new line.
- Check whether a request is waiting for payment, provisioning, active, failed, or canceled.
- Recover a payment link for a pending request.
- Cancel a pending request you no longer want.
- List the lines already attached to your workspace.
Line Request Flow
The request flow is intentionally simple:- Submit the line details once.
- Tuco checks your active plan and current capacity.
- If the request is included in your plan, Tuco moves it straight to
provisioning. - If the request requires an add-on, Tuco stores the line request as
awaiting_paymentand returns a hosted invoice link. - After payment succeeds, the request moves to
provisioning.
What happens if the user does not want to pay?
If a line request is inawaiting_payment, the user can:
- pay the invoice and let the same request continue
- recover the payment link later
- cancel the request entirely
What happens if the user loses the payment link?
Use the line-request management endpoint to recover it. If the invoice is still open, Tuco returns the same hosted invoice link. If billing has already been reconciled, the request may already move toprovisioning.
What blocks the next request?
Onlyawaiting_payment blocks a new line request.
A request already in provisioning does not block the next purchase. This lets a workspace continue buying or requesting lines while earlier ones are still being set up.
Plan Behavior
Tuco checks both the workspace plan and the line type you are requesting.| Plan | Phone lines | Email lines |
|---|---|---|
| Mini | Not available | First email included, more email lines paid |
| Starter | First phone included, no extra phone lines | Paid add-ons |
| Growth | First 2 phone lines included, more phone lines paid | Paid add-ons |
Line Request Statuses
| Status | Meaning |
|---|---|
awaiting_payment | The line request exists, but payment is still required before provisioning can begin |
provisioning | Tuco accepted the request and provisioning is underway |
active | The line is ready to use |
failed | Provisioning did not complete successfully |
canceled | The request was canceled before completion |
Endpoints
Recommended integration pattern
For most API clients, the cleanest pattern is:- Call
POST /api/line-requests - If the response is
provisioning, store the returnedline._id - If the response is
awaiting_payment, store the returnedline._idandpaymentUrl - Poll
GET /api/line-requests/:iduntil the status changes - If needed, call
POST /api/line-requests/:idwithaction: "payment_link"oraction: "cancel"
Fetch All Lines (API Key)
Endpoint
- Method:
GET - Path:
/api/lines/by-user - Auth: Tuco API key or Clerk token (via
authenticateRequest)
Behavior
Returns all lines for the authenticated workspace, including:- current profile details
- provisioning and payment state
- per-day usage
- public health information when available
Example
Response
Check Health of a Line
Endpoint
- Method:
GET - Path:
/api/lines/check-availability?id={lineId} - Auth: Clerk (Tuco dashboard or trusted backend using Clerk tokens)
Example
Response (success)
400 with a descriptive error; on auth failure you receive 401.