- API Reference
- Box API
- Modems
Set the APN of one or more modems
Use this when a SIM needs a specific APN to get data. Saves the APN for each modem's label and applies it to the modem; result lists which positions succeeded and failed. status is true even when some positions failed. The modem reconnects with the new APN. The request contains the APN password.
/v2/change_apnRequest body application/json · required
APN settings. Stored per modem label and applied to the modem.
1 lets the box detect the APN from the SIM; 0 uses the values below.
0, 1APN name given by the carrier.
0 dual stack, 1 IPv4 only, 2 IPv6 only.
0, 1, 2NONE, PAP, CHAP1 re-applies the APN every time the modem connects.
0, 1Authentication
Needs dashboard Basic credentials when dashboard authentication is enabled; trusted callers (loopback, LAN unless "force auth for local" is on, whitelisted IP, allowed Tailscale) pass without them.
Responses
Outcome per position, or the generic error.
The caller is not trusted (not loopback, LAN, whitelisted or allowed Tailscale) and sent no valid Basic credentials. The body depends on whether "Basic auth for all API" is on. Routes that also use the panel login can answer a plain-text 401 "Unauthorized Access" instead.
Errors returned in msg
| msg | Meaning | What to do |
|---|---|---|
Sent change APN failed. Please try again later! | positions or apn missing. | Send both fields. |
APN changed for N devices. M failed. | Some positions are empty or the modem rejected the APN. | Check result.failed and the modem type. |