> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

# Trigger SIM operation

POST https://cdn.emnify.net/api/v1/sim/operation
Content-Type: application/json

Trigger a SIM operation.


Reference: https://docs.emnify.com/developers/api/sim-operation/trigger-sim-operation

## Authentication

- `Authorization` header (bearer token, required) — An auth_token should be provided to authenticate a session. To obtain an auth_token, see the POST request to `/api/v1/authenticate`.

## Request

### Body (application/json)

This endpoint expects a SimOperationRequest.

- `action` (SimOperationActionRef, required)
- `target` (list of SimOperationRequestTarget, required)
- `product` (ProductRef, optional)

## Response

### 201

Created, SIM operation scheduled

- `id` (string, required) — Operation ID
- `action` (OperationAction, required)
- `status` (OperationStatus, required)
- `creation_date` (string, required)
- `last_updated_at` (string, required)
- `product` (ProductRef, optional)
- `finalization_date` (string, optional, nullable)
- `target` (list of SimOperationResponseTarget, optional)
- `total_count` (integer, optional)
- `failed_count` (integer, optional)
- `success_count` (integer, optional)
- `error` (list of SimOperationResponseErrorItems, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `status_code` (integer, required)
- `message` (string, required)

### 401 Unauthorized Error

Unauthorized

- `status_code` (integer, required)
- `message` (string, required)

### 403 Forbidden Error

Forbidden

- `status_code` (integer, required)
- `message` (string, required)

### 404 Not Found Error

Not Found

- `status_code` (integer, required)
- `message` (string, required)

### 500 Internal Server Error

Internal Server Error

- `status_code` (integer, required)
- `message` (string, required)

## Types

### SimOperationActionRef

- `id` (integer, required)

### SimOperationRequestTarget

- `sim` (SimOperationRequestTargetSim, optional)
- `eid` (string, optional)

### ProductRef

- `id` (integer, required)

### OperationAction

- `id` (integer, required)
- `description` (string, required)

### OperationStatus

- `id` (integer, required)
- `description` (string, required)

### SimOperationResponseTarget

- `sim` (SimOperationResponseTargetSim, required)
- `eid` (string, optional)

### SimOperationResponseErrorItems

- `sim` (SimOperationResponseErrorItemsSim, required)
- `message` (string, required)
- `eid` (string, optional)
- `iccid_with_luhn` (string, optional) — Full ICCID including the Luhn check digit

### SimOperationRequestTargetSim

- `id` (integer, required)

### SimOperationResponseTargetSim

- `id` (integer, required)

### SimOperationResponseErrorItemsSim

- `id` (integer, required)

## Examples

### Link by SIM

**Request**

```json
{
  "action": {
    "id": 1
  },
  "target": [
    {
      "sim": {
        "id": 7372275
      },
      "eid": "89123247065724874780755570224832"
    }
  ]
}
```

**Response**

```json
{
  "id": "58f8f8f8-aaaa-bbbb-cccc-111111111111",
  "action": {
    "id": 1,
    "description": "Link by SIM"
  },
  "status": {
    "id": 1,
    "description": "Processing"
  },
  "creation_date": "2025-10-01T09:00:00.000Z",
  "last_updated_at": "2025-10-01T09:00:00.000Z",
  "target": [
    {
      "sim": {
        "id": 7372275
      },
      "eid": "89123247065724874780755570224832"
    }
  ],
  "total_count": 1,
  "failed_count": 0,
  "success_count": 0
}
```

**SDK Code**

```python Link by SIM
import requests

url = "https://cdn.emnify.net/api/v1/sim/operation"

payload = {
    "action": { "id": 1 },
    "target": [
        {
            "sim": { "id": 7372275 },
            "eid": "89123247065724874780755570224832"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Link by SIM
const url = 'https://cdn.emnify.net/api/v1/sim/operation';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":{"id":1},"target":[{"sim":{"id":7372275},"eid":"89123247065724874780755570224832"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Link by SIM
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/sim/operation"

	payload := strings.NewReader("{\n  \"action\": {\n    \"id\": 1\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      },\n      \"eid\": \"89123247065724874780755570224832\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Link by SIM
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/sim/operation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": {\n    \"id\": 1\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      },\n      \"eid\": \"89123247065724874780755570224832\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Link by SIM
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/sim/operation")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": {\n    \"id\": 1\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      },\n      \"eid\": \"89123247065724874780755570224832\"\n    }\n  ]\n}")
  .asString();
```

```php Link by SIM
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/sim/operation', [
  'body' => '{
  "action": {
    "id": 1
  },
  "target": [
    {
      "sim": {
        "id": 7372275
      },
      "eid": "89123247065724874780755570224832"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Link by SIM
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/sim/operation");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": {\n    \"id\": 1\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      },\n      \"eid\": \"89123247065724874780755570224832\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Link by SIM
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": ["id": 1],
  "target": [
    [
      "sim": ["id": 7372275],
      "eid": "89123247065724874780755570224832"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/sim/operation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Link by Product

**Request**

```json
{
  "action": {
    "id": 2
  },
  "target": [
    {
      "eid": "89634247065724874780755570224832"
    }
  ],
  "product": {
    "id": 123
  }
}
```

**Response**

```json
{
  "id": "88f8f8f8-aaaa-bbbb-cccc-222222222222",
  "action": {
    "id": 2,
    "description": "Link by Product"
  },
  "status": {
    "id": 1,
    "description": "Processing"
  },
  "creation_date": "2025-10-01T09:00:00.000Z",
  "last_updated_at": "2025-10-01T09:00:00.000Z",
  "product": {
    "id": 123
  },
  "target": [
    {
      "sim": {
        "id": 7372275
      },
      "eid": "89123247065724874780755570224832"
    }
  ],
  "total_count": 1,
  "failed_count": 0,
  "success_count": 0
}
```

**SDK Code**

```python Link by Product
import requests

url = "https://cdn.emnify.net/api/v1/sim/operation"

payload = {
    "action": { "id": 2 },
    "target": [{ "eid": "89634247065724874780755570224832" }],
    "product": { "id": 123 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Link by Product
const url = 'https://cdn.emnify.net/api/v1/sim/operation';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":{"id":2},"target":[{"eid":"89634247065724874780755570224832"}],"product":{"id":123}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Link by Product
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/sim/operation"

	payload := strings.NewReader("{\n  \"action\": {\n    \"id\": 2\n  },\n  \"target\": [\n    {\n      \"eid\": \"89634247065724874780755570224832\"\n    }\n  ],\n  \"product\": {\n    \"id\": 123\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Link by Product
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/sim/operation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": {\n    \"id\": 2\n  },\n  \"target\": [\n    {\n      \"eid\": \"89634247065724874780755570224832\"\n    }\n  ],\n  \"product\": {\n    \"id\": 123\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Link by Product
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/sim/operation")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": {\n    \"id\": 2\n  },\n  \"target\": [\n    {\n      \"eid\": \"89634247065724874780755570224832\"\n    }\n  ],\n  \"product\": {\n    \"id\": 123\n  }\n}")
  .asString();
```

```php Link by Product
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/sim/operation', [
  'body' => '{
  "action": {
    "id": 2
  },
  "target": [
    {
      "eid": "89634247065724874780755570224832"
    }
  ],
  "product": {
    "id": 123
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Link by Product
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/sim/operation");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": {\n    \"id\": 2\n  },\n  \"target\": [\n    {\n      \"eid\": \"89634247065724874780755570224832\"\n    }\n  ],\n  \"product\": {\n    \"id\": 123\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Link by Product
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": ["id": 2],
  "target": [["eid": "89634247065724874780755570224832"]],
  "product": ["id": 123]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/sim/operation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Unlink by SIM

**Request**

```json
{
  "action": {
    "id": 3
  },
  "target": [
    {
      "sim": {
        "id": 7372275
      }
    }
  ]
}
```

**Response**

```json
{
  "id": "58f8f8f8-aaaa-bbbb-cccc-111111111111",
  "action": {
    "id": 3,
    "description": "Unlink SIM"
  },
  "status": {
    "id": 1,
    "description": "Processing"
  },
  "creation_date": "2025-10-01T09:00:00.000Z",
  "last_updated_at": "2025-10-01T09:00:00.000Z",
  "target": [
    {
      "sim": {
        "id": 7372275
      }
    }
  ],
  "total_count": 1,
  "failed_count": 0,
  "success_count": 0
}
```

**SDK Code**

```python Unlink by SIM
import requests

url = "https://cdn.emnify.net/api/v1/sim/operation"

payload = {
    "action": { "id": 3 },
    "target": [{ "sim": { "id": 7372275 } }]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Unlink by SIM
const url = 'https://cdn.emnify.net/api/v1/sim/operation';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":{"id":3},"target":[{"sim":{"id":7372275}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Unlink by SIM
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/sim/operation"

	payload := strings.NewReader("{\n  \"action\": {\n    \"id\": 3\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Unlink by SIM
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/sim/operation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": {\n    \"id\": 3\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Unlink by SIM
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/sim/operation")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": {\n    \"id\": 3\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      }\n    }\n  ]\n}")
  .asString();
```

```php Unlink by SIM
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/sim/operation', [
  'body' => '{
  "action": {
    "id": 3
  },
  "target": [
    {
      "sim": {
        "id": 7372275
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Unlink by SIM
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/sim/operation");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": {\n    \"id\": 3\n  },\n  \"target\": [\n    {\n      \"sim\": {\n        \"id\": 7372275\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unlink by SIM
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": ["id": 3],
  "target": [["sim": ["id": 7372275]]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/sim/operation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```