> 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.iot.telia.lt/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.iot.telia.lt/_mcp/server.

# Bulk create endpoints

POST https://iot.telia.lt/api/v2/endpoint/multi
Content-Type: application/json

Create up to 2,000 endpoints in one request.

Unlike [`POST /api/v1/endpoint`](/developers/api/endpoint/create-endpoint), this bulk endpoint handles multiple endpoints safely in a single request without sequential execution constraints between individual endpoints.

Execute bulk operations sequentially - wait for each bulk request to complete before starting the next.

If a `sim` object is provided, the specified SIM is assigned to the endpoint and is activated by default.
To assign the SIM without activating it, explicitly set the `activate` property to `false`; omitting it activates the SIM.

When the SIM is activated:

* The SIM enters Factory Test Mode (FTM) if FTM is enabled for the organization.
* Otherwise, it goes directly to **Activated**.

To override this behavior and explicitly set the SIM's status (for example, skip FTM even if it's enabled for your organization), include a `status` object within the `sim` object.

Telia charges for activated SIMs, even if the endpoint status is set to **Disabled**.

Reference: https://docs.iot.telia.lt/developers/api/endpoint/bulk-create-endpoint

## Authentication

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

## Request

### Body (application/json)

This endpoint expects an object.

- `service_profile` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaServiceProfile, required) — Applies to all endpoints.
- `tariff_profile` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaTariffProfile, required) — Applies to all endpoints.
- `status` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaStatus, required) — Applies to all endpoints.
- `endpoints` (list of ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItems, required)
- `organisation` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaOrganisation, optional) — If provided, it must include a valid `id` (cannot be empty).
- `ip_address_space` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaIpAddressSpace, optional) — Required if any endpoint in the `endpoints` array has an `ip_address`.

## Response

### 201

- `list of ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItems`

## Errors

### 400 Bad Request Error

Request body is malformed

- `any`

### 403 Forbidden Error

User doesn't have permission to bulk create endpoints

- `any`

### 404 Not Found Error

IP address space is full

- `any`

### 422 Unprocessable Entity Error

Appears in one of the following cases: - Service profile is invalid - Tariff profile is invalid - Status is invalid - IP address space is invalid - Organization is invalid - Endpoints are invalid - Both `tags` and `tag_assignments` were provided for an endpoint

- `message` (string, required)
- `error_code` (double, required)
- `error_token` (string, required)
- `errors` (list of ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaErrorsItems, required)

## Types

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaServiceProfile

Applies to all endpoints.

- `id` (double, required)

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaTariffProfile

Applies to all endpoints.

- `id` (double, required)

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaStatus

Applies to all endpoints.

- `id` (double, required)

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItems

Each item represents an endpoint to create.

- `name` (string, optional)
- `tag_assignments` (list of integer, optional) — IDs of existing tags to assign to this endpoint. Unlike `tags`, tags are not created automatically, so every ID must already exist. Mutually exclusive with `tags`. Provide at most one of the two.
- `imei` (string, optional) — Must be unique across all endpoints in the array.
- `imei_lock` (boolean, optional)
- `sim` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItemsSim, optional) — If provided for any endpoint, it must include a valid `id` (cannot be empty).
- `ip_address` (string, optional) — Must be unique across all endpoints in the array. If provided, you must provide `ip_address_space` at the root level.
- `tags` (string, optional, deprecated) — Comma-separated list of tags. Tags that do not exist yet are created. Deprecated. Use `tag_assignments` instead.

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaOrganisation

If provided, it must include a valid `id` (cannot be empty).

- `id` (double, required)

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaIpAddressSpace

Required if any endpoint in the `endpoints` array has an `ip_address`.

- `id` (double, required)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItems

- `id` (double, required)
- `ip_address` (string, required)
- `status` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsStatus, required)
- `name` (string, required)
- `tag_assignments` (list of ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTagAssignmentsItems, required) — Structured tag data with color information.
- `created` (string, required)
- `last_updated` (string, required)
- `imei_lock` (boolean, required)
- `service_profile` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsServiceProfile, required)
- `tariff_profile` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTariffProfile, required)
- `ip_address_space` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsIpAddressSpace, required)
- `tags` (string, required, deprecated) — Comma-separated list of tags. Empty when the endpoint has no tags assigned. Deprecated. Use `tag_assignments` instead.
- `imei` (string, optional)
- `sim` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsSim, optional)
- `imei_with_luhn` (string, optional)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaErrorsItems

- `error_code` (double, optional)
- `error_token` (string, optional)
- `message` (string, optional)

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItemsSim

If provided for any endpoint, it must include a valid `id` (cannot be empty).

- `id` (double, required) — Must be unique across all endpoints in the array.
- `activate` (boolean, optional, default: true) — Whether to activate the SIM after assignment. Defaults to `true`, so the SIM is activated unless you explicitly set this to `false`. If [factory test mode (FTM)](/developers/connectivity/factory-test-mode) is enabled for your organization, an activated SIM enters FTM instead of Activated.
- `status` (ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItemsSimStatus, optional)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsStatus

