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

# Create service profile

POST https://iot.telia.lt/api/v1/service_profile
Content-Type: application/json

Creates a new Service Profile. A `name` must be specified for the Service Profile and all other fields are optional.

Editable fields:

* `name` (String required)
* `description` (String optional)
* `allowed_3g` (boolean optional, defaults to true)
* `allowed_4g` (boolean optional, defaults to true). Allows or restricts connectivity for 4G/LTE and LTE-M networks.
* `allowed_nb_iot` (boolean optional, defaults to true)
* **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)
* `api_secret` (object optional)
* `moc_callback` (object optional)
* `esme_interface_type` (object optional)
* `breakout_region` (object optional)
* `dns` (object optional)

Enabling services (SMS, Data etc.) is done via `PUT` to `/api/v1/service_profile/{profile_id}/service/{service_id}`.

Reference: https://docs.iot.telia.lt/developers/api/service-profiles/service-profile-post

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

- `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` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaApiCallback, optional)
- `api_secret` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaApiSecret, optional)
- `moc_callback` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaMocCallback, optional)
- `esme_interface_type` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaEsmeInterfaceType, optional)
- `breakout_region` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaBreakoutRegion, optional)
- `dns` (ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaDns, optional)

## Response

### 201

Resource Created

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

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaApiCallback

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaApiSecret

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaMocCallback

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaEsmeInterfaceType

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaBreakoutRegion

### ApiV1ServiceProfilePostRequestBodyContentApplicationJsonSchemaDns

## Examples

### Service Profile with 3G and 4G disabled

**Request**

```json
{
  "name": "3G/4G Disabled",
  "allowed_3g": false,
  "allowed_4g": false
}
```

**Response**

```json
{}
```

**SDK Code**

```python Service Profile with 3G and 4G disabled
import requests

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

payload = {
    "name": "3G/4G Disabled",
    "allowed_3g": False,
    "allowed_4g": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Service Profile with 3G and 4G disabled
const url = 'https://iot.telia.lt/api/v1/service_profile';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"3G/4G Disabled","allowed_3g":false,"allowed_4g":false}'
};

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

```go Service Profile with 3G and 4G disabled
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"3G/4G Disabled\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false\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 Service Profile with 3G and 4G disabled
require 'uri'
require 'net/http'

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

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  \"name\": \"3G/4G Disabled\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false\n}"

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

```java Service Profile with 3G and 4G disabled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/service_profile")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"3G/4G Disabled\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false\n}")
  .asString();
```

```php Service Profile with 3G and 4G disabled
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/service_profile', [
  'body' => '{
  "name": "3G/4G Disabled",
  "allowed_3g": false,
  "allowed_4g": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Service Profile with 3G and 4G disabled
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/service_profile");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"3G/4G Disabled\",\n  \"allowed_3g\": false,\n  \"allowed_4g\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Service Profile with 3G and 4G disabled
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "3G/4G Disabled",
  "allowed_3g": false,
  "allowed_4g": false
] as [String : Any]

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

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

### Service Profile with DNS object

**Request**

```json
{
  "name": "DNS config applied",
  "dns": {
    "id": 3
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python Service Profile with DNS object
import requests

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

payload = {
    "name": "DNS config applied",
    "dns": { "id": 3 }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Service Profile with DNS object
const url = 'https://iot.telia.lt/api/v1/service_profile';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"DNS config applied","dns":{"id":3}}'
};

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

```go Service Profile with DNS object
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"DNS config applied\",\n  \"dns\": {\n    \"id\": 3\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 Service Profile with DNS object
require 'uri'
require 'net/http'

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

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  \"name\": \"DNS config applied\",\n  \"dns\": {\n    \"id\": 3\n  }\n}"

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

```java Service Profile with DNS object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Service Profile with DNS object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Service Profile with DNS object
using RestSharp;

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

```swift Service Profile with DNS object
import Foundation

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

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

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

### Complete Service Profile

**Request**

```json
{
  "name": "Smart meter",
  "description": "Data + SMS - 1G limit",
  "allowed_3g": true,
  "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": 2
  },
  "moc_callback": {
    "id": 2
  },
  "esme_interface_type": {
    "id": 3
  },
  "breakout_region": {
    "id": 3
  },
  "dns": {
    "id": 4
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python Complete Service Profile
import requests

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

payload = {
    "name": "Smart meter",
    "description": "Data + SMS - 1G limit",
    "allowed_3g": True,
    "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": 2 },
    "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.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Complete Service Profile
const url = 'https://iot.telia.lt/api/v1/service_profile';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Smart meter","description":"Data + SMS - 1G limit","allowed_3g":true,"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":2},"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 Complete Service Profile
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"Smart meter\",\n  \"description\": \"Data + SMS - 1G limit\",\n  \"allowed_3g\": true,\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\": 2\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("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 Complete Service Profile
require 'uri'
require 'net/http'

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

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  \"name\": \"Smart meter\",\n  \"description\": \"Data + SMS - 1G limit\",\n  \"allowed_3g\": true,\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\": 2\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 Complete Service Profile
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/service_profile")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Smart meter\",\n  \"description\": \"Data + SMS - 1G limit\",\n  \"allowed_3g\": true,\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\": 2\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 Complete Service Profile
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/service_profile', [
  'body' => '{
  "name": "Smart meter",
  "description": "Data + SMS - 1G limit",
  "allowed_3g": true,
  "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": 2
  },
  "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 Complete Service Profile
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/service_profile");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Smart meter\",\n  \"description\": \"Data + SMS - 1G limit\",\n  \"allowed_3g\": true,\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\": 2\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 Complete Service Profile
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Smart meter",
  "description": "Data + SMS - 1G limit",
  "allowed_3g": true,
  "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": 2],
  "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")! 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()
```