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

# Restart existing data stream

POST https://iot.telia.lt/api/v2/data_stream/{data_stream_id}/restart

Restart your Existing Data Stream.
This might be necessary when e.g. your Webhook endpoint has been unreachable for an extended period of time.
Webhook Data Stream will exhaust retries and go into Error State.
By using this API call your Data Stream will be restarted and continue trying to send data.


Reference: https://docs.iot.telia.lt/developers/api/integrations/data-streamer-v-2-by-id-restart

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

- `data_stream_id` (string, required) — ID of a data stream.

## Response

### 202

Request accepted

## Errors

### 401 Unauthorized Error

No or invalid authentication token provided

- `any`

### 403 Forbidden Error

Authentication token is valid, but user has no access permissions to the request resource

- `any`

### 404 Not Found Error

A non-existent resource is requested

- `any`

### 409 Conflict Error

The request could not be completed due to a conflict with the current state of the resource.

- `any`

## Examples

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

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

func main() {

	url := "https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v2/data_stream/a1b2c3d4/restart")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```