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

# List user accounts

GET https://iot.telia.lt/api/v1/user

Retrieves the collection of user accounts, filtered, sorted and paged accourding to query parameters.


Reference: https://docs.iot.telia.lt/developers/api/user-management/user-per-page-sort-by-q-and-page-get

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

### Query parameters

- `page` (double, optional) — Current page number
- `q` (string, optional) — Filter parameter in `<filter>:<value>` format. Multiple filters must be in the format of a comma separated list of the following fields: * `id` * `status` * `name` * `username` * `organisation`
- `per_page` (integer, optional) — Defines the number of items per page
- `sort` (string, optional) — Sort parameter in `<operator><field>` format. Expects a comma-separated list from the allowed fields: * `id` * `status` * `name` * `username` * `organisation` * `created`

## Response

### 200

Successfully returned a list of Users

- `list of ApiV1UserGetResponsesContentApplicationJsonSchemaItems`

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

### ApiV1UserGetResponsesContentApplicationJsonSchemaItems

- `id` (integer, optional)
- `username` (string, optional)
- `name` (string, optional)
- `created` (string, optional)
- `status` (ApiV1UserGetResponsesContentApplicationJsonSchemaItemsStatus, optional)
- `organisation` (ApiV1UserGetResponsesContentApplicationJsonSchemaItemsOrganisation, optional)

### ApiV1UserGetResponsesContentApplicationJsonSchemaItemsStatus

- `id` (double, optional)
- `description` (string, optional)

### ApiV1UserGetResponsesContentApplicationJsonSchemaItemsOrganisation

- `id` (double, optional)
- `name` (string, optional)

## Examples

### Default - List All Users

**Response**

```json
[
  {
    "id": 1,
    "username": "user@example-iot-org.com",
    "name": "Douglas Adams",
    "created": "2019-10-12T08:00:00.000Z",
    "status": {
      "id": 2,
      "description": "Suspended"
    },
    "organisation": {
      "id": 10,
      "name": "Example IoT Org"
    },
    "mfa": [
      {
        "activation_date": "2019-02-04T09:14:13.000Z",
        "creation_date": "2019-02-03T14:04:03.000Z",
        "id": 2,
        "status": {
          "id": 1,
          "name": "Active"
        },
        "type": {
          "id": 0,
          "name": "Time-Based One-Time Password"
        }
      }
    ]
  },
  {
    "id": 2,
    "username": "admin@example-iot-org.com",
    "name": "Edwin Abbott",
    "created": "2019-08-31T16:47:00.000Z",
    "status": {
      "id": 1,
      "description": "Active"
    },
    "organisation": {
      "id": 10,
      "name": "Example IoT Org"
    }
  }
]
```

**SDK Code**

```python Default - List All Users
import requests

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

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

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

print(response.json())
```

```javascript Default - List All Users
const url = 'https://iot.telia.lt/api/v1/user';
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 - List All Users
package main

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

func main() {

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

	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 - List All Users
require 'uri'
require 'net/http'

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

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 - List All Users
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Default - List All Users
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Default - List All Users
using RestSharp;

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

```swift Default - List All Users
import Foundation

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

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

**Response**

```json
[
  {
    "id": 123,
    "username": "user@example-iot-org.com",
    "name": "Douglas Adams",
    "created": "2019-10-12T08:00:00.000Z",
    "status": {
      "id": 2,
      "description": "Suspended"
    },
    "organisation": {
      "id": 10,
      "name": "Example IoT Org"
    }
  }
]
```

**SDK Code**

```python Filter by User ID
import requests

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

querystring = {"q":"id:123"}

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

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

print(response.json())
```

```javascript Filter by User ID
const url = 'https://iot.telia.lt/api/v1/user?q=id%3A123';
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 User ID
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user?q=id%3A123"

	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 User ID
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user?q=id%3A123")

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 User ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/user?q=id%3A123")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by User ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/user?q=id%3A123', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Filter by User ID
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/user?q=id%3A123");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by User ID
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user?q=id%3A123")! 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 Status and Organization

**Response**

```json
[
  {
    "id": 1,
    "username": "user@example-iot-org.com",
    "name": "Douglas Adams",
    "created": "2019-10-12T08:00:00.000Z",
    "status": {
      "id": 0,
      "description": "Active"
    },
    "organisation": {
      "id": 74,
      "name": "Example Org"
    }
  }
]
```

**SDK Code**

```python Filter by Status and Organization
import requests

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

querystring = {"q":"status:0,organisation:74"}

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

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

print(response.json())
```

```javascript Filter by Status and Organization
const url = 'https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74';
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 Status and Organization
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74"

	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 Status and Organization
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74")

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 Status and Organization
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filter by Status and Organization
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Filter by Status and Organization
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filter by Status and Organization
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user?q=status%3A0%2Corganisation%3A74")! 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()
```

### Sort by Status and ID (Descending)

**Response**

```json
[
  {
    "id": 1,
    "username": "user@example-iot-org.com",
    "name": "Douglas Adams",
    "created": "2019-10-12T08:00:00.000Z",
    "status": {
      "id": 2,
      "description": "Suspended"
    },
    "organisation": {
      "id": 10,
      "name": "Example IoT Org"
    }
  },
  {
    "id": 2,
    "username": "admin@example-iot-org.com",
    "name": "Edwin Abbott",
    "created": "2019-08-31T16:47:00.000Z",
    "status": {
      "id": 1,
      "description": "Active"
    },
    "organisation": {
      "id": 10,
      "name": "Example IoT Org"
    }
  }
]
```

**SDK Code**

```python Sort by Status and ID (Descending)
import requests

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

querystring = {"sort":"-status,id"}

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

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

print(response.json())
```

```javascript Sort by Status and ID (Descending)
const url = 'https://iot.telia.lt/api/v1/user?sort=-status%2Cid';
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 Sort by Status and ID (Descending)
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/user?sort=-status%2Cid"

	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 Sort by Status and ID (Descending)
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/user?sort=-status%2Cid")

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 Sort by Status and ID (Descending)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://iot.telia.lt/api/v1/user?sort=-status%2Cid")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Sort by Status and ID (Descending)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://iot.telia.lt/api/v1/user?sort=-status%2Cid', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Sort by Status and ID (Descending)
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/user?sort=-status%2Cid");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Sort by Status and ID (Descending)
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/user?sort=-status%2Cid")! 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()
```