# Lines and numbers

A **Line** is the owned identity; a phone number is its current network
endpoint. Your plan sets how many number-holding Lines your organization
may have, including `provisioning`, `active` and `suspended` claims. A Line
in `releasing` no longer counts once its carrier number exists: releasing frees
its slot immediately, while carrier deletion may finish asynchronously. An
unresolved acquisition stays counted until reconciliation retires it.

## Search, reserve, acquire

1. `GET /v1/available-numbers?country=US&area_code=212&capabilities=voice,sms`.
   Listings expose purchase and rental costs separately, as quoted.
2. Authorized owner or project key: `POST /v1/numbers/reserve {org,country,area_code}`.
   The returned `nres_…` carries an `expires_at` — trust the returned
   expiry, not a fixed sleep.
3. `POST /v1/lines {org,number_reservation}`; for delegated execution
   supply `agent`, or use the paired agent's `numbers.provision` grant.
4. Real orders can return `status: provisioning`. Retrieve the **same
   Line** until it is active; do not create a second order to recover a
   lost response.

ORDan records the claim before ordering, attaches the voice and messaging
configuration, and verifies the number on activation. Purchase and first
rental are separate expenses under one cost authorization; rental continues
on suspended numbers (suspension is not carrier deletion). Ported
inventory can be attached with `phone_number: num_…` — see
[ports](api.md).

## Messaging readiness

Voice can be active while outbound SMS approval is still pending. Each
customer's number is assigned to its own approved campaign. Outbound SMS
returns `409 a2p_registration_pending` until registration and assignment
are complete. See [messaging](messaging.md).

## Suspend, restore, release

`POST /v1/lines/{line}/revoke` suspends authority and holds the number for
30 days. `/reactivate` restores a suspended Line if available, within the
organization's Line cap (403 `limit_reached` otherwise). Only an owner or
admin can reactivate, from a signed-in session: a project key or an agent
gets `401`. A Line held because a trial ended or a payment failed shows
`hold_reason` and can't be reactivated by hand (`409`, `held_for_billing`):
subscribing, or settling billing, restores it. `DELETE
/v1/lines/{line}` requests permanent release; the console exposes it as
**Release** on the Lines page. A signed-in member with the `DEVELOPER` role or
above may release a Line, and so may a project key with `lines:write` for the
Line's own project. The Line slot is
freed when the release is requested; a real Line can remain `releasing` while
calls are hung up and carrier deletion is confirmed.

Use `GET /v1/numbers` for unattached inventory; authorized owners/keys can
release numbers directly. An agent with `numbers.provision` or
`numbers.release` lists its own numbers (those on its Lines and those it
bought), and with `numbers.release` can release one it bought once no Line
holds it; a number on a Line goes with `DELETE /v1/lines/{line}`, and a
revoked Line's number stays held for the owner. Keep polling through
`release_pending` — an API
acknowledgement is not proof the monthly rental stopped. See
[errors](errors.md) for how pending states resolve.
