Repository/webhook
Creates a GitHub webhook for the specified repository to enable real-time event notifications. The webhook listens for a predefined set of events relevant to the SFP application: - pull_request: Tracks PR creation, updates, merges, and closures - pull_request_review: Monitors review submissions and changes - pull_request_review_comment: Captures inline code review comments - issue_comment: Tracks comments on both issues and pull requests - issues: Monitors issue lifecycle events
A webhook secret is automatically generated if one doesn't exist for the repository. This secret is used to verify the authenticity of incoming webhook payloads. The secret is only returned in the response if it was newly generated.
Requires owner role to create webhooks.
Repository identifier in format owner/repo
octocat/hello-world
URL where GitHub should send webhook events
https://example.com/webhook
The webhook has been successfully created
POST /sfp/api/repository/webhook/create HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"repositoryIdentifier": "octocat/hello-world",
"webhookUrl": "https://example.com/webhook"
}
The webhook has been successfully created
{
"id": 1,
"url": "text",
"events": [
"text"
],
"active": true,
"secret": "text"
}
Updates an existing GitHub webhook's URL for the specified repository. The webhook must already exist for this repository. The events that trigger the webhook and its active status remain unchanged - only the URL is updated.
This is useful when changing the webhook endpoint URL (e.g., after infrastructure changes) without needing to recreate the entire webhook configuration.
The existing webhook secret is reused for security continuity. Requires owner role to update webhooks.
Repository identifier in format owner/repo
octocat/hello-world
URL where GitHub should send webhook events
https://example.com/webhook
The webhook has been successfully updated
POST /sfp/api/repository/webhook/update HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"repositoryIdentifier": "octocat/hello-world",
"webhookUrl": "https://example.com/webhook"
}
The webhook has been successfully updated
{
"id": 1,
"url": "text",
"events": [
"text"
],
"active": true
}
Retrieves all webhooks configured for the specified repository. Returns detailed information about each webhook including: - GitHub webhook ID and internal ID - Webhook URL endpoint - Events that trigger the webhook - Active status - Creation and last update timestamps
This endpoint helps verify webhook configuration and troubleshoot webhook delivery issues. Requires owner role to view webhook configurations.
List of webhooks for the repository
GET /sfp/api/repository/webhook/{repositoryIdentifier} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
List of webhooks for the repository
[]
Permanently deletes a webhook for the specified repository. This operation: - Removes the webhook from GitHub, stopping all event deliveries - Deletes the webhook metadata from the SFP database - Does not delete the webhook secret (which may be reused if webhook is recreated)
If no webhook exists for the repository, the operation succeeds silently. This is useful for cleanup operations. Requires owner role to delete webhooks.
The webhook has been successfully deleted
DELETE /sfp/api/repository/webhook/{repositoryIdentifier} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
The webhook has been successfully deleted
No content
Processes incoming GitHub webhook events. This is the endpoint that GitHub calls when events occur in the repository. The endpoint: - Validates the webhook signature using the repository's secret - Extracts event type and delivery ID from GitHub headers - Routes the event to appropriate handlers based on event type - Processes events asynchronously to avoid blocking GitHub
Supported events are automatically handled by registered handlers. This is a public endpoint as it needs to be accessible by GitHub's webhook delivery system. Authentication is performed via webhook signature validation.
The webhook event has been processed successfully
POST /sfp/api/repository/webhook HTTP/1.1
Host:
x-github-event: text
x-github-delivery: text
x-hub-signature-256: text
Accept: */*
The webhook event has been processed successfully
No content
Was this helpful?