> 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 service profile

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

Update a service profile with a given id.

Editable fields:

* `name` (String optional)
* `description` (String optional)
* `allowed_3g` (boolean optional)
* `allowed_4g` (boolean optional). Allows or restricts connectivity for 4G/LTE and LTE-M networks.
* `allowed_nb_iot` (boolean optional)
* **DEPRECATED** `apply_quota` (boolean optional, defaults to false). Use `apply_data_quota` instead. Will be ignored if `apply_data_quota` is present.
* `apply_data_quota` (boolean optional, defaults to false)
* `apply_sms_quota` (boolean optional, defaults to false)
* `retail` (boolean optional, defaults to false)
* `sms_p2p_int` (boolean optional, defaults to true)
* `sms_p2p_ext` (boolean optional, defaults to true)
* **DEPRECATED** `prepaid` (boolean optional, defaults to false)
* `nipdp` (boolean optional, defaults to false)
* `api_callback` (object optional) can be emptied by setting the id to null ("api\_callback":\{"id":null})
* `api_secret` (object optional) can be emptied by setting the id to null ("api\_secret":\{"id":null})
* `moc_callback` (object optional) can be emptied by setting the id to null ("moc\_callback":\{"id":null})
* `esme_interface_type` (object optional)
* `breakout_region` (object optional)
* `dns` (object optional)

Reference: https://docs.iot.telia.lt/developers/api/service-profiles/service-profile-by-profile-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

- `profile_id` (double, required) — The Numeric ID of a Service Profile

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional)
- `description` (string, optional)
- `allowed_3g` (boolean, optional)
- `allowed_4g` (boolean, optional)
- `allowed_nb_iot` (boolean, optional)
- `apply_sms_quota` (boolean, optional)
- `apply_data_quota` (boolean, optional)
- `retail` (boolean, optional)
- `sms_p2p_int` (boolean, optional)
- `sms_p2p_ext` (boolean, optional)
- `prepaid` (boolean, optional)
- `nipdp` (boolean, optional)
- `api_callback` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaApiCallback, optional)
- `api_secret` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaApiSecret, optional)
- `moc_callback` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaMocCallback, optional)
- `esme_interface_type` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaEsmeInterfaceType, optional)
- `breakout_region` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaBreakoutRegion, optional)
- `dns` (ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaDns, optional)

## Response

### 201

Successfully updated the Service Profile

## Errors

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

## Types

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaApiCallback

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaApiSecret

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaMocCallback

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaEsmeInterfaceType

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaBreakoutRegion

### ApiV1ServiceProfileProfileIdPatchRequestBodyContentApplicationJsonSchemaDns

## Examples

### Update DNS config

**Request**

```json
{
  "dns": {
    "id": 4
  }
}
```

**Response**

```json
{
  "dns": {
    "id": 4
  },
  "service_profile_id": "123"
}
```

**SDK Code**

