API 레퍼런스
웹훅
프로젝트 이벤트를 받을 엔드포인트를 등록합니다.
웹훅 만들기
POST
/projects/{project}/webhooksHTTPS 엔드포인트를 등록합니다. 응답에 서명 시크릿이 포함되며 한 번만 표시됩니다.
헤더
Authorizationstring필수Bearer <token>
경로 파라미터
projectstring필수- 프로젝트 id. 예:
prj_8d2kq.
본문 파라미터
urlstring필수- POST 요청을 받을 HTTPS URL.
eventsstring[]필수- 예:
flag.updated,rollout.step. environmentsstring[]선택- 이 환경으로 제한. 기본값: 전체.
요청
Terminal
curl -X POST https://api.shoal.dev/v2/projects/prj_8d2kq/webhooks \
-H "Authorization: Bearer $SHOAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "url": "https://acme.dev/hooks/shoal", "events": ["flag.updated"] }'TypeScript
const hook = await api.webhooks.create("prj_8d2kq", {
url: "https://acme.dev/hooks/shoal",
events: ["flag.updated"],
});Python
hook = api.webhooks.create("prj_8d2kq", url="https://acme.dev/hooks/shoal", events=["flag.updated"])응답
JSON
{
"id": "wh_3kd92",
"url": "https://acme.dev/hooks/shoal",
"events": ["flag.updated"],
"secret": "whsec_5f1c…"
}웹훅 삭제
DELETE
/projects/{project}/webhooks/{id}즉시 전송을 멈춥니다.
헤더
Authorizationstring필수Bearer <token>
경로 파라미터
projectstring필수- 프로젝트 id. 예:
prj_8d2kq. idstring필수- 웹훅 id.
요청
Terminal
curl -X DELETE https://api.shoal.dev/v2/projects/prj_8d2kq/webhooks/wh_3kd92 \
-H "Authorization: Bearer $SHOAL_TOKEN"TypeScript
await api.webhooks.delete("prj_8d2kq", "wh_3kd92");Python
api.webhooks.delete("prj_8d2kq", "wh_3kd92")응답
— No Content —