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

# Hourly organization traffic statistics

GET https://iot.telia.lt/api/v1/organisation/{org_id}/stats/hourly

Retrieves traffic statistics for the selected organization and all child organizations, accumulated per hour.

Historical data is available for up to **Last 3 Hours**.

By default, this call returns statistics for the last three hours.

Reference: https://docs.iot.telia.lt/developers/api/organization/get-organisation-hourly-stats

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

- `org_id` (integer, required) — Numerical ID of an organization

### Query parameters

- `start_date` (string, optional) — Filters results to data collected on or after this timestamp. If not specified, the response includes data from the past three hours up to the current time.
- `end_date` (string, optional) — Filters results to data collected before this timestamp. Must be used with `start_date`. If not specified, defaults to one hour after the current time.

## Response

### 200

OK

- `data` (ApiV1OrganisationOrgIdStatsHourlyGetResponsesContentApplicationJsonSchemaData, optional)
- `sms` (ApiV1OrganisationOrgIdStatsHourlyGetResponsesContentApplicationJsonSchemaSms, optional)

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

### ApiV1OrganisationOrgIdStatsHourlyGetResponsesContentApplicationJsonSchemaData

- `rx` (list of string, optional) — Downloaded data - Array index `0`: Time as `HH:mm` string, index `1`: consumed volume
- `tx` (list of string, optional) — Uploaded data - Array index `0`: Time as `HH:mm` string, index `1`: consumed volume

### ApiV1OrganisationOrgIdStatsHourlyGetResponsesContentApplicationJsonSchemaSms

- `rx` (list of string, optional) — SMS MO - Array index `0`: Time as `HH:mm` string, index `1`: consumed volume
- `tx` (list of string, optional) — SMS MT - Array index `0`: Time as `HH:mm` string, index `1`: consumed volume

## Examples

### Default - Last 3 Hours

**Response**

```json
{
  "data": {
    "rx": [
      [
        "09:00",
        12.234
      ],
      [
        "10:00",
        9.186
      ],
      [
        "11:00",
        46.9659
      ]
    ],
    "tx": [
      [
        "09:00",
        5.2358
      ],
      [
        "10:00",
        1.005
      ],
      [
        "11:00",
        7.262
      ]
    ]
  },
  "sms": {
    "rx": [
      [
        "09:00",
        5
      ],
      [
        "10:00",
        2
      ],
      [
        "11:00",
        10
      ]
    ],
    "tx": [
      [
        "09:00",
        7
      ],
      [
        "10:00",
        3
      ],
      [
        "11:00",
        9
      ]
    ]
  }
}
```

**SDK Code**

```python Default - Last 3 Hours
import requests

url = "https://iot.telia.lt/api/v1/organisation/123/stats/hourly"

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

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

print(response.json())
```

```javascript Default - Last 3 Hours
const url = 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly';
const options = {method: 'GET', 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 Default - Last 3 Hours
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/organisation/123/stats/hourly"

	req, _ := http.NewRequest("GET", 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 Default - Last 3 Hours
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/organisation/123/stats/hourly")

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

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

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

```java Default - Last 3 Hours
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/organisation/123/stats/hourly")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Default - Last 3 Hours
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Default - Last 3 Hours
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/organisation/123/stats/hourly");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Default - Last 3 Hours
import Foundation

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

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

### Filter by Start Date

**Response**

```json
{
  "data": {
    "rx": [
      [
        "00:00",
        15.5
      ],
      [
        "01:00",
        12.3
      ]
    ],
    "tx": [
      [
        "00:00",
        8.2
      ],
      [
        "01:00",
        6.5
      ]
    ]
  },
  "sms": {
    "rx": [
      [
        "00:00",
        8
      ],
      [
        "01:00",
        5
      ]
    ],
    "tx": [
      [
        "00:00",
        10
      ],
      [
        "01:00",
        7
      ]
    ]
  }
}
```

**SDK Code**

```python Filter by Start Date
import requests

url = "https://iot.telia.lt/api/v1/organisation/123/stats/hourly"

querystring = {"start_date":"2020-02-01T00:00:00.000Z"}

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

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by Start Date
const url = 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z';
const options = {method: 'GET', 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 Filter by Start Date
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z"

	req, _ := http.NewRequest("GET", 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 Filter by Start Date
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z")

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

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

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

```java Filter by Start Date
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Start Date
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Filter by Start Date
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Start Date
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/organisation/123/stats/hourly?start_date=2020-02-01T00%3A00%3A00.000Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```

### Filter by Date Range

**Response**

```json
{
  "data": {
    "rx": [
      [
        "09:00",
        20.5
      ],
      [
        "10:00",
        18.2
      ],
      [
        "11:00",
        25.8
      ]
    ],
    "tx": [
      [
        "09:00",
        10.5
      ],
      [
        "10:00",
        8.3
      ],
      [
        "11:00",
        12.7
      ]
    ]
  },
  "sms": {
    "rx": [
      [
        "09:00",
        12
      ],
      [
        "10:00",
        8
      ],
      [
        "11:00",
        15
      ]
    ],
    "tx": [
      [
        "09:00",
        15
      ],
      [
        "10:00",
        10
      ],
      [
        "11:00",
        18
      ]
    ]
  }
}
```

**SDK Code**

```python Filter by Date Range
import requests

url = "https://iot.telia.lt/api/v1/organisation/123/stats/hourly"

querystring = {"end_date":"2020-02-15T00:00:00.000Z","start_date":"2020-02-01T00:00:00.000Z"}

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

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filter by Date Range
const url = 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z';
const options = {method: 'GET', 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 Filter by Date Range
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z"

	req, _ := http.NewRequest("GET", 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 Filter by Date Range
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z")

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

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

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

```java Filter by Date Range
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Date Range
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Filter by Date Range
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Date Range
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/organisation/123/stats/hourly?end_date=2020-02-15T00%3A00%3A00.000Z&start_date=2020-02-01T00%3A00%3A00.000Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```