Skip to main content

Managing Entitlements

Manage entitlements such as fast_track, lease, and identity:
const list = await contiguity.entitlements.list();
const one = await contiguity.entitlements.get("fast_track");
const applied = await contiguity.entitlements.apply("fast_track");
const revoked = await contiguity.entitlements.revoke("fast_track");

Parameters

id
string
required
Entitlement identifier (e.g. fast_track, lease, identity). Used in get, apply, and revoke.

Response

entitlements
object[]
Array of entitlements with status. Returned by list().
metadata
object
Request metadata: id, timestamp, api_version, object.

Applying via API

When an API error includes agreement_url, agreements.accept() lets you apply for the entitlement automatically in your error handling code.
import { ContiguityError } from "contiguity";

try {
    await contiguity.text.send({ to: "+1234567890", message: "Hi", fast_track: true });
} catch (e) {
    if (e instanceof ContiguityError && e.data?.agreement_url) {
        await contiguity.agreements.accept(e.data.agreement_url); // agrees to fast track terms
    }
    throw e;
}