# 애플리케이션 수정 (PUT)

기존 애플리케이션의 세부 정보를 수정합니다.

## 엔드포인트

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

## 인증

> **Info: 필수**
>
> 요청에 다음 헤더 중 하나를 포함하세요:
> - `Token: <your-api-key>` — [API 키](https://pocketalert.app/account/apikeys)에서 발급받으세요
> - `Authorization: Bearer <jwt-token>` — [로그인](https://info.pocketalert.app/api/user/login.md)에서 받은 값

## 요청

### 경로 파라미터

| 파라미터 | 타입 | 필수 | 설명 |
|-----------|------|:--------:|-------------|
| `tid` | string | ✅ | 애플리케이션 고유 식별자 |

### 헤더

| 헤더 | 필수 | 설명 |
|--------|:--------:|-------------|
| `Content-Type` | ✅ | `application/json` |
| `Token` | ✅ | API 키 |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### 본문 파라미터

| 파라미터 | 타입 | 필수 | 설명 |
|-----------|------|:--------:|-------------|
| `name` | string | ✅ | 새 애플리케이션 이름 |

### 요청 예시

**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();
```

## 응답

### 성공 응답

> **Tip: 200 OK**
>
> 애플리케이션이 성공적으로 수정되었습니다

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

### 오류 응답

| 상태 | 설명 |
|:------:|-------------|
| `401` | Unauthorized — 토큰이 잘못되었거나 없음 |
| `404` | Not Found — 애플리케이션이 존재하지 않음 |
| `400` | Bad Request — 잘못된 요청 본문 |
