> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spenza.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable or disable voice, SMS, and/or data on a SIM

> Enable or disable voice, SMS, and/or data on a SIM's line without
canceling its subscription. Provide at least one of `voice`, `sms`,
`data` — omitting all three is a `400`; each field is independently
optional, so a request can target just one.

Toggling `voice`/`sms` also requires the SIM's active (or
cancel-scheduled) plan to include that capability — a plan with no
voice allowance can't have voice toggled here, regardless of the
operator's own support for it. `data` isn't actionable by any
operator yet: a request containing **only** `data` returns `501`, and
a mixed request (e.g. `voice` + `data`) applies the supported fields
and reports `data` back in a `warnings` array instead of silently
dropping it.

`serviceState.voice`/`.sms` in the response reflect the operator's
**full current state** after the update, not just what this call
changed — persist it directly rather than merging locally.
`serviceState.data` is always `null` today, since no operator can
report it.




## OpenAPI

````yaml /openapi.yaml patch /api/v1.1/sims/{iccid}/service-state
openapi: 3.1.0
info:
  title: Spenza Partner API
  version: 3.0.0
  summary: >-
    Partner API for SIMs, eSIMs, plans, billing, users, groups and numbers —
    v1.1 surface.
  description: >
    The **Spenza Partner API** lets you manage SIMs, eSIMs, plans,
    subscriptions,

    billing, users, phone numbers, teams and device/SIM/user groups
    programmatically.


    All endpoints follow one consistent standard:


    - **Auth** — exchange your API `key` + `secret` for a bearer token, then
    send
      `Authorization: Bearer <token>` on every request.
    - **Envelopes** — success responses are `{ success, data, meta? }`; errors
    are
      `{ success: false, error: { code, message, details? } }`.
    - **Pagination** — list endpoints accept `page` (1-indexed) and `pageSize`
      (max 100); totals are returned in `meta`.
    - **Idempotency** — many write endpoints honor an optional `Idempotency-Key`
      request header so a retried call replays the original result instead of
      repeating the side effect.
    - **Async operations** — a handful of endpoints (eSIM provisioning, port-in,
      the `/api/v3/...` purchase variants, top-up) return `202` (`201` for
      top-up) with a `transactionId` + `statusEndpoint` instead of the finished
      resource. Poll
      `GET /api/v3/transactions/{transactionId}` (no auth required) until the
      transaction reaches a terminal status.

    One resource — **port-in submission** — is a documented exception: it lives
    at

    `POST /api/v3/port-in`, requires an Admin-tier account role rather than just
    a

    valid bearer token, and is **not** on the standard envelope (see that
    operation's

    description for its exact response shape).
  contact:
    name: Spenza API Support
    email: support@spenza.com
    url: https://spenza.com
  license:
    name: Proprietary
    url: https://spenza.com/terms
  x-logo:
    url: https://spenza.com/logo.png
    altText: Spenza
servers:
  - url: https://api.spenza.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange API credentials for a bearer token.
  - name: SIMs
    description: List, inspect, assign and manage SIMs.
  - name: Subscriptions
    description: Plan subscriptions attached to SIMs.
  - name: Plans & Catalog
    description: Purchasable plans and SIM products.
  - name: eSIM
    description: Provision eSIMs and fetch activation QR / install status.
  - name: Billing
    description: Invoices, credit balance and top-ups.
  - name: Users
    description: End users (employees) on your account that SIMs/devices are assigned to.
  - name: Orders & Transactions
    description: Order history and financial transactions.
  - name: Numbers & Port-in
    description: Check port-in eligibility and port existing numbers into Spenza.
  - name: Messaging
    description: Send outbound SMS from a provisioned number.
  - name: Webhooks
    description: Register endpoints for operator SMS/voice events and inspect deliveries.
  - name: Notifications
    description: In-account notifications and delivery preferences.
  - name: Device Groups
    description: Organize devices into named groups with spend/data limits.
  - name: SIM Groups
    description: Organize SIMs into named groups with spend/data limits.
  - name: User Groups
    description: Organize users (departments) into named groups with spend/data limits.
  - name: Devices
    description: The device catalog (phones/tablets) and their assignment to users.
  - name: Team Members
    description: Admins who manage your Spenza account (distinct from Users/end-users).
  - name: Async Status
    description: Universal status poll for any asynchronous (v3) operation.
