Skip to main content

Sync your SIM list

If your own system (a fleet platform, a CRM, a billing system) keeps a list of SIMs, here's how to keep it in step with Axis without hammering the API.

A full sync once a day catches everything, and webhooks keep you current in between.

Full sync: page through every SIM​

GET/api/v1/simsTry it →

Ask for 100 at a time and keep going while pagination.hasMore is true. A few thousand SIMs takes a few dozen requests, comfortably within the rate limit.

async function* allSims() {
for (let page = 1; ; page++) {
const res = await fetch(`https://app.zentarinetworks.com/api/v1/sims?pageSize=100&page=${page}`, {
headers: { Authorization: `Bearer ${process.env.AXIS_API_KEY}` },
});
if (!res.ok) throw new Error(`Axis said ${res.status}: ${(await res.json()).detail}`);
const { data, pagination } = await res.json();
yield* data;
if (!pagination.hasMore) return;
}
}

for await (const sim of allSims()) {
await db.upsertSim(sim.id, sim); // your code
}

Match on the SIM's id (it never changes). The iccid is also unique and is what's printed on the card. A SIM that was in your copy but isn't returned any more has left your account.

:::tip Only need some? Filters cut the work: ?poolId=7, ?status=suspended, ?type=digital, ?onPlan=false, or ?search= for an ICCID, IMSI, phone number or tag. :::

In between: react to webhooks​

  • ticket.completed / ticket.failed: a SIM changed (status, plan, Fixed Public IP). Fetch it again with GET /sims/{simId}.
  • watchdog.*: usage passed a rule; the payload carries the usage, so you may not need to fetch anything.
  • order.updated with "status": "completed": new SIMs may have arrived. Run the full sync, or fetch GET /sims?onPlan=false.

Looking a SIM up​

GET/api/v1/sims/{id}Try it →
GET/api/v1/sims/by-iccid/{iccid}Try it →

The activity log​

For an audit trail of what happened on the account (who changed what, tickets raised and finished, billing, the Watchdog), read the event log. It's the same as the portal's Events page.

GET/api/v1/eventsTry it →

Newest first; filter with type (sim, pool, billing, user, account, system, watchdog), severity (success, info, warning, danger), date (yyyy-MM-dd) and search.