Tickets
Some things Axis does straight away, like renaming a pool. Others have to be done by the mobile network: switching a
SIM on or off, sending it an SMS, putting it on a plan. Those can't finish within your request, so Axis sends them
to the network as a ticket and answers 202 Accepted at once. The network usually finishes within seconds,
occasionally a few minutes.
What raises a ticket
| Action | Endpoint | Ticket type |
|---|---|---|
| Suspend a SIM | POST /sims/{id}/suspend | suspend |
| Reactivate a SIM | POST /sims/{id}/activate | activate |
| Send an SMS | POST /sims/{id}/sms | send_sms |
| Refresh a connection | POST /sims/{id}/refresh | refresh |
| Put a SIM with no plan on one | PUT /sims/{id}/plan | provision |
| Add or remove a Fixed Public IP | POST / DELETE /sims/{id}/fixed-public-ip | add_fixed_public_ip, remove_fixed_public_ip |
Two more appear in a SIM's ticket history at the start of a month, when a change you queued earlier takes effect
(see Change a SIM's plan): unprovision when a SIM comes off its plan, and reprovision
when it moves to another pool or tariff.
The answer you get
HTTP/1.1 202 Accepted
Location: /api/v1/tickets/3f2b8c1e-7d4a-4f9e-9b61-2c0d5e8a7f13
{
"id": "3f2b8c1e-7d4a-4f9e-9b61-2c0d5e8a7f13",
"simId": 4183,
"type": "suspend",
"status": "processing",
"createdAt": "2026-10-08T14:30:02Z",
"provisioning": null
}
How a ticket ends
| Status | Meaning |
|---|---|
pending | Accepted by Axis, about to go to the network |
processing | With the network |
completed | Done: the SIM is in its new state |
failed | The network couldn't do it. The SIM is as it was; try again, or contact support if it keeps failing |
cancelled | Cancelled before the network started on it |
Finding out when it's done
Best: webhooks. Set a webhook URL and Axis posts ticket.completed or ticket.failed as soon as the network
finishes. No polling, nothing missed. See Webhooks.
Or poll the ticket. Ask every few seconds until it's no longer pending or processing, and give up after a few
minutes:
- Node.js
- Python
- C#
async function waitForTicket(id, { everyMs = 5000, timeoutMs = 5 * 60_000 } = {}) {
const until = Date.now() + timeoutMs;
while (Date.now() < until) {
const res = await fetch(`https://app.zentarinetworks.com/api/v1/tickets/${id}`, {
headers: { Authorization: `Bearer ${process.env.AXIS_API_KEY}` },
});
const ticket = await res.json();
if (!['pending', 'processing'].includes(ticket.status)) return ticket; // completed, failed or cancelled
await new Promise((r) => setTimeout(r, everyMs));
}
throw new Error(`Ticket ${id} still running after ${timeoutMs / 1000}s`);
}
import time
def wait_for_ticket(ticket_id, every=5, timeout=300):
deadline = time.time() + timeout
while time.time() < deadline:
ticket = requests.get(
f"https://app.zentarinetworks.com/api/v1/tickets/{ticket_id}",
headers={"Authorization": f"Bearer {os.environ['AXIS_API_KEY']}"},
).json()
if ticket["status"] not in ("pending", "processing"):
return ticket # completed, failed or cancelled
time.sleep(every)
raise TimeoutError(f"Ticket {ticket_id} still running after {timeout}s")
async Task<JsonElement> WaitForTicketAsync(HttpClient http, Guid id, TimeSpan? timeout = null)
{
var until = DateTime.UtcNow + (timeout ?? TimeSpan.FromMinutes(5));
while (DateTime.UtcNow < until)
{
var ticket = await http.GetFromJsonAsync<JsonElement>($"tickets/{id}");
var status = ticket.GetProperty("status").GetString();
if (status is not ("pending" or "processing")) return ticket; // completed, failed or cancelled
await Task.Delay(TimeSpan.FromSeconds(5));
}
throw new TimeoutException($"Ticket {id} still running");
}
You can also list a SIM's tickets with GET /tickets?simId=4183, and every SIM has processingTickets: how many of
its tickets are still with the network.
One change of each kind at a time
While a SIM has a ticket of one type still running, another of the same type is refused with 409
conflict. For example, a second suspend while the first is with the network. Wait for the
first to finish. Different actions can overlap (you can send an SMS while a refresh is running).
Cancelling a ticket
Only while it's pending or processing and the network hasn't started on it. Otherwise you get 409. In practice
most tickets finish too quickly to cancel.