Skip to main content
POST
Change the variant of a line
  • Credential: an API key of the owner of the line. The line must be an active rented line with no per-line subscription. A line with one returns 409 variant_bound_to_stripe_price. See Variant changes 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 change sent with an isnap_test_ account key changes the real line and its billing: see Test keys.
  • Idempotency-Key: not honored. With effective absent or now, asking for the value that the line already has returns 200 and changes nothing. With effective: "next_anchor", resending the pending change returns it unchanged. Scheduling the value that the line already has returns 200 and stores nothing when no change is pending, and 409 variant_change_already_pending while a change to the other value is pending.
  • Events: line.variant_changed when a change is applied, line.variant_scheduled when a change is scheduled. A scheduled change that is dropped sends no event.

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.

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

The variant to give the line, and when the change applies. A field that the body does not declare is ignored: a misspelled effective applies the change immediately.

inbound_only
boolean
required

true for the inbound-only variant: the line can message a contact only after that contact has messaged it. false for the two-way variant.

effective
enum<string>

When the change applies. now, the default: immediately, so the next send obeys the new value. next_anchor: at a billing anchor occurrence of the line; until then inbound_only keeps its value and pending_variant holds the change. An immediate change does not withdraw a scheduled one: use DELETE /v1/lines/{id}/variant for that.

Available options:
now,
next_anchor
not_before
string<date-time>

Used only with effective: "next_anchor"; ignored otherwise. The earliest timestamp at which the change can apply (ISO 8601, UTC, with a Z suffix). The change applies at the first billing anchor occurrence at or after it, returned as pending_variant.effective_at. Defaults to the time of the request. A past timestamp returns 400 not_before_in_the_past.

Example:

"2027-08-11T14:30:00Z"

Response

The line. After an immediate change, inbound_only holds the requested value. After a scheduled one, inbound_only is unchanged and pending_variant holds the requested value and the date it applies.

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.