# Anwendung aktualisieren (PUT)

Aktualisiere die Details einer bestehenden Anwendung.

## Endpunkt

```
PUT https://api.pocketalert.app/v1/applications/{tid}
```

## Authentifizierung

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

## Anfrage

### Pfadparameter

| Parameter | Typ | Erforderlich | Beschreibung |
|-----------|------|:--------:|-------------|
| `tid` | string | ✅ | Eindeutige Kennung der Anwendung |

### Header

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

### Body-Parameter

| Parameter | Typ | Erforderlich | Beschreibung |
|-----------|------|:--------:|-------------|
| `name` | string | ✅ | Neuer Name der Anwendung |

### Beispielanfrage

**cURL**

```bash
curl -X PUT "https://api.pocketalert.app/v1/applications/sozb3yswlwoqdd1l1msi1nnh" \
  -H "Token: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New Application Name"
  }'
```

**JavaScript**

```javascript
const tid = 'sozb3yswlwoqdd1l1msi1nnh';

const response = await fetch(`https://api.pocketalert.app/v1/applications/${tid}`, {
  method: 'PUT',
  headers: {
    'Token': 'your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'New Application Name'
  })
});

const result = await response.json();
```

**Python**

```python
import requests

tid = 'sozb3yswlwoqdd1l1msi1nnh'

response = requests.put(
    f'https://api.pocketalert.app/v1/applications/{tid}',
    headers={
        'Token': 'your-api-key',
        'Content-Type': 'application/json'
    },
    json={'name': 'New Application Name'}
)

print(response.json())
```

**PHP**

```php
$tid = 'iemkz2tlbakj4lgns961ohx0o';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/applications/'.$tid, [
    'name' => 'Updated Name',
]);

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

## Antwort

### Erfolgreiche Antwort

> **Tip: 200 OK**
>
> Anwendung erfolgreich aktualisiert

```json
{
  "data": "success"
}
```

### Fehlerantworten

| Status | Beschreibung |
|:------:|-------------|
| `401` | Nicht autorisiert — Token ungültig oder fehlt |
| `404` | Nicht gefunden — Anwendung existiert nicht |
| `400` | Ungültige Anfrage — fehlerhafter Request-Body |
