Register the forge-side webhook for a bound repo (ADR-0046 register_webhook)
POST
/v1/connections/{id}/repos/{owner}/{name}/webhook
const url = 'https://example.com/v1/connections/example/repos/example/example/webhook';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/connections/example/repos/example/example/webhookOnly for a repo this connection already governs: registering a hook that points at Scarab for a repo Scarab has no Project for would produce deliveries that resolve to nothing.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Connection id
owner
required
string
Repo owner
name
required
string
Repo name
Responses
Section titled “Responses”Media typeapplication/json
The outcome of binding a repo: the Project it created, and what happened to the webhook.
object
org
required
The governed Project’s natural key — (owner, name) in v1 (1 Project : 1
RepoRef), the same mapping installation auto-registration uses.
string
project
required
string
webhook_error
Why it did not, when it did not. The binding still stands — see the handler’s note on why a hook failure is reported rather than rolled back.
string | null
webhook_registered
required
Did a forge-side webhook get registered (or already exist)?
boolean
Examplegenerated
{ "org": "example", "project": "example", "webhook_error": "example", "webhook_registered": true}The forge rejected the registration
Requires Administer on the org
No such connection, or the repo is not bound to it