Skip to main content
POST
Terminate a line
  • Credential: an API key of the owner of the line, on any account. See Terminate for the effect on billing.
  • Line-scoped keys: a line-scoped key gets 403 forbidden unless the line is in its list.
  • Test keys: a termination sent with an isnap_test_ account key ends the real line: see Test keys.
  • Idempotency-Key: not honored. Terminating a line that is already cancelled returns 200 with the line unchanged and sends no event, so a retry is safe.
  • Events: line.terminated, line.disconnected, one message.failed for each failed message, and one binding.released for each released binding of a shared line.
  • Hosted macOS sessions: the sessions that ran the line are taken off it and listed in released_macos_session_ids of line.terminated. Each stays rented until you cancel it with POST /v1/macos-sessions/{id}/cancel.

Errors

Branch on error.code, never on error.message. 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.

Path Parameters

id
string
required

Id of a line: line_ followed by 25 letters or digits.

Pattern: ^line_[0-9A-Za-z]{25}$

Body

application/json

An optional note for the termination.

reason
string

Optional note of 1 to 255 characters, with no control character. Returned as reason in the line.terminated event. Defaults to terminated by the customer.

Required string length: 1 - 255

Response

The line, with status: cancelled.

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.