- `description` (string, required)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTagAssignmentsItems

- `id` (integer, optional) — Tag ID.
- `name` (string, optional) — Tag name.
- `tag_color` (ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTagAssignmentsItemsTagColor, optional) — Color assigned to this tag for UI display.

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsServiceProfile

- `id` (double, required)
- `name` (string, required)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTariffProfile

- `id` (double, required)
- `name` (string, required)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsIpAddressSpace

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsSim

### ApiV2EndpointMultiPostRequestBodyContentApplicationJsonSchemaEndpointsItemsSimStatus

- `id` (double, required)

### ApiV2EndpointMultiPostResponsesContentApplicationJsonSchemaItemsTagAssignmentsItemsTagColor

Color assigned to this tag for UI display.

- `id` (integer, optional) — Color ID.

## Examples

**Request**

```json
{
  "service_profile": {
    "id": 123
  },
  "tariff_profile": {
    "id": 123
  },
  "status": {
    "id": 0
  },
  "endpoints": [
    {
      "name": "Test 1",
      "tag_assignments": [
        1,
        2
      ],
      "imei": "123456789012345",
      "imei_lock": false,
      "sim": {
        "id": 3595575,
        "activate": true
      },
      "ip_address": "127.0.0.1"
    },
    {
      "name": "Test 2",
      "tag_assignments": [
        1,
        2
      ],
      "imei": "987654321",
      "imei_lock": false,
      "sim": {
        "id": 12345,
        "activate": true
      },
      "ip_address": "127.0.0.2"
    }
  ],
  "organisation": {
    "id": 123
  },
  "ip_address_space": {
    "id": 123
  }
}
```

**Response**

```json
[
  {
    "id": 31332699,
    "ip_address": "10.189.227.225",
    "status": {
      "description": "Disabled",
      "id": 1
    },
    "name": "Test 1",
    "tag_assignments": [
      {
        "id": 1,
        "name": "test1",
        "tag_color": {
          "id": 3
        }
      },
      {
        "id": 2,
        "name": "test2",
        "tag_color": {
          "id": 5
        }
      }
    ],
    "created": "2025-01-15T14:44:27.622+0000",
    "last_updated": "2025-01-15T14:44:27.622+0000",
    "imei_lock": false,
    "service_profile": {
      "id": 123,
      "name": "Smart meter"
    },
    "tariff_profile": {
      "id": 3,
      "name": "Domestic only"
    },
    "ip_address_space": {
      "id": 16740
    },
    "tags": "test1,test2",
    "imei": "3561234567890123",
    "sim": {
      "iccid": "8988303000005751718",
      "iccid_with_luhn": "89883030000057517184",
      "id": 3595575,
      "imsi": "295050901198207",
      "msisdn": "423663921003632",
      "sim_profile_type_id": 1
    },
    "imei_with_luhn": "356123456789015"
  },
  {
    "id": 31332700,
    "ip_address": "10.189.227.225",
    "status": {
      "description": "Disabled",
      "id": 1
    },
    "name": "Test 2",
    "tag_assignments": [
      {
        "id": 1,
        "name": "test1",
        "tag_color": {
          "id": 3
        }
      },
      {
        "id": 2,
        "name": "test2",
        "tag_color": {
          "id": 5
        }
      }
    ],
    "created": "2025-01-15T14:44:27.622+0000",
    "last_updated": "2025-01-15T14:44:27.622+0000",
    "imei_lock": false,
    "service_profile": {
      "id": 123,
      "name": "Smart meter"
    },
    "tariff_profile": {
      "id": 3,
      "name": "Domestic only"
    },
    "ip_address_space": {
      "id": 16741
    },
    "tags": "test1,test2",
    "imei": "3561234567890123",
    "sim": {
      "iccid": "8988303000005751719",
      "iccid_with_luhn": "89883030000057517185",
      "id": 12345,
      "imsi": "295050901198208",
      "msisdn": "423663921003633",
      "sim_profile_type_id": 1
    },
    "imei_with_luhn": "356123456789015"
  }
]
```

**SDK Code**

```python Endpoints Created
import requests

url = "https://iot.telia.lt/api/v2/endpoint/multi"

payload = {
    "service_profile": { "id": 123 },
    "tariff_profile": { "id": 123 },
    "status": { "id": 0 },
    "endpoints": [
        {
            "name": "Test 1",
            "tag_assignments": [1, 2],
            "imei": "123456789012345",
            "imei_lock": False,
            "sim": {
                "id": 3595575,
                "activate": True
            },
            "ip_address": "127.0.0.1"
        },
        {
            "name": "Test 2",
            "tag_assignments": [1, 2],
            "imei": "987654321",
            "imei_lock": False,
            "sim": {
                "id": 12345,
                "activate": True
            },
            "ip_address": "127.0.0.2"
        }
    ],
    "organisation": { "id": 123 },
    "ip_address_space": { "id": 123 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Endpoints Created
const url = 'https://iot.telia.lt/api/v2/endpoint/multi';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"service_profile":{"id":123},"tariff_profile":{"id":123},"status":{"id":0},"endpoints":[{"name":"Test 1","tag_assignments":[1,2],"imei":"123456789012345","imei_lock":false,"sim":{"id":3595575,"activate":true},"ip_address":"127.0.0.1"},{"name":"Test 2","tag_assignments":[1,2],"imei":"987654321","imei_lock":false,"sim":{"id":12345,"activate":true},"ip_address":"127.0.0.2"}],"organisation":{"id":123},"ip_address_space":{"id":123}}'
};

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

```go Endpoints Created
package main

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

