Skip to main content
POST
Create a shared line
  • Credential: an API key with no list of lines. See Shared lines.
  • Account: wholesale partners only: any other account receives 402 payment_required.
  • Line-scoped keys: every line-scoped key gets 403 forbidden.
  • Test keys: a call sent with an isnap_test_ account key creates a real line, billed like any other: see Test keys.
  • Idempotency-Key: honored, and remembered for 24 hours. Without it, every retry creates one more billable line. A request with no body and a request with {} are different requests. See Retries and Lines and hosted macOS sessions.
  • Events: none. See Events.
  • Response: 201 with the line. Read it later with GET /v1/lines/my: GET /v1/lines/{id} returns 404 for a shared line.

Errors

The errors that every operation shares are in Errors.

Authorizations

Authorization
string
header
required

An API key created in the iSnap dashboard, or a trial key, sent as Authorization: Bearer <key>. An API key starts with isnap_live_ or isnap_test_; both act on the same account, lines and billing. A trial key acts on its trial only.

Headers

idempotency-key
string

Optional key that makes a retry safe. A request repeated with the same key, by the same API key, with the same method, path and body, within 24 hours, returns the first successful response unchanged, its trace_id and request_id included, and does not act again. The body is compared byte for byte: a request with no body and a request with {} are two different requests. The same key with another method, path or body returns 409 idempotency_key_collision. While the first request is still running, a retry returns 503 idempotency_in_flight; a request that never completes frees its key after 60 seconds. Only a 2xx response is recorded: after a failed request, the retry runs again. At most 255 characters: a longer key returns 400 validation_failed. The X-Idempotency-Key header is read when Idempotency-Key is absent.

Maximum string length: 255

Body

application/json

Optional metadata for the new shared line.

metadata
object

Your own key-value data, set on the new line. At most 20 keys and 8,192 bytes once serialized as JSON. The keys migration_ref and proof_line are reserved (400 reserved_metadata_key). Never put personal data or secrets in it.

Example:

Response

The new shared line, active.

success
enum<boolean>
required

Always true on a success response.

Available options:
true
data
object
required

A line. billing_tier, byod, shared, test_line and inbound_only tell the kinds of line apart: a rented line (two-way or inbound-only), a BYOD line, a shared line, a test line.

trace_id
string
required

Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap.

request_id
string
required

Id of the request that produced this response: req_ followed by 25 letters or digits.