{
  "openapi": "3.0.1",
  "info": {
    "title": "Netavo API: IoT",
    "description": "Manage SIMs: list and inspect them, activate, pause, resume and cease them, change their plan, and read usage, sessions and eSIM activation codes.",
    "contact": {
      "name": "Netavo Support",
      "email": "support@netavo.com"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://partners.netavo.com/api"
    }
  ],
  "paths": {
    "/v1/iot/plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "List plans",
        "description": "The plans your account can put a SIM on, with your prices (ex VAT). Use a plan's `id` with\nthe change-plan endpoint. A SIM can only move to a plan on the coverage it is already on.",
        "operationId": "listPlans",
        "parameters": [
          {
            "name": "coverage",
            "in": "query",
            "description": "Only plans with this coverage key.",
            "schema": {
              "type": "string"
            },
            "example": "3e8d1c5a-7f2b-4a90-b6e4-1d0c9f8a2b37"
          },
          {
            "name": "organisationId",
            "in": "query",
            "description": "Partners: the plans and prices of a customer organisation below you.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
          },
          {
            "name": "iccid",
            "in": "query",
            "description": "Only the plans this SIM can move to (its coverage, at its holder's prices). Other filters are ignored.",
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          }
        ],
        "responses": {
          "200": {
            "description": "Every plan available to you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanList"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/plans",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/plans",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.plans:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.plans:read scope.",
                  "instance": "/api/v1/iot/plans",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/plans",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.plans:read"
      }
    },
    "/v1/iot/sims": {
      "get": {
        "tags": [
          "SIMs"
        ],
        "summary": "List SIMs",
        "description": "Every SIM in your account, ordered by ICCID. Partners see SIMs across their customer\norganisations; `organisationId` narrows to one of them.",
        "operationId": "listSims",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many items to return, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "example": 50
            },
            "example": 50
          },
          {
            "name": "startingAfter",
            "in": "query",
            "description": "Cursor from the previous page's `nextCursor`. Leave out for the first page.",
            "schema": {
              "type": "string",
              "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
            },
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only SIMs in this status, e.g. `active` or `paused`.",
            "schema": {
              "type": "string",
              "example": "active"
            },
            "example": "active"
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Only SIMs carrying this tag.",
            "schema": {
              "maxLength": 50,
              "type": "string",
              "example": "site:leeds"
            },
            "example": "site:leeds"
          },
          {
            "name": "organisationId",
            "in": "query",
            "description": "Partners: only SIMs held by this organisation (one of yours, or a customer below you).",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
            },
            "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of SIMs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimList"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:read scope.",
                  "instance": "/api/v1/iot/sims",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:read"
      }
    },
    "/v1/iot/sims/{iccid}": {
      "get": {
        "tags": [
          "SIMs"
        ],
        "summary": "Get a SIM",
        "description": "One SIM by ICCID.",
        "operationId": "getSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          }
        ],
        "responses": {
          "200": {
            "description": "The SIM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:read scope.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:read"
      },
      "patch": {
        "tags": [
          "SIMs"
        ],
        "summary": "Update a SIM",
        "description": "Sets the SIM's label and tags. Leave a field out (or send null) to keep it; `\"label\": \"\"`\nclears the label and `\"tags\": []` removes every tag. Tags are de-duplicated ignoring case;\nat most 20 of up to 50 characters each.",
        "operationId": "updateSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          }
        ],
        "requestBody": {
          "description": "The fields to change.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated SIM.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:write` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:write scope.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:write"
      }
    },
    "/v1/iot/sims/{iccid}/activate": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Activate a SIM",
        "description": "Starts service on an inactive SIM that has a plan. Activation is scheduled for the next\nworking day (`activationScheduledFor`); billing starts when it takes effect and\n`iot.sim.activated` is sent then.",
        "operationId": "activateSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Any unique string (a UUID is ideal). Retrying with the same key returns the first result instead of acting twice. Keys are kept for 24 hours; while the first request is still running a retry gets 409 `idempotency-key-in-use`.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "5d1c7a0e-2f4b-4e8a-9c61-3b7f0d2e8a14"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted. The SIM is returned in its pending state; a notification follows when the change takes effect.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:write` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:write scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is not in a state this action applies to.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/invalid-state",
                  "title": "Invalid state",
                  "status": 409,
                  "detail": "SIM 8944110068212345678 is already activated.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "invalid-state",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "422": {
            "description": "The `Idempotency-Key` was already used for a different request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/idempotency-key-reused",
                  "title": "Idempotency key reused",
                  "status": 422,
                  "detail": "This Idempotency-Key was used with a different request body.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "idempotency-key-reused",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/activate",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:write"
      }
    },
    "/v1/iot/sims/{iccid}/cease": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Cease a SIM",
        "description": "Permanently ends service on a SIM. The SIM keeps working, and billing, until the end of the\nperiod already paid for (`stopsAt`); nothing is refunded, and an annual SIM stays billed to\nthe end of its paid year. `iot.sim.ceased` is sent when it stops. A SIM that has never\nstarted billing is withdrawn at once. Needs its own scope because it cannot be undone.",
        "operationId": "ceaseSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Any unique string (a UUID is ideal). Retrying with the same key returns the first result instead of acting twice. Keys are kept for 24 hours; while the first request is still running a retry gets 409 `idempotency-key-in-use`.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "5d1c7a0e-2f4b-4e8a-9c61-3b7f0d2e8a14"
          }
        ],
        "requestBody": {
          "description": "Confirmation of the SIM to cease.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimCeaseRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The SIM is returned as `pendingCease` with its `stopsAt`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:cease` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:cease scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is not in a state this action applies to.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/invalid-state",
                  "title": "Invalid state",
                  "status": 409,
                  "detail": "SIM 8944110068212345678 has no plan to cease.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "invalid-state",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "422": {
            "description": "The `Idempotency-Key` was already used for a different request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/idempotency-key-reused",
                  "title": "Idempotency key reused",
                  "status": 422,
                  "detail": "This Idempotency-Key was used with a different request body.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "idempotency-key-reused",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/cease",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:cease"
      }
    },
    "/v1/iot/sims/{iccid}/esim": {
      "get": {
        "tags": [
          "eSIM"
        ],
        "summary": "Get an eSIM activation code",
        "description": "The activation code and QR code for an eSIM profile, read from the network each time. Treat\nthe code like a password: anyone with it can download the profile until it is installed.",
        "operationId": "getSimEsim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068298765432"
          }
        ],
        "responses": {
          "200": {
            "description": "The activation details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EsimActivation"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.esim:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.esim:read scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is a physical SIM, not an eSIM.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-an-esim",
                  "title": "Not an eSIM",
                  "status": 409,
                  "detail": "SIM 8944110068212345678 is not an eSIM.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "not-an-esim",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "502": {
            "description": "The network did not return an activation code. Retry later.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/carrier-error",
                  "title": "Network error",
                  "status": 502,
                  "detail": "The carrier returned no activation code.",
                  "instance": "/api/v1/iot/sims/{iccid}/esim",
                  "code": "carrier-error",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.esim:read"
      }
    },
    "/v1/iot/sims/{iccid}/pause": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Pause a SIM",
        "description": "Stops the SIM passing data until you resume it. The plan keeps running and billing, and\n`iot.sim.paused` is sent when the network has applied it. Pausing a SIM that is already\npaused or suspended changes nothing.",
        "operationId": "pauseSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Any unique string (a UUID is ideal). Retrying with the same key returns the first result instead of acting twice. Keys are kept for 24 hours; while the first request is still running a retry gets 409 `idempotency-key-in-use`.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "5d1c7a0e-2f4b-4e8a-9c61-3b7f0d2e8a14"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted. The SIM is returned in its pending state; a notification follows when the change takes effect.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:write` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:write scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is not in a state this action applies to.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/invalid-state",
                  "title": "Invalid state",
                  "status": 409,
                  "detail": "The SIM is still being activated and cannot be paused yet.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "invalid-state",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "422": {
            "description": "The `Idempotency-Key` was already used for a different request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/idempotency-key-reused",
                  "title": "Idempotency key reused",
                  "status": 422,
                  "detail": "This Idempotency-Key was used with a different request body.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "idempotency-key-reused",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/pause",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:write"
      }
    },
    "/v1/iot/sims/{iccid}/plan": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Change a SIM's plan",
        "description": "Moves the SIM to another plan your account can use (`GET /v1/iot/plans`). A plan with at\nleast as much data is an upgrade: it applies now and the difference for the rest of the\nperiod is charged now. A smaller plan is a downgrade and applies at the next renewal\n(`effectiveAt`). `iot.sim.plan_changed` is sent when it takes effect.",
        "operationId": "changeSimPlan",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Any unique string (a UUID is ideal). Retrying with the same key returns the first result instead of acting twice. Keys are kept for 24 hours; while the first request is still running a retry gets 409 `idempotency-key-in-use`.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "5d1c7a0e-2f4b-4e8a-9c61-3b7f0d2e8a14"
          }
        ],
        "requestBody": {
          "description": "The new plan.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The plan change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanChange"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:write` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:write scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is not in a state this action applies to.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/invalid-state",
                  "title": "Invalid state",
                  "status": 409,
                  "detail": "This SIM's plan is paid for the year, so it can only be made smaller from its renewal.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "invalid-state",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "422": {
            "description": "The plan is not one your account can put this SIM on. Or: The `Idempotency-Key` was already used for a different request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "plan-not-eligible": {
                    "summary": "Plan not available",
                    "value": {
                      "type": "https://partners.netavo.com/api/problems/plan-not-eligible",
                      "title": "Plan not available",
                      "status": 422,
                      "detail": "'10 GB, EU roaming' is not one of the plans this service offers.",
                      "instance": "/api/v1/iot/sims/{iccid}/plan",
                      "code": "plan-not-eligible",
                      "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                    }
                  },
                  "idempotency-key-reused": {
                    "summary": "Idempotency key reused",
                    "value": {
                      "type": "https://partners.netavo.com/api/problems/idempotency-key-reused",
                      "title": "Idempotency key reused",
                      "status": 422,
                      "detail": "This Idempotency-Key was used with a different request body.",
                      "instance": "/api/v1/iot/sims/{iccid}/plan",
                      "code": "idempotency-key-reused",
                      "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/plan",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:write"
      }
    },
    "/v1/iot/sims/{iccid}/resume": {
      "post": {
        "tags": [
          "SIMs"
        ],
        "summary": "Resume a SIM",
        "description": "Restarts data on a SIM you paused. SIMs suspended for another reason (non-payment, or by\nour operations team) cannot be resumed here: `409` says why. `iot.sim.resumed` is sent when\nthe network has applied it.",
        "operationId": "resumeSim",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Any unique string (a UUID is ideal). Retrying with the same key returns the first result instead of acting twice. Keys are kept for 24 hours; while the first request is still running a retry gets 409 `idempotency-key-in-use`.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "5d1c7a0e-2f4b-4e8a-9c61-3b7f0d2e8a14"
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted. The SIM is returned in its pending state; a notification follows when the change takes effect.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sim"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.sims:write` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.sims:write scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "409": {
            "description": "The SIM is not paused by you.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/invalid-state",
                  "title": "Invalid state",
                  "status": 409,
                  "detail": "This SIM was suspended because a payment failed. It is restored once the account is paid; contact support if it has been.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "invalid-state",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "422": {
            "description": "The `Idempotency-Key` was already used for a different request.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/idempotency-key-reused",
                  "title": "Idempotency key reused",
                  "status": 422,
                  "detail": "This Idempotency-Key was used with a different request body.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "idempotency-key-reused",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/resume",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.sims:write"
      }
    },
    "/v1/iot/sims/{iccid}/sessions": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "List a SIM's sessions",
        "description": "Data sessions, newest first: the session still open (if any), then those that ended in the\nwindow (default the last 30 days; at most 93 days).",
        "operationId": "listSimSessions",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many items to return, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "example": 50
            },
            "example": 50
          },
          {
            "name": "startingAfter",
            "in": "query",
            "description": "Cursor from the previous page's `nextCursor`. Leave out for the first page.",
            "schema": {
              "type": "string",
              "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
            },
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only sessions that ended at or after this time. Default: 30 days ago.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-09-01T00:00:00Z"
            },
            "example": "2026-09-01T00:00:00Z"
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only sessions that ended before this time. Default: now.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-09-25T00:00:00Z"
            },
            "example": "2026-09-25T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of sessions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims/{iccid}/sessions",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/sessions",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.usage:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.usage:read scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/sessions",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/sessions",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/sessions",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.usage:read"
      }
    },
    "/v1/iot/sims/{iccid}/usage": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get a SIM's usage",
        "description": "Data used in the current allowance period (a calendar month), including the session still\nopen, with up to twelve earlier periods in `history` — or one past month with `period`.",
        "operationId": "getSimUsage",
        "parameters": [
          {
            "name": "iccid",
            "in": "path",
            "description": "The SIM's ICCID, 19 or 20 digits, as printed on the card.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "period",
            "in": "query",
            "description": "A past month as `yyyy-mm`. Leave out for the current period.",
            "schema": {
              "pattern": "^[0-9]{4}-[0-9]{2}$",
              "type": "string"
            },
            "example": "2026-08"
          }
        ],
        "responses": {
          "200": {
            "description": "Usage for the period.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimUsage"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/sims/{iccid}/usage",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/sims/{iccid}/usage",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.usage:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.usage:read scope.",
                  "instance": "/api/v1/iot/sims/{iccid}/usage",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not in your account. Resources outside your organisation are always 404, never 403.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/not-found",
                  "title": "Not found",
                  "status": 404,
                  "detail": "No such resource in your account.",
                  "instance": "/api/v1/iot/sims/{iccid}/usage",
                  "code": "not-found",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/sims/{iccid}/usage",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.usage:read"
      }
    },
    "/v1/iot/usage": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "List fleet usage",
        "description": "Each SIM's data use in its current allowance period, ordered by ICCID: allowance, data used\n(including the session still open), whether it is online now, and — while it is stopped for\nhaving used its allowance — when it starts working again.",
        "operationId": "listFleetUsage",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many items to return, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "example": 50
            },
            "example": 50
          },
          {
            "name": "startingAfter",
            "in": "query",
            "description": "Cursor from the previous page's `nextCursor`. Leave out for the first page.",
            "schema": {
              "type": "string",
              "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
            },
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          },
          {
            "name": "iccid",
            "in": "query",
            "description": "Only this SIM.",
            "schema": {
              "type": "string",
              "example": "8944110068212345678"
            },
            "example": "8944110068212345678"
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Only SIMs with this tag.",
            "schema": {
              "maxLength": 50,
              "type": "string",
              "example": "fleet-north"
            },
            "example": "fleet-north"
          },
          {
            "name": "organisationId",
            "in": "query",
            "description": "Partners: only this customer organisation's SIMs.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
            },
            "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of usage summaries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimUsageSummaryList"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/validation-failed",
                  "title": "Validation failed",
                  "status": 400,
                  "detail": "limit must be between 1 and 100.",
                  "instance": "/api/v1/iot/usage",
                  "code": "validation-failed",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, expired or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "The bearer token is missing, expired or revoked.",
                  "instance": "/api/v1/iot/usage",
                  "code": "unauthorized",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but lacks the `iot.usage:read` scope.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/insufficient-scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This key needs the iot.usage:read scope.",
                  "instance": "/api/v1/iot/usage",
                  "code": "insufficient-scope",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Wait for `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://partners.netavo.com/api/problems/rate-limited",
                  "title": "Too many requests",
                  "status": 429,
                  "detail": "Rate limit exceeded; retry after 12 seconds.",
                  "instance": "/api/v1/iot/usage",
                  "code": "rate-limited",
                  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [ ]
          }
        ],
        "x-required-scope": "iot.usage:read"
      }
    }
  },
  "components": {
    "schemas": {
      "BillingInterval": {
        "enum": [
          "monthly",
          "annual"
        ],
        "type": "string",
        "description": "How often a plan can be billed."
      },
      "Coverage": {
        "required": [
          "key",
          "label",
          "networks"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The coverage's id; filter plans by it with `?coverage=`.",
            "example": "3e8d1c5a-7f2b-4a90-b6e4-1d0c9f8a2b37"
          },
          "label": {
            "type": "string",
            "example": "UK 4-network"
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The UK networks it permits.",
            "example": [
              "EE",
              "O2",
              "Three",
              "Vodafone"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Which networks a plan can use."
      },
      "EsimActivation": {
        "required": [
          "activationCode",
          "iccid",
          "matchingId",
          "qrCodeSvg",
          "smdpAddress"
        ],
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "example": "8944110068298765432"
          },
          "activationCode": {
            "type": "string",
            "description": "The full LPA string, as encoded in the QR code.",
            "example": "LPA:1$smdp.example.net$K2-4N7Q2-1XZ9PQ"
          },
          "smdpAddress": {
            "type": "string",
            "example": "smdp.example.net"
          },
          "matchingId": {
            "type": "string",
            "example": "K2-4N7Q2-1XZ9PQ"
          },
          "qrCodeSvg": {
            "type": "string",
            "description": "The QR code as an SVG document, ready to show or print.",
            "example": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 41 41\">…</svg>"
          }
        },
        "additionalProperties": false,
        "description": "What a device needs to download its eSIM profile."
      },
      "FormFactor": {
        "enum": [
          "triSim",
          "mff2",
          "esim"
        ],
        "type": "string",
        "description": "Physical form of the SIM."
      },
      "Money": {
        "required": [
          "amount",
          "currency",
          "includesVat"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Decimal amount, two places.",
            "example": "2.40"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency code.",
            "example": "GBP"
          },
          "includesVat": {
            "type": "boolean",
            "description": "Whether `amount` includes VAT. Prices are quoted ex VAT.",
            "example": false
          }
        },
        "additionalProperties": false,
        "description": "An amount of money. `amount` is a decimal string so it never loses pennies."
      },
      "Network": {
        "type": "object",
        "properties": {
          "mcc": {
            "type": "string",
            "description": "Mobile country code.",
            "nullable": true,
            "example": "234"
          },
          "mnc": {
            "type": "string",
            "description": "Mobile network code.",
            "nullable": true,
            "example": "15"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Vodafone UK"
          }
        },
        "additionalProperties": false,
        "description": "A mobile network."
      },
      "Plan": {
        "required": [
          "allowanceBytes",
          "billingIntervals",
          "id",
          "monthlyPrice",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Pass as `planId` to change a SIM's plan.",
            "example": "5b0e4f2a-8c1d-4e6f-9a3b-7d2c1e0f4a61"
          },
          "name": {
            "type": "string",
            "example": "1 GB, UK 4-network"
          },
          "coverage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Coverage"
              }
            ],
            "description": "The networks it can use; null when the plan names none.",
            "nullable": true
          },
          "allowanceBytes": {
            "type": "integer",
            "format": "int64",
            "example": 1073741824
          },
          "monthlyPrice": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Your price per month, ex VAT."
          },
          "billingIntervals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BillingInterval"
            },
            "example": [
              "monthly"
            ]
          }
        },
        "additionalProperties": false,
        "description": "A plan your account can use, at your price."
      },
      "PlanChange": {
        "required": [
          "direction",
          "effectiveAt",
          "iccid",
          "toPlan"
        ],
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "example": "8944110068212345678"
          },
          "fromPlan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanSummary"
              }
            ],
            "description": "The plan before the change; null for a SIM that had none.",
            "nullable": true
          },
          "toPlan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "direction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanChangeDirection"
              }
            ],
            "example": "upgrade"
          },
          "effectiveAt": {
            "type": "string",
            "description": "When the new plan takes effect: now for an upgrade, the next renewal for a downgrade.",
            "format": "date-time",
            "example": "2026-09-25T00:00:00Z"
          },
          "message": {
            "type": "string",
            "description": "What we did, in words.",
            "nullable": true,
            "example": "Upgraded to 5 GB, UK 4-network; the difference for the rest of the period is charged now."
          }
        },
        "additionalProperties": false,
        "description": "The outcome of a plan change. Upgrades apply now and are prorated; downgrades apply at the next\nrenewal."
      },
      "PlanChangeDirection": {
        "enum": [
          "upgrade",
          "downgrade"
        ],
        "type": "string",
        "description": "Whether a plan change is an upgrade (now) or a downgrade (at renewal)."
      },
      "PlanChangeRequest": {
        "required": [
          "planId"
        ],
        "type": "object",
        "properties": {
          "planId": {
            "minLength": 1,
            "type": "string",
            "description": "A plan id from `GET /v1/iot/plans`.",
            "example": "9c7a2e14-3b5d-4f60-8e21-6a4b0d9c3f75"
          }
        },
        "additionalProperties": false,
        "description": "The plan to move the SIM to."
      },
      "PlanList": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          }
        },
        "additionalProperties": false,
        "description": "Every plan available to your account. Not paginated."
      },
      "PlanSummary": {
        "required": [
          "allowanceBytes",
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Plan id, as listed by `GET /v1/iot/plans`.",
            "example": "5b0e4f2a-8c1d-4e6f-9a3b-7d2c1e0f4a61"
          },
          "name": {
            "type": "string",
            "example": "1 GB, UK 4-network"
          },
          "allowanceBytes": {
            "type": "integer",
            "description": "Data included each month, in bytes.",
            "format": "int64",
            "example": 1073741824
          }
        },
        "additionalProperties": false,
        "description": "The plan a SIM is on."
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Identifies the kind of problem.",
            "example": "https://partners.netavo.com/api/problems/not-found"
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type.",
            "example": "Not found"
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code.",
            "format": "int32",
            "example": 404
          },
          "detail": {
            "type": "string",
            "description": "What went wrong with this request.",
            "nullable": true,
            "example": "No SIM with ICCID 8944110068212345678 in your account."
          },
          "instance": {
            "type": "string",
            "description": "The request path.",
            "nullable": true,
            "example": "/api/v1/iot/sims/8944110068212345678"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code, the last segment of `type`.",
            "example": "not-found"
          },
          "traceId": {
            "type": "string",
            "description": "Quote this if you contact support.",
            "nullable": true,
            "example": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Per-field messages when `code` is `validation-failed`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An RFC 9457 problem document. `type` and `code` are stable; `title` and\n`detail` are for people."
      },
      "ScheduledPlanChange": {
        "required": [
          "effectiveAt",
          "plan"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanSummary"
          },
          "effectiveAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-01T00:00:00Z"
          }
        },
        "additionalProperties": false,
        "description": "A plan change that takes effect later — a downgrade waits for the next renewal."
      },
      "Session": {
        "required": [
          "bytesDown",
          "bytesUp",
          "iccid",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ses_4f1c2a9e7b3d"
          },
          "iccid": {
            "type": "string",
            "example": "8944110068212345678"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-09-25T06:02:41Z"
          },
          "endedAt": {
            "type": "string",
            "description": "Null while the session is open.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-09-25T08:47:12Z"
          },
          "bytesUp": {
            "type": "integer",
            "description": "Bytes sent by the device.",
            "format": "int64",
            "example": 1843200
          },
          "bytesDown": {
            "type": "integer",
            "description": "Bytes received by the device.",
            "format": "int64",
            "example": 7340032
          },
          "network": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Network"
              }
            ],
            "description": "The network the device was on, when the network reported it.",
            "nullable": true
          },
          "radioAccess": {
            "type": "string",
            "description": "`2G`, `3G`, `4G`, `5G`, `LTE-M` or `NB-IoT`, when the network reported it.",
            "nullable": true,
            "example": "4G"
          },
          "ipAddress": {
            "type": "string",
            "nullable": true,
            "example": "10.64.12.34"
          },
          "endReason": {
            "type": "string",
            "description": "Why the session ended, when the network says.",
            "nullable": true,
            "example": "userRequest"
          }
        },
        "additionalProperties": false,
        "description": "One data session: from the device attaching to the network to it detaching."
      },
      "SessionList": {
        "required": [
          "data",
          "hasMore"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Session"
            },
            "description": "This page of results."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether another page follows.",
            "example": true
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as `startingAfter` to get the next page. Null on the last page.",
            "nullable": true,
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          }
        },
        "additionalProperties": false,
        "description": "A page of results. Follow `nextCursor` for the next one."
      },
      "Sim": {
        "required": [
          "canActivate",
          "canResume",
          "createdAt",
          "formFactor",
          "iccid",
          "organisationId",
          "status",
          "tags",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "description": "The SIM's ICCID. Its identifier everywhere in the API.",
            "example": "8944110068212345678"
          },
          "label": {
            "type": "string",
            "description": "Your name for the SIM or the device it is in.",
            "nullable": true,
            "example": "Car park barrier 3"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Your tags, for filtering.",
            "example": [
              "site:leeds",
              "barrier"
            ]
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SimStatus"
              }
            ],
            "example": "active"
          },
          "suspendedReason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SuspendedReason"
              }
            ],
            "description": "Set when `status` is `paused`, `pendingPause` or `suspended`.",
            "nullable": true,
            "example": null
          },
          "canResume": {
            "type": "boolean",
            "description": "Whether `POST …/resume` would succeed: the SIM is paused by you. False for every other\nstate, including a suspension only we can lift.",
            "example": false
          },
          "formFactor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormFactor"
              }
            ],
            "example": "triSim"
          },
          "plan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PlanSummary"
              }
            ],
            "description": "The plan the SIM is on; null for a SIM with no plan yet.",
            "nullable": true
          },
          "msisdn": {
            "type": "string",
            "description": "The SIM's number, in international format without `+`.",
            "nullable": true,
            "example": "447700900123"
          },
          "imsi": {
            "type": "string",
            "nullable": true,
            "example": "234500012345678"
          },
          "ipAddress": {
            "type": "string",
            "description": "The SIM's private IP address on the network.",
            "nullable": true,
            "example": "10.64.12.34"
          },
          "organisationId": {
            "type": "string",
            "description": "The organisation that owns the SIM. Partners see SIMs across their customers.",
            "format": "uuid",
            "example": "0f8b6c1e-5a2d-4c7e-9b3a-2d1e6f4a7c90"
          },
          "activatedAt": {
            "type": "string",
            "description": "When the SIM was first activated. Billing starts here.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-09-01T08:15:00Z"
          },
          "activationScheduledFor": {
            "type": "string",
            "description": "For a SIM awaiting activation: the day the network activates it. Activation runs on the\nnext working day after it is requested.",
            "format": "date-time",
            "nullable": true,
            "example": null
          },
          "stopsAt": {
            "type": "string",
            "description": "When a ceased SIM stops passing data: the end of the period already paid for. Null unless\na cease is pending.",
            "format": "date-time",
            "nullable": true,
            "example": null
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-08-20T14:02:11Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-09-24T17:40:03Z"
          },
          "canActivate": {
            "type": "boolean",
            "description": "Whether the SIM can be activated now: it has never been started and has a plan.",
            "example": false
          },
          "planStartedAt": {
            "type": "string",
            "description": "When the SIM's current plan started; null before activation.",
            "format": "date-time",
            "nullable": true,
            "example": "2026-09-01T00:00:00Z"
          },
          "scheduledPlanChange": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ScheduledPlanChange"
              }
            ],
            "description": "A downgrade waiting for the next renewal: the plan it moves to and when. Null when none is\nscheduled.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A SIM in your account."
      },
      "SimCeaseRequest": {
        "required": [
          "confirmIccid"
        ],
        "type": "object",
        "properties": {
          "confirmIccid": {
            "minLength": 1,
            "type": "string",
            "description": "Must equal the ICCID in the path.",
            "example": "8944110068212345678"
          },
          "reason": {
            "maxLength": 200,
            "type": "string",
            "description": "Your note, kept in our logs of the SIM's history.",
            "nullable": true,
            "example": "Barrier removed"
          }
        },
        "additionalProperties": false,
        "description": "Confirms which SIM to cease, because ceasing cannot be undone."
      },
      "SimList": {
        "required": [
          "data",
          "hasMore"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sim"
            },
            "description": "This page of results."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether another page follows.",
            "example": true
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as `startingAfter` to get the next page. Null on the last page.",
            "nullable": true,
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          }
        },
        "additionalProperties": false,
        "description": "A page of results. Follow `nextCursor` for the next one."
      },
      "SimStatus": {
        "enum": [
          "inactive",
          "pendingActivation",
          "active",
          "pendingPause",
          "paused",
          "pendingResume",
          "suspended",
          "pendingCease",
          "ceased"
        ],
        "type": "string",
        "description": "Where the SIM is in its lifecycle. `pending…` states mean the network is still applying a\nchange; a notification follows when it takes effect."
      },
      "SimUpdate": {
        "type": "object",
        "properties": {
          "label": {
            "maxLength": 100,
            "type": "string",
            "description": "New label; `\"\"` clears it. Null or left out keeps it (so a client that always sends every\nfield cannot wipe a label by accident).",
            "nullable": true,
            "example": "Car park barrier 3"
          },
          "tags": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Replaces all tags; `[]` removes them. Null or left out keeps them.",
            "nullable": true,
            "example": [
              "site:leeds",
              "barrier"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Fields to change. Leave a field out (or null) to keep it."
      },
      "SimUsage": {
        "required": [
          "allowanceBytes",
          "allowanceReached",
          "history",
          "iccid",
          "percentUsed",
          "periodEnd",
          "periodStart",
          "remainingBytes",
          "updatedAt",
          "usedBytes"
        ],
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "example": "8944110068212345678"
          },
          "periodStart": {
            "type": "string",
            "format": "date-time",
            "example": "2026-09-01T00:00:00Z"
          },
          "periodEnd": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-01T00:00:00Z"
          },
          "allowanceBytes": {
            "type": "integer",
            "format": "int64",
            "example": 1073741824
          },
          "usedBytes": {
            "type": "integer",
            "description": "For the current period, includes sessions still open.",
            "format": "int64",
            "example": 612368384
          },
          "remainingBytes": {
            "type": "integer",
            "format": "int64",
            "example": 461373440
          },
          "percentUsed": {
            "type": "number",
            "format": "double",
            "example": 57
          },
          "allowanceReached": {
            "type": "boolean",
            "description": "True once the SIM has paused for using its whole allowance this period.",
            "example": false
          },
          "updatedAt": {
            "type": "string",
            "description": "When usage was last counted. Up to 15 minutes behind live traffic.",
            "format": "date-time",
            "example": "2026-09-25T09:15:00Z"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimUsagePeriod"
            },
            "description": "Earlier periods, newest first (up to twelve). Only on the current period's response."
          }
        },
        "additionalProperties": false,
        "description": "Data used by one SIM in one allowance period."
      },
      "SimUsagePeriod": {
        "required": [
          "allowanceBytes",
          "periodEnd",
          "periodStart",
          "usedBytes"
        ],
        "type": "object",
        "properties": {
          "periodStart": {
            "type": "string",
            "format": "date-time",
            "example": "2026-08-01T00:00:00Z"
          },
          "periodEnd": {
            "type": "string",
            "format": "date-time",
            "example": "2026-09-01T00:00:00Z"
          },
          "allowanceBytes": {
            "type": "integer",
            "format": "int64",
            "example": 1073741824
          },
          "usedBytes": {
            "type": "integer",
            "format": "int64",
            "example": 803209216
          }
        },
        "additionalProperties": false,
        "description": "A past allowance period's totals."
      },
      "SimUsageSummary": {
        "required": [
          "allowanceBytes",
          "iccid",
          "online",
          "usedBytes"
        ],
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "example": "8944110068212345678"
          },
          "allowanceBytes": {
            "type": "integer",
            "description": "The current allowance period's data allowance; 0 when the SIM has no plan.",
            "format": "int64",
            "example": 1073741824
          },
          "usedBytes": {
            "type": "integer",
            "description": "Data used so far this period, including the session still open.",
            "format": "int64",
            "example": 52428800
          },
          "barredUntil": {
            "type": "string",
            "description": "Set while the SIM is stopped for having used its allowance: when it starts working again\n(the allowance resets). Null when it is not barred.",
            "format": "date-time",
            "nullable": true,
            "example": null
          },
          "online": {
            "type": "boolean",
            "description": "Whether the SIM has a data session open now.",
            "example": true
          }
        },
        "additionalProperties": false,
        "description": "One SIM's data use in its current allowance period, as the fleet usage list reports it."
      },
      "SimUsageSummaryList": {
        "required": [
          "data",
          "hasMore"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimUsageSummary"
            },
            "description": "This page of results."
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether another page follows.",
            "example": true
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as `startingAfter` to get the next page. Null on the last page.",
            "nullable": true,
            "example": "c2ltXzg5NDQxMTAwNjgyMTIzNDU2Nzg"
          }
        },
        "additionalProperties": false,
        "description": "A page of results. Follow `nextCursor` for the next one."
      },
      "SuspendedReason": {
        "enum": [
          "customerPause",
          "allowanceReached",
          "nonPayment",
          "provider"
        ],
        "type": "string",
        "description": "Why a paused or suspended SIM is not passing data. Only `customerPause` can be resumed through\nthe API."
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "An API key from the portal, sent as `Authorization: Bearer <key>`. OAuth 2.1 client-credentials access tokens are accepted the same way.",
        "scheme": "bearer",
        "bearerFormat": "API key"
      }
    }
  },
  "tags": [
    {
      "name": "Plans"
    },
    {
      "name": "SIMs"
    },
    {
      "name": "Usage"
    },
    {
      "name": "eSIM"
    }
  ]
}
