# List

To list the existing webhooks you need to execute a **GET** request against the **/webhooks** endpoint.&#x20;

[Pagination](/reference/rest-api/pagination.md) is supported with **limit**, **order** and **after** arguments.

{% hint style="info" %}
If you want to retrieve the details of one concrete webhook, then execute a **GET** request against the **/webhooks/:id** endpoint
{% endhint %}

#### Request (listing all webhooks)

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

```bash
curl --request GET \
  --url https://api.digitalsamba.com/api/v1/webhooks \
  --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/webhooks"))
  .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": 1,
    "data": [
        {
            "id": "7adb1f07-db15-4cdc-8bf0-2be746fcec2a",
            "endpoint": "https://webhook.site/6edb900e-acd7-4877-b8cf-825a0862003b",
            "authorization_header": "Asf#k$%lfCaPe93$a",
            "name": "Testing my first webhook",
            "created_at": "2023-02-06T09:43:48Z",
            "updated_at": "2023-02-06T09:43:48Z"
        }
    ]
} 
```

#### Request (get a concrete webhook)

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

```bash
curl --request GET \
  --url https://api.digitalsamba.com/api/v1/webhooks/7adb1f07-db15-4cdc-8bf0-2be746fcec2a \
  --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());
//Put your webhook id here - this value is just an example
String webhookId = "7adb1f07-db15-4cdc-8bf0-2be746fcec2a";

HttpRequest request = HttpRequest.newBuilder()
  .GET()
  .uri(new URI("https://api.digitalsamba.com/api/v1/webhooks/" + webhookId))
  .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
{
    "id": "7adb1f07-db15-4cdc-8bf0-2be746fcec2a",
    "endpoint": "https://webhook.site/6edb900e-acd7-4877-b8cf-825a0862003b",
    "authorization_header": "Asf#k$%lfCaPe93$a",
    "name": "Testing my first webhook",
    "events": [
        "participant_joined",
        "participant_left"
    ],
    "created_at": "2023-02-06T09:43:48Z",
    "updated_at": "2023-02-06T09:43:48Z"
}
```


---

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