# List

To list all participants you need to execute a **GET** request against the **/participants** endpoint.

Since potentially there could be thousands of participants, pagination is supported with **limit**, **order** and **after** arguments. Read about [pagination](/reference/rest-api/pagination.md) to learn the details of it. By default maximum 100 participants will be returned in the response.

{% hint style="info" %}
To list all participants for a concrete room execute a **GET** request against the **/participants** endpoint and add the **room\_id** param. \
\
api/v1/participants?**room\_id**=87a5d383-9e79-44ea-b382-686e430f4ecc

You can also use:\
api/v1/rooms/87a5d383-9e79-44ea-b382-686e430f4ecc/participants
{% endhint %}

{% hint style="info" %}
To list all participants for a concrete session execute a **GET** request against the **/participants** endpoint and add the **session\_id** param.\
\
api/v1/participants?**session\_id**=09b9df70-7ce9-4f15-8ebb-55939024e72f

You can also use:\
api/v1/sessions/09b9df70-7ce9-4f15-8ebb-55939024e72f/participants
{% endhint %}

{% hint style="info" %}
If you want to filter live participants (haven't left the room yet), then use the **live** parameter:\
api/v1/participants?**live**=true\
\
If you want to filter participants who left the room: \
api/v1/participants?**live**=false
{% endhint %}

#### Request (listing all participants)

{% tabs %}
{% tab title="cURL" %}

```bash
curl --request GET \
  --url https://api.digitalsamba.com/api/v1/participants \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY
```

{% endtab %}

{% tab title="Java" %}

```java
import com.fasterxml.jackson.databind.ObjectMapper;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.Base64;
import java.util.Map;

String TEAM_ID = "YOUR_TEAM_ID";
String DEVELOPER_KEY = "YOUR_DEVELOPER_KEY";
String authorizationHeader = "Bearer " + Base64.getEncoder().encodeToString((TEAM_ID + ":" + DEVELOPER_KEY).getBytes());

HttpRequest request = HttpRequest.newBuilder()
  .GET()
  .uri(new URI("https://api.digitalsamba.com/api/v1/participants"))
  .header("Authorization", authorizationHeader)
  .build();

HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());

System.out.println("Status code: " + response.statusCode());
System.out.println("Body: " + response.body());
```

{% endtab %}
{% endtabs %}

#### Response (200 OK)

```json
{
    "total_count": 20000,
    "data": [
          {
            "id": "d4d68f3f-a087-4f41-88fc-b0414fa0c038",
            "external_id": null,
            "session_id": "09b9df70-7ce9-4f15-8ebb-55939024e72f",
            "room_id": "87a5d383-9e79-44ea-b382-686e430f4ecc",
            "room_external_id": null,
            "room_is_deleted": false,
            "name": "John Smith",
            "role": "moderator",
            "friendly_url": "EasySpanish",
            "join_time": "2024-03-27T09:21:24Z",
            "leave_time": "2024-03-27T09:32:29Z",
            "live": false
         },
         {
            "id": "29b7e989-48b7-4159-b72d-3f75ee5a82a9",
            "external_id": null,
            "session_id": "09b9df70-7ce9-4f15-8ebb-55939024e72f",
            "room_id": "87a5d383-9e79-44ea-b382-686e430f4ecc",
            "room_external_id": null,
            "room_is_deleted": false,
            "name": "Cillian Taylor",
            "role": "moderator",
            "friendly_url": "DailyEnglishLessons",
            "join_time": "2024-03-27T09:21:24Z",
            "leave_time": "2024-03-27T09:32:29Z",
            "live": false
         }
        ...............98 more participants...............
    ]
} 
```

{% hint style="info" %}
The **total\_count** is the total amount of participants that used the platform. It is **NOT** the amount of participants in the current page returned in the **data** array. In the above example you have 20000 participants in total, but in the data array there will be maximum 100 participants (the default limit argument value).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalsamba.com/reference/rest-api/participants/list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