func main() {

	url := "https://iot.telia.lt/api/v2/endpoint/multi"

	payload := strings.NewReader("{\n  \"service_profile\": {\n    \"id\": 123\n  },\n  \"tariff_profile\": {\n    \"id\": 123\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"endpoints\": [\n    {\n      \"name\": \"Test 1\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"123456789012345\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 3595575,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.1\"\n    },\n    {\n      \"name\": \"Test 2\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"987654321\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 12345,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.2\"\n    }\n  ],\n  \"organisation\": {\n    \"id\": 123\n  },\n  \"ip_address_space\": {\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 Endpoints Created
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v2/endpoint/multi")

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  \"service_profile\": {\n    \"id\": 123\n  },\n  \"tariff_profile\": {\n    \"id\": 123\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"endpoints\": [\n    {\n      \"name\": \"Test 1\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"123456789012345\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 3595575,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.1\"\n    },\n    {\n      \"name\": \"Test 2\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"987654321\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 12345,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.2\"\n    }\n  ],\n  \"organisation\": {\n    \"id\": 123\n  },\n  \"ip_address_space\": {\n    \"id\": 123\n  }\n}"

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

```java Endpoints Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v2/endpoint/multi")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"service_profile\": {\n    \"id\": 123\n  },\n  \"tariff_profile\": {\n    \"id\": 123\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"endpoints\": [\n    {\n      \"name\": \"Test 1\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"123456789012345\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 3595575,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.1\"\n    },\n    {\n      \"name\": \"Test 2\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"987654321\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 12345,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.2\"\n    }\n  ],\n  \"organisation\": {\n    \"id\": 123\n  },\n  \"ip_address_space\": {\n    \"id\": 123\n  }\n}")
  .asString();
```

```php Endpoints Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v2/endpoint/multi', [
  'body' => '{
  "service_profile": {
    "id": 123
  },
  "tariff_profile": {
    "id": 123
  },
  "status": {
    "id": 0
  },
  "endpoints": [
    {
      "name": "Test 1",
      "tag_assignments": [
        1,
        2
      ],
      "imei": "123456789012345",
      "imei_lock": false,
      "sim": {
        "id": 3595575,
        "activate": true
      },
      "ip_address": "127.0.0.1"
    },
    {
      "name": "Test 2",
      "tag_assignments": [
        1,
        2
      ],
      "imei": "987654321",
      "imei_lock": false,
      "sim": {
        "id": 12345,
        "activate": true
      },
      "ip_address": "127.0.0.2"
    }
  ],
  "organisation": {
    "id": 123
  },
  "ip_address_space": {
    "id": 123
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Endpoints Created
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v2/endpoint/multi");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"service_profile\": {\n    \"id\": 123\n  },\n  \"tariff_profile\": {\n    \"id\": 123\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"endpoints\": [\n    {\n      \"name\": \"Test 1\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"123456789012345\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 3595575,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.1\"\n    },\n    {\n      \"name\": \"Test 2\",\n      \"tag_assignments\": [\n        1,\n        2\n      ],\n      \"imei\": \"987654321\",\n      \"imei_lock\": false,\n      \"sim\": {\n        \"id\": 12345,\n        \"activate\": true\n      },\n      \"ip_address\": \"127.0.0.2\"\n    }\n  ],\n  \"organisation\": {\n    \"id\": 123\n  },\n  \"ip_address_space\": {\n    \"id\": 123\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Endpoints Created
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "service_profile": ["id": 123],
  "tariff_profile": ["id": 123],
  "status": ["id": 0],
  "endpoints": [
    [
      "name": "Test 1",
      "tag_assignments": [1, 2],
      "imei": "123456789012345",
      "imei_lock": false,
      "sim": [
        "id": 3595575,
        "activate": true
      ],
      "ip_address": "127.0.0.1"
    ],
    [
      "name": "Test 2",
      "tag_assignments": [1, 2],
      "imei": "987654321",
      "imei_lock": false,
      "sim": [
        "id": 12345,
        "activate": true
      ],
      "ip_address": "127.0.0.2"
    ]
  ],
  "organisation": ["id": 123],
  "ip_address_space": ["id": 123]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v2/endpoint/multi")! 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()
```