# Alle Webhooks abrufen (GET)

Ruf eine Liste aller Webhooks ab, die in deinem Konto eingerichtet sind.

## Endpunkt

```
GET https://api.pocketalert.app/v1/webhooks
```

## Authentifizierung

> **Info: Erforderlich**
>
> Füge einen dieser Header in deine Anfrage ein:
> - `Token: <your-api-key>` — Hol ihn dir unter [API-Schlüssel](https://pocketalert.app/account/apikeys)
> - `Authorization: Bearer <jwt-token>` — Aus [Anmeldung](https://info.pocketalert.app/api/user/login.md)

## Anfrage

### Header

| Header | Erforderlich | Beschreibung |
|--------|:--------:|-------------|
| `Token` | ✅ | Dein API-Schlüssel |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### Beispielanfrage

**cURL**

```bash
curl -X GET "https://api.pocketalert.app/v1/webhooks" \
  -H "Token: your-api-key"
```

**JavaScript**

```javascript
const response = await fetch('https://api.pocketalert.app/v1/webhooks', {
  headers: { 'Token': 'your-api-key' }
});
const webhooks = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    'https://api.pocketalert.app/v1/webhooks',
    headers={'Token': 'your-api-key'}
)
print(response.json())
```

**PHP**

```php
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/webhooks');

return $response->json();
```

## Antwort

### Erfolgreiche Antwort

> **Tip: 200 OK**
>
> Gibt ein Array von Webhook-Objekten zurück

| Feld | Typ | Beschreibung |
|-------|------|-------------|
| `tid` | string | Eindeutige Webhook-ID |
| `name` | string | Name des Webhooks |
| `url` | string | URL-Slug des Webhooks |
| `message` | string | Nachrichtenvorlage |
| `is_active` | boolean | Ob der Webhook aktiv ist |
| `created_at` | string | Zeitstempel der Erstellung |

```json
[
  {
    "tid": "kblf7mh9j8jjyeh4fx",
    "name": "GitHub Push",
    "url": "cs994rqfkk8ljngt",
    "message": "Push to %repository.name%: %head_commit.message%",
    "is_active": true,
    "created_at": "01.09.2023 22:38:48"
  }
]
```

### Fehlerantworten

| Status | Beschreibung |
|:------:|-------------|
| `401` | Nicht autorisiert — Token ungültig oder fehlt |
