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.
- Update a line’s name or profile photo.
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.
Workspace-level overrides can still raise limits for specific customers.
Line Request Statuses
Endpoints
Recommended integration pattern
For most API clients, the cleanest pattern is:- Call
POST /api/line-requestswith the legal name, company name andantiSpamAccepted: true— plus, for a purchased phone line (eSIM), the legal address,simCountry(USorCA), thezipcodeto provision on andareaCodeBestEffortAcknowledged: true. The display name is optional and falls back to the legal name. See Create Line Request.
iMessage works globally. P2P SMS fallback from a line’s own number only reaches recipients in the
country of that line’s eSIM (
simCountry).- If the response is
provisioning, store the returnedline._id - If the response is
awaiting_payment, store the returnedline._idandpaymentUrl - Poll
GET /api/line-requests/{id}until the status changes - If needed, call
POST /api/line-requests/{id}withaction: "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
profileImageUrl is the public URL of the line’s profile photo, or null if none is set. It is part of the stable response.
Example
Response
Update a Line’s Name, Photo or Call Recording Notice
Endpoint
- Method:
PATCH - Path:
/api/lines/{id} - Auth: Tuco API key
firstName, lastName, profileImageUrl (use null to remove the photo), callRecordingDisclosure (true plays a “this call may be recorded” notice when the person you call answers) and callRecordingDisclosureMessage (your own wording, or null for the default). Other fields are rejected. See Update a Line.
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.