# แก้ไข endpoint

Source: https://checkslip.com/docs/update-endpoint

PATCH `https://api.checkslip.com/api/webhooks/endpoints/{endpoint_id}`

ใช้ API key

ส่งเฉพาะฟิลด์ที่จะเปลี่ยน (url, description, event_types, enabled) แบบ JSON Merge Patch (Content-Type: application/merge-patch+json) · เปลี่ยน url แล้วระบบเช็ก URL ใหม่เหมือนตอนเพิ่ม และส่งอีเมลแจ้งเจ้าของบัญชี · ส่ง enabled เป็น false เพื่อหยุดส่ง และ true เพื่อเปิดอีกครั้ง · ระหว่างที่ปิด ข้อความใหม่ไม่ถูกเก็บไว้เลย เปิดกลับมาแล้วตามเก็บไม่ได้ · ส่งซ้ำตามช่วงเวลาใช้ได้เฉพาะรายการที่ส่งแล้วไม่สำเร็จ (FAILED) · ใช้ API key ที่มีสิทธิ์ webhook:manage

## Parameters

| ฟิลด์ | ส่งทาง | ชนิด | จำเป็น |
| --- | --- | --- | --- |
| `endpoint_id` | path | `string` | ใช่ |
| `traceparent` | header | `string` | ไม่ |

## Request body

`application/merge-patch+json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `url` | `string (uri)` | ไม่ |
| `description` | `string \| null` | ไม่ |
| `event_types` | `slip.checked \| webhook.test[]` | ไม่ |
| `enabled` | `boolean` | ไม่ |

## Responses

### 200 `application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `id` | `string` | ใช่ |
| `url` | `string (uri)` | ใช่ |
| `description` | `string \| null` | ใช่ |
| `event_types` | `slip.checked \| webhook.test[]` | ใช่ |
| `enabled` | `boolean` | ใช่ |
| `disabled_reason` | `MANUAL \| GONE \| FAILING \| null` | ใช่ |
| `secret_hint` | `string` | ใช่ |
| `previous_secret_expires_at` | `string (date-time) \| null` | ไม่ |
| `created_at` | `string (date-time)` | ใช่ |
| `updated_at` | `string (date-time)` | ใช่ |

### Error ที่อาจได้

400 401 403 404 422

error ในรูป Problem Details ดูรหัสทั้งหมดที่ [รหัสข้อผิดพลาด](https://checkslip.com/docs/errors)

**cURL**

```bash
curl -X PATCH https://api.checkslip.com/api/webhooks/endpoints/string \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{"url":"https://example.com/hooks/checkslip","description":"string","event_types":["slip.checked"],"enabled":true}'
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/webhooks/endpoints/string", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
    "Content-Type": "application/merge-patch+json",
  },
  body: JSON.stringify({
    url: "https://example.com/hooks/checkslip",
    description: "string",
    event_types: ["slip.checked"],
    enabled: true,
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.patch(
    "https://api.checkslip.com/api/webhooks/endpoints/string",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
    },
    json={
        "url": "https://example.com/hooks/checkslip",
        "description": "string",
        "event_types": ["slip.checked"],
        "enabled": True,
    },
)
data = res.json()
```

```json
{
  "id": "string",
  "url": "https://example.com/hooks/checkslip",
  "description": "string",
  "event_types": [
    "slip.checked"
  ],
  "enabled": true,
  "disabled_reason": "MANUAL",
  "secret_hint": "string",
  "previous_secret_expires_at": "2026-11-05T09:30:00+07:00",
  "created_at": "2026-11-05T09:30:00+07:00",
  "updated_at": "2026-11-05T09:30:00+07:00"
}
```
