List Deploy Hooks
A deploy hook is a secret URL that deploys the app when something sends it a POST: a git app's hook builds the latest commit of its branch (the production branch deploys to production, another branch builds a preview), an upload app's hook rebuilds the last upload. This lists the app's hooks. A hook's URL is never listed: it is shown once, when the hook is created or its URL replaced.
Response (200 OK)
[] when there are none.10).Hook fields
null for an upload app's hook (it rebuilds the last upload).ngdh_ and 7 more), to tell hooks apart.queued, merged (it joined a build of the hook that was still queued), rate_limited, or not_queued: <reason> (for example not_queued: app paused, not_queued: account suspended, not_queued: over a plan quota, not_queued: repository access lost, not_queued: this app has no previews, not_queued: nothing to rebuild, not_queued: try again). The URL itself never tells the caller why.Create a Deploy Hook
Add a hook and get its URL, once: store it as a secret, because anyone who has it can deploy the app. A lost URL can't be shown again; replace it. Needs permission to manage applications.
Request body (application/json)
CMS publish.not_queued: this app has no previews. Upload apps take none.Response (201 Created)
https://api.ngris.com/v1/webhooks/deploy/ngdh_…. Only in this answer.Errors
Replace a Hook's URL
Give the hook a new URL, shown once in the answer. The old URL stops working at once, so update whatever calls it. The hook keeps its name, branch and history.
Response (200 OK)
Errors
deploy hook not found.Delete a Deploy Hook
Remove the hook; its URL stops working at once. This works on a paused app too.
Response (200 OK)
deleted.Errors
deploy hook not found.Call a Deploy Hook
The hook's URL. No API key: the token in the URL is the credential. Send a POST with any body and any content type; the body is not read. The answer is the same for everyone who calls: it never says which app the hook belongs to or why a build didn't start (the hook's last_result, which your account sees, says why).
Response
{"status":"queued"}: a build is queued. A call while the hook's previous build is still queued joins it instead of queuing another.{"status":"not_queued"}: nothing could start; see the hook's last_result.{"status":"rate_limited"} with Retry-After: a hook starts at most one build every 30 seconds and 30 an hour. Calls from one IP address (for IPv6, one /64 network) are also limited to 60 a minute across all hook URLs.{"error":"not found"}: the same answer for a URL that never existed, was replaced or deleted, or whose app is gone. A URL created or replaced a moment ago starts working within about a second; retry once if it answers 404 right away.POST.