Webhooks

P4 Code Review can send outbound webhook notifications to external services when selected review activity occurs. Use webhooks to connect P4 Code Review to automation, ticketing systems, chat tools, audit pipelines, or AI-based review services.

A webhook sends an HTTP POST request to a URL that you configure. Each request includes a structured JSON payload that describes the event, along with headers that help the receiving service identify the event, verify the request signature, and deduplicate retries.

In the initial release, administrators can subscribe webhooks to a curated set of review and comment events, including a specialized event for replies to reviewer comments.

This feature sends outbound HTTP notifications from P4 Code Review to external systems.

It does not provide inbound webhooks or browser-side real-time updates.

How webhooks are applied

  • An admin or super user creates a webhook on the Webhooks page.

  • The admin attaches the webhook to one or more workflows.

  • Projects use those workflows through the existing workflow configuration.

  • When a matching event occurs in a review, P4 Code Review resolves the review's affected projects and workflows, finds the matching webhooks, and queues delivery.

Think of webhooks as workflow-level automation. If you want the same webhook behavior across multiple projects, attach the webhook to a shared workflow instead of duplicating configuration.

Only users with admin or super privileges can view the Webhooks page and create, edit, test, or delete webhooks.

Create and configure a webhook

  1. In the P4 Code Review navigation pane, click Webhooks.

  2. In the top right corner of the Webhooks page, click + Add Webhook Definition.

  3. In the Add Webhook Definition window, in Name, enter a unique name for the workflow and click Create.

  4. You are navigated to the Webhook configuration page, where you can configure the workflow using the following tabs:

    • General Settings
    • Workflows
    • Deliveries

Webhook general settings

In the Webhook general settings tab, configure the following:

  • Name: Enter a unique name for the webhook.

  • Description: (Optional) Add a description for the webhook.

  • Events: The event types that trigger delivery. For a list of available events, see Supported webhook events.

  • Enabled: Turns webhook delivery on or off. Disabled webhooks remain configured but do not send requests when events occur.

  • Request timeout: The maximum amount of time, in seconds, that P4 Code Review waits for a response from the target service before considering the request unsuccessful..

  • URL: The HTTPS endpoint that receives webhook requests. When a selected event occurs, P4 Code Review sends an HTTP request containing event information to this URL.

    • Disable SSL verification: Controls whether P4 Code Review verifies the SSL/TLS certificate presented by the target endpoint. Leave this unselected unless you are connecting to a trusted system with a certificate that cannot be validated.

  • Authentication headers: Headers used to authenticate with the receiving service. For example, some services require an API key or bearer token before they accept webhook requests.

  • Custom headers: Additional HTTP headers required by the receiving service. Use custom headers to provide extra information or meet the requirements of a specific integration.

  • Secret: The shared secret P4 Code Review uses to sign each request.

Click Save Changes to make the configuration take effect.

Supported webhook events

  • review.created

  • review.updated

  • review.status.changed

  • review.vote.cast

  • review.submitted

  • comment.created

  • comment.created.reply.toReviewer

  • comment.reacted

  • ping for test delivery

The webhook framework supports future expansion. New event types can be added in future releases without requiring configuration changes.

Special event: Reply to reviewer comment

The comment.created.reply.toReviewer event is triggered only when all of the following conditions are met:

  • A user adds a new comment.

  • The new comment is a reply to an existing comment.

  • The author of the original comment is a reviewer on the review.

Use this event to notify external systems about reviewer-focused follow-up discussions without processing every comment on a review.

Special event: Reaction to a comment

The comment.reacted event is triggered when a user adds a reaction to a comment on a review. A delivery fires for each individual reaction added.

The event fires when all of the following conditions are met:

  • A user adds a reaction (such as a thumbs-up or emoji) to an existing comment.

  • The reaction is being added, not removed. Removing a reaction does not trigger a delivery.

The payload includes the following reaction-specific fields:

Field Description

commentId

The ID of the comment that received the reaction.

reviewId

The ID of the review containing the comment

reactedBy

The username of the user who added the reaction.

reaction

The reaction type, for example like.

reactionsCount

The total number of reactions of this type on the comment after the reaction was added.

comment

The text of the comment that was reacted to.

Use this event to notify external systems (such as AI review services or audit pipelines) when reviewers engage with comments, without processing every comment creation event.

A comment.reacted delivery fires for every individual reaction.

A comment that receives many reactions generates one delivery per reaction. Plan your endpoint's throughput accordingly.

Workflow settings

This tab displays the workflows that are using this webhook. Webhooks are assigned to a workflow in the workflow settings page.

To add a webhook to a workflow:

  1. In the P4 Code Review navigation pane, click Workflows.

  2. Click on the workflow you want to add a webhook to.

  3. Click the Webhooks tab.

  4. Click + Add Webhook. This activates several fields to configure for the test.

  5. Select a webhook from the Webhook dropdown.

Test a webhook

Test a webhook using the Deliveries tab in the webhook configuration page.

Use the Test action to send a synthetic ping event to the configured endpoint. This helps you verify network reachability, authentication, signature validation, and endpoint behavior before you rely on live events.

View delivery history

Tthe Deliveries tab also contains a delivery history for the webhook. Delivery records show key details such as:

  • Event type.

  • Timestamp.

  • HTTP status.

  • Attempt count.

  • Last error.

If a delivery fails, an admin can redeliver it from the history view.