```python Update DNS config
import requests

url = "https://iot.telia.lt/api/v1/service_profile/1.1"

payload = { "dns": { "id": 4 } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update DNS config
const url = 'https://iot.telia.lt/api/v1/service_profile/1.1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"dns":{"id":4}}'
};

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

```go Update DNS config
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/service_profile/1.1"

	payload := strings.NewReader("{\n  \"dns\": {\n    \"id\": 4\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 Update DNS config
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/service_profile/1.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  \"dns\": {\n    \"id\": 4\n  }\n}"

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

```java Update DNS config
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://iot.telia.lt/api/v1/service_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"dns\": {\n    \"id\": 4\n  }\n}")
  .asString();
```

```php Update DNS config
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://iot.telia.lt/api/v1/service_profile/1.1', [
  'body' => '{
  "dns": {
    "id": 4
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Update DNS config
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/service_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"dns\": {\n    \"id\": 4\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update DNS config
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["dns": ["id": 4]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/service_profile/1.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()
```

### Remove DNS config

**Request**

```json
{
  "dns": {
    "id": null
  }
}
```

**Response**

```json
{
  "dns": {
    "id": 4
  },
  "service_profile_id": "123"
}
```

**SDK Code**

```python Remove DNS config
import requests

url = "https://iot.telia.lt/api/v1/service_profile/1.1"

payload = { "dns": { "id": None } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove DNS config
const url = 'https://iot.telia.lt/api/v1/service_profile/1.1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"dns":{"id":null}}'
};

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

```go Remove DNS config
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/service_profile/1.1"

	payload := strings.NewReader("{\n  \"dns\": {\n    \"id\": null\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 Remove DNS config
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/service_profile/1.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  \"dns\": {\n    \"id\": null\n  }\n}"

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

```java Remove DNS config
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://iot.telia.lt/api/v1/service_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"dns\": {\n    \"id\": null\n  }\n}")
  .asString();
```

```php Remove DNS config
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://iot.telia.lt/api/v1/service_profile/1.1', [
  'body' => '{
  "dns": {
    "id": null
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Remove DNS config
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/service_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"dns\": {\n    \"id\": null\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove DNS config
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/service_profile/1.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()
```

### Update all properties

**Request**

```json
{
  "name": "3G / 4G Disabled",
  "description": "new description",
  "allowed_3g": false,
  "allowed_4g": false,
  "allowed_nb_iot": false,
  "apply_sms_quota": false,
  "apply_data_quota": false,
  "retail": false,
  "sms_p2p_int": true,
  "sms_p2p_ext": true,
  "nipdp": false,
  "api_callback": {
    "id": 1
  },
  "api_secret": {
    "id": 1
  },
  "moc_callback": {
    "id": 2
  },
  "esme_interface_type": {
    "id": 3
  },
  "breakout_region": {
    "id": 3
  },
  "dns": {
    "id": 4
  }
}
```

**Response**

```json
{
  "dns": {
    "id": 4
  },
  "service_profile_id": "123"
}
```

**SDK Code**

```python Update all properties
import requests

url = "https://iot.telia.lt/api/v1/service_profile/1.1"

payload = {
    "name": "3G / 4G Disabled",
    "description": "new description",
    "allowed_3g": False,
    "allowed_4g": False,
    "allowed_nb_iot": False,
    "apply_sms_quota": False,
    "apply_data_quota": False,
    "retail": False,
    "sms_p2p_int": True,
    "sms_p2p_ext": True,
    "nipdp": False,
    "api_callback": { "id": 1 },
    "api_secret": { "id": 1 },
    "moc_callback": { "id": 2 },
    "esme_interface_type": { "id": 3 },
    "breakout_region": { "id": 3 },
    "dns": { "id": 4 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update all properties
const url = 'https://iot.telia.lt/api/v1/service_profile/1.1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"3G / 4G Disabled","description":"new description","allowed_3g":false,"allowed_4g":false,"allowed_nb_iot":false,"apply_sms_quota":false,"apply_data_quota":false,"retail":false,"sms_p2p_int":true,"sms_p2p_ext":true,"nipdp":false,"api_callback":{"id":1},"api_secret":{"id":1},"moc_callback":{"id":2},"esme_interface_type":{"id":3},"breakout_region":{"id":3},"dns":{"id":4}}'
};

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

```go Update all properties
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/service_profile/1.1"

	payload := strings.NewReader("{\n  \"name\": \"3G / 4G Disabled\",\n  \"description\": \"new description\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false,\n  \"allowed_nb_iot\": false,\n  \"apply_sms_quota\": false,\n  \"apply_data_quota\": false,\n  \"retail\": false,\n  \"sms_p2p_int\": true,\n  \"sms_p2p_ext\": true,\n  \"nipdp\": false,\n  \"api_callback\": {\n    \"id\": 1\n  },\n  \"api_secret\": {\n    \"id\": 1\n  },\n  \"moc_callback\": {\n    \"id\": 2\n  },\n  \"esme_interface_type\": {\n    \"id\": 3\n  },\n  \"breakout_region\": {\n    \"id\": 3\n  },\n  \"dns\": {\n    \"id\": 4\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 Update all properties
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/service_profile/1.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  \"name\": \"3G / 4G Disabled\",\n  \"description\": \"new description\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false,\n  \"allowed_nb_iot\": false,\n  \"apply_sms_quota\": false,\n  \"apply_data_quota\": false,\n  \"retail\": false,\n  \"sms_p2p_int\": true,\n  \"sms_p2p_ext\": true,\n  \"nipdp\": false,\n  \"api_callback\": {\n    \"id\": 1\n  },\n  \"api_secret\": {\n    \"id\": 1\n  },\n  \"moc_callback\": {\n    \"id\": 2\n  },\n  \"esme_interface_type\": {\n    \"id\": 3\n  },\n  \"breakout_region\": {\n    \"id\": 3\n  },\n  \"dns\": {\n    \"id\": 4\n  }\n}"

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

```java Update all properties
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://iot.telia.lt/api/v1/service_profile/1.1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"3G / 4G Disabled\",\n  \"description\": \"new description\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false,\n  \"allowed_nb_iot\": false,\n  \"apply_sms_quota\": false,\n  \"apply_data_quota\": false,\n  \"retail\": false,\n  \"sms_p2p_int\": true,\n  \"sms_p2p_ext\": true,\n  \"nipdp\": false,\n  \"api_callback\": {\n    \"id\": 1\n  },\n  \"api_secret\": {\n    \"id\": 1\n  },\n  \"moc_callback\": {\n    \"id\": 2\n  },\n  \"esme_interface_type\": {\n    \"id\": 3\n  },\n  \"breakout_region\": {\n    \"id\": 3\n  },\n  \"dns\": {\n    \"id\": 4\n  }\n}")
  .asString();
```

```php Update all properties
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://iot.telia.lt/api/v1/service_profile/1.1', [
  'body' => '{
  "name": "3G / 4G Disabled",
  "description": "new description",
  "allowed_3g": false,
  "allowed_4g": false,
  "allowed_nb_iot": false,
  "apply_sms_quota": false,
  "apply_data_quota": false,
  "retail": false,
  "sms_p2p_int": true,
  "sms_p2p_ext": true,
  "nipdp": false,
  "api_callback": {
    "id": 1
  },
  "api_secret": {
    "id": 1
  },
  "moc_callback": {
    "id": 2
  },
  "esme_interface_type": {
    "id": 3
  },
  "breakout_region": {
    "id": 3
  },
  "dns": {
    "id": 4
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Update all properties
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/service_profile/1.1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"3G / 4G Disabled\",\n  \"description\": \"new description\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false,\n  \"allowed_nb_iot\": false,\n  \"apply_sms_quota\": false,\n  \"apply_data_quota\": false,\n  \"retail\": false,\n  \"sms_p2p_int\": true,\n  \"sms_p2p_ext\": true,\n  \"nipdp\": false,\n  \"api_callback\": {\n    \"id\": 1\n  },\n  \"api_secret\": {\n    \"id\": 1\n  },\n  \"moc_callback\": {\n    \"id\": 2\n  },\n  \"esme_interface_type\": {\n    \"id\": 3\n  },\n  \"breakout_region\": {\n    \"id\": 3\n  },\n  \"dns\": {\n    \"id\": 4\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update all properties
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "3G / 4G Disabled",
  "description": "new description",
  "allowed_3g": false,
  "allowed_4g": false,
  "allowed_nb_iot": false,
  "apply_sms_quota": false,
  "apply_data_quota": false,
  "retail": false,
  "sms_p2p_int": true,
  "sms_p2p_ext": true,
  "nipdp": false,
  "api_callback": ["id": 1],
  "api_secret": ["id": 1],
  "moc_callback": ["id": 2],
  "esme_interface_type": ["id": 3],
  "breakout_region": ["id": 3],
  "dns": ["id": 4]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/service_profile/1.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()
```