Skip to main content
PATCH
/
sim_cards
/
{id}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const simCard = await client.simCards.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58');

console.log(simCard.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
sim_card = client.sim_cards.update(
sim_card_id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
)
print(sim_card.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
simCard, err := client.SimCards.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.SimCardUpdateParams{
SimCard: telnyx.SimCardParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", simCard.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.simcards.SimCard;
import com.telnyx.sdk.models.simcards.SimCardUpdateParams;
import com.telnyx.sdk.models.simcards.SimCardUpdateResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

SimCardUpdateParams params = SimCardUpdateParams.builder()
.simCardId("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
.simCard(SimCard.builder().build())
.build();
SimCardUpdateResponse simCard = client.simCards().update(params);
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

sim_card = telnyx.sim_cards.update("6a09cdc3-8948-47f0-aa62-74ac943d6c58")

puts(sim_card)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$simCard = $client->simCards->update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
authorizedImeis: ['106516771852751', '534051870479563', '508821468377961'],
dataLimit: ['amount' => '2048.1', 'unit' => 'MB'],
simCardGroupID: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
status: [],
tags: ['personal', 'customers', 'active-customers'],
);

var_dump($simCard);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx sim-cards update \
--api-key 'My API Key' \
--sim-card-id 6a09cdc3-8948-47f0-aa62-74ac943d6c58
curl --request PATCH \
--url https://api.telnyx.com/v2/sim_cards/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": {},
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"tags": [
"personal",
"customers",
"active-customers"
],
"authorized_imeis": [
"106516771852751",
"534051870479563",
"508821468377961"
],
"data_limit": {
"amount": "2048.1",
"unit": "MB"
}
}
'
{
  "data": {
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "record_type": "sim_card",
    "status": {
      "value": "enabled",
      "reason": "The SIM card is active, ready to connect to networks and consume data."
    },
    "type": "physical",
    "iccid": "89310410106543789301",
    "imsi": "081932214823362973",
    "msisdn": "+13109976224",
    "sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "tags": [
      "personal",
      "customers",
      "active-customers"
    ],
    "authorized_imeis": [
      "106516771852751",
      "534051870479563",
      "508821468377961"
    ],
    "current_imei": "457032284023794",
    "data_limit": {
      "amount": "2048.1",
      "unit": "MB"
    },
    "current_billing_period_consumed_data": {
      "amount": "2049.0",
      "unit": "MB"
    },
    "actions_in_progress": true,
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "ipv4": "192.168.0.0",
    "ipv6": "2001:cdba:0000:0000:0000:0000:3257:9652",
    "current_device_location": {
      "latitude": "41.143",
      "longitude": "-8.605",
      "accuracy": 1250,
      "accuracy_unit": "m"
    },
    "current_mnc": "260",
    "current_mcc": "410",
    "live_data_session": "connected",
    "pin_puk_codes": {
      "pin1": "1234",
      "pin2": "5678",
      "puk1": "12345678",
      "puk2": "87654321"
    },
    "esim_installation_status": "released",
    "version": "4.3",
    "resources_with_in_progress_actions": [],
    "eid": null,
    "voice_enabled": false
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Identifies the SIM.

Example:

"6a09cdc3-8948-47f0-aa62-74ac943d6c58"

Body

application/json
status
object
sim_card_group_id
string<uuid>

The group SIMCardGroup identification. This attribute can be null when it's present in an associated resource.

Example:

"6a09cdc3-8948-47f0-aa62-74ac943d6c58"

tags
string[]

Searchable tags associated with the SIM card

Example:
["personal", "customers", "active-customers"]
authorized_imeis
string[] | null

List of IMEIs authorized to use a given SIM card.

Example:
[
"106516771852751",
"534051870479563",
"508821468377961"
]
data_limit
object

The SIM card individual data limit configuration.

Response

Successful response

data
SIMCard · object