> 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.

# Update an endpoint

PATCH https://iot.telia.lt/api/v1/endpoint/{endpoint_id}
Content-Type: application/json

Updates the details of an endpoint.

Execute this operation sequentially - wait for each request to complete before starting the next.

For bulk updates, use [`PATCH /api/v2/endpoint/multi`](/developers/api/endpoint/bulk-update-endpoint) instead (supports up to 2,000 endpoints).

Telia charges for activated SIMs, even if the endpoint `status` is set to **Disabled**.
To avoid accruing unexpected charges, update the SIM `status` to **Suspended** (`"id": 2`).

Reference: https://docs.iot.telia.lt/developers/api/endpoint/endpoint-by-id-patch

## 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

### Path parameters

- `endpoint_id` (integer, required) — Numeric ID of an endpoint

### Body (application/json)

This endpoint expects an object.

- `service_profile` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaServiceProfile, required)
- `tariff_profile` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaTariffProfile, required)
- `status` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaStatus, required)
- `ip_address_space` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaIpAddressSpace, required)
- `sim` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaSim, required)
- `name` (string, required)
- `imei` (string, required)
- `imei_lock` (boolean, required)
- `ip_address` (string, required)
- `tag_assignments` (list of integer, optional) — IDs of existing tags replacing the tags currently assigned to the endpoint. An empty array removes all tags. Mutually exclusive with `tags`. Provide at most one of the two.
- `tags` (string, optional, nullable, deprecated) — Comma-separated tag names replacing the tags currently assigned to the endpoint. Tags that don't exist yet are created, an empty string removes all tags. Sending `null` leaves the current tags unchanged, the same as omitting the field. Deprecated. Use `tag_assignments` instead.

## Response

### 204

Endpoint updated successfully

## Errors

### 400 Bad Request Error

Request body is malformed

- `any`

### 403 Forbidden Error

User doesn't have permission to bulk update endpoints

- `any`

### 404 Not Found Error

Appears in one of the following cases: - IP address space isn't found - 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 - IP address is invalid - SIM is invalid - Both `tags` and `tag_assignments` were provided

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

## Types

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaServiceProfile

- `id` (double, required)

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaTariffProfile

- `id` (double, required)

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaStatus

- `id` (double, required)

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaIpAddressSpace

- `id` (double, required)

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaSim

- `id` (double, required)
- `status` (ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaSimStatus, required)

### ApiV1EndpointEndpointIdPatchResponsesContentApplicationJsonSchemaErrorsItems

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

### ApiV1EndpointEndpointIdPatchRequestBodyContentApplicationJsonSchemaSimStatus

- `id` (double, required)

## Examples

**Request**

```json
{
  "service_profile": {
    "id": 2
  },
  "tariff_profile": {
    "id": 3
  },
  "status": {
    "id": 0
  },
  "ip_address_space": {
    "id": 1
  },
  "sim": {
    "id": 1234567,
    "status": {
      "id": 1
    }
  },
  "name": "test",
  "imei": "1234567890",
  "imei_lock": false,
  "ip_address": "127.0.0.1",
  "tag_assignments": [
    1,
    2
  ]
}
```

**SDK Code**

```python UpdateEndpointExample
import requests

url = "https://iot.telia.lt/api/v1/endpoint/1"

payload = {
    "service_profile": { "id": 2 },
    "tariff_profile": { "id": 3 },
    "status": { "id": 0 },
    "ip_address_space": { "id": 1 },
    "sim": {
        "id": 1234567,
        "status": { "id": 1 }
    },
    "name": "test",
    "imei": "1234567890",
    "imei_lock": False,
    "ip_address": "127.0.0.1",
    "tag_assignments": [1, 2]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript UpdateEndpointExample
const url = 'https://iot.telia.lt/api/v1/endpoint/1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"service_profile":{"id":2},"tariff_profile":{"id":3},"status":{"id":0},"ip_address_space":{"id":1},"sim":{"id":1234567,"status":{"id":1}},"name":"test","imei":"1234567890","imei_lock":false,"ip_address":"127.0.0.1","tag_assignments":[1,2]}'
};

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

```go UpdateEndpointExample
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/endpoint/1"

	payload := strings.NewReader("{\n  \"service_profile\": {\n    \"id\": 2\n  },\n  \"tariff_profile\": {\n    \"id\": 3\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"ip_address_space\": {\n    \"id\": 1\n  },\n  \"sim\": {\n    \"id\": 1234567,\n    \"status\": {\n      \"id\": 1\n    }\n  },\n  \"name\": \"test\",\n  \"imei\": \"1234567890\",\n  \"imei_lock\": false,\n  \"ip_address\": \"127.0.0.1\",\n  \"tag_assignments\": [\n    1,\n    2\n  ]\n}")

	req, _ := http.NewRequest("PATCH", 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 UpdateEndpointExample
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/endpoint/1")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"service_profile\": {\n    \"id\": 2\n  },\n  \"tariff_profile\": {\n    \"id\": 3\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"ip_address_space\": {\n    \"id\": 1\n  },\n  \"sim\": {\n    \"id\": 1234567,\n    \"status\": {\n      \"id\": 1\n    }\n  },\n  \"name\": \"test\",\n  \"imei\": \"1234567890\",\n  \"imei_lock\": false,\n  \"ip_address\": \"127.0.0.1\",\n  \"tag_assignments\": [\n    1,\n    2\n  ]\n}"

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

```java UpdateEndpointExample
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://iot.telia.lt/api/v1/endpoint/1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"service_profile\": {\n    \"id\": 2\n  },\n  \"tariff_profile\": {\n    \"id\": 3\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"ip_address_space\": {\n    \"id\": 1\n  },\n  \"sim\": {\n    \"id\": 1234567,\n    \"status\": {\n      \"id\": 1\n    }\n  },\n  \"name\": \"test\",\n  \"imei\": \"1234567890\",\n  \"imei_lock\": false,\n  \"ip_address\": \"127.0.0.1\",\n  \"tag_assignments\": [\n    1,\n    2\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://iot.telia.lt/api/v1/endpoint/1', [
  'body' => '{
  "service_profile": {
    "id": 2
  },
  "tariff_profile": {
    "id": 3
  },
  "status": {
    "id": 0
  },
  "ip_address_space": {
    "id": 1
  },
  "sim": {
    "id": 1234567,
    "status": {
      "id": 1
    }
  },
  "name": "test",
  "imei": "1234567890",
  "imei_lock": false,
  "ip_address": "127.0.0.1",
  "tag_assignments": [
    1,
    2
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp UpdateEndpointExample
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/endpoint/1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"service_profile\": {\n    \"id\": 2\n  },\n  \"tariff_profile\": {\n    \"id\": 3\n  },\n  \"status\": {\n    \"id\": 0\n  },\n  \"ip_address_space\": {\n    \"id\": 1\n  },\n  \"sim\": {\n    \"id\": 1234567,\n    \"status\": {\n      \"id\": 1\n    }\n  },\n  \"name\": \"test\",\n  \"imei\": \"1234567890\",\n  \"imei_lock\": false,\n  \"ip_address\": \"127.0.0.1\",\n  \"tag_assignments\": [\n    1,\n    2\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift UpdateEndpointExample
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "service_profile": ["id": 2],
  "tariff_profile": ["id": 3],
  "status": ["id": 0],
  "ip_address_space": ["id": 1],
  "sim": [
    "id": 1234567,
    "status": ["id": 1]
  ],
  "name": "test",
  "imei": "1234567890",
  "imei_lock": false,
  "ip_address": "127.0.0.1",
  "tag_assignments": [1, 2]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/endpoint/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```