paths:
  /api/v1.1/sims/{iccid}/service-state:
    patch:
      tags:
        - SIMs
      summary: Enable or disable voice, SMS, and/or data on a SIM
      description: |
        Enable or disable voice, SMS, and/or data on a SIM's line without
        canceling its subscription. Provide at least one of `voice`, `sms`,
        `data` — omitting all three is a `400`; each field is independently
        optional, so a request can target just one.

        Toggling `voice`/`sms` also requires the SIM's active (or
        cancel-scheduled) plan to include that capability — a plan with no
        voice allowance can't have voice toggled here, regardless of the
        operator's own support for it. `data` isn't actionable by any
        operator yet: a request containing **only** `data` returns `501`, and
        a mixed request (e.g. `voice` + `data`) applies the supported fields
        and reports `data` back in a `warnings` array instead of silently
        dropping it.

        `serviceState.voice`/`.sms` in the response reflect the operator's
        **full current state** after the update, not just what this call
        changed — persist it directly rather than merging locally.
        `serviceState.data` is always `null` today, since no operator can
        report it.
      operationId: updateLineServiceState
      parameters:
        - $ref: '#/components/parameters/Iccid'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: At least one field is required.
              properties:
                voice:
                  type: boolean
                  description: Enable/disable voice on this line.
                  example: true
                sms:
                  type: boolean
                  description: Enable/disable SMS on this line.
                  example: true
                data:
                  type: boolean
                  description: >-
                    Not yet supported by any operator — accepted for forward
                    compatibility.
                  example: false
      responses:
        '200':
          description: Service state updated (or partially — see `warnings`).
          content:
            application/json:
              examples:
                full:
                  value:
                    success: true
                    data:
                      iccid: '8901260853182965429'
                      serviceState:
                        voice: true
                        sms: true
                        data: null
                partial:
                  value:
                    success: true
                    data:
                      iccid: '8901260853182965429'
                      serviceState:
                        voice: true
                        sms: true
                        data: null
                      warnings:
                        - >-
                          data is not supported by this operator yet and was not
                          changed
        '400':
          description: >-
            No fields provided, the SIM has no assigned phone number yet, or the
            active plan doesn't include a requested capability.
          content:
            application/json:
              examples:
                noFields:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Provide at least one of voice
                      sms: null
                      or data to update.: null
                noNumber:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: This SIM doesn't have an assigned phone number yet.
                voiceNotIncluded:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: This plan does not include voice; cannot toggle it.
                smsNotIncluded:
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: This plan does not include sms; cannot toggle it.
        '404':
          description: SIM not found, or no active/cancel-scheduled subscription on it.
          content:
            application/json:
              examples:
                sim:
                  value:
                    success: false
                    error:
                      code: SIM_NOT_FOUND
                      message: We couldn't find a SIM with that ICCID on your account.
                subscription:
                  value:
                    success: false
                    error:
                      code: SUBSCRIPTION_NOT_FOUND
                      message: >-
                        No active or cancel-scheduled subscription found for
                        this SIM.
        '409':
          $ref: '#/components/responses/IdempotencyKeyReused'
        '500':
          description: The operator didn't confirm the update.
          content:
            application/json:
              example:
                success: false
                error:
                  code: INTERNAL_ERROR
                  message: >-
                    The operation failed. Contact support with this transaction
                    ID for details.
        '501':
          description: >-
            This voice/SMS/data control isn't available for the SIM's operator —
            including the "only `data` was requested" case, since no operator
            supports it yet.
          content:
            application/json:
              example:
                success: false
                error:
                  code: NOT_IMPLEMENTED
                  message: >-
                    This voice/SMS/data control is not available for this
                    operator yet.
components:
  parameters:
    Iccid:
      name: iccid
      in: path
      required: true
      description: SIM ICCID.
      schema:
        type: string
        example: '8901260853182965429'
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >
        Any string unique to this logical request. On a retry with the same key

        and the same request body, the original response is replayed verbatim

        (with an `Idempotency-Replayed: true` response header) instead of the

        action repeating. Reusing the key with a **different** body or on a

        different route returns `409 IDEMPOTENCY_KEY_REUSED`. A replay attempted

        while the original call is still in flight returns `409 CONFLICT`.

        Optional — omit it and the endpoint behaves exactly as it would
        otherwise.
      schema:
        type: string
        example: a1b2c3d4-idem-key-001
  responses:
    IdempotencyKeyReused:
      description: >-
        The `Idempotency-Key` header was reused with a different request body,
        or against a different route.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              code: IDEMPOTENCY_KEY_REUSED
              message: >-
                This request was already submitted with different details —
                please use a new idempotency key.
  schemas:
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: SIM_NOT_FOUND
            message:
              type: string
              example: We couldn't find a SIM with that ICCID on your account.
            details:
              description: >-
                Present on some 4xx errors (for example a list of missing
                fields). Always absent on 5xx.
              type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token obtained from `POST /api/v1.1/auth/token`.

````