# Configure a webhook in Visual Studio GIT Enterprise

{% hint style="info" %}
After the 25.3.9 release, the structure of the webhook payload URL was updated. Customers need to update the webhook URL in the repository settings of their remote repo. Some customers are still using the old webhook URL containing **autorabitrest**, which should now be replaced with api.

Example:

Old URL: [https://na25.autorabit.com/**autorabitrest/**&#x77;ebhook/triggerSCMPushrequest](https://na25.autorabit.com/autorabitrest/webhook/triggerSCMPushrequest)

Updated URL: [https://na25.autorabit.com/api/webhook/v2/\<OrgName>/trigger-scm-push-request](https://na25.autorabit.com/api/webhook/v2/%3COrgName%3E/trigger-scm-push-request)

Unless you update the Payload URL, you might face pull request/trigger build-on-commit jobs triggering.
{% endhint %}

## A. Create a Webhook API Token from ARM

1. Log in to ARM.
2. Navigate to **Admin Section > API Token**.
3. Click **Create API Token**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FUUgkS5yg0SNY6RhFVvbg%2Fimage.png?alt=media&#x26;token=358e5d4f-62f3-4086-8027-beb39d2c0b98" alt="API Token creation screen in ARM"><figcaption></figcaption></figure>

4. Enter a **Token Name**.
5. Select **Type** as **webhook**.
6. (Optional) Enter a **Description**.
7. Click **Create Option**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FbDIQ9snKOLs8Bsz9VvRU%2Fimage.png?alt=media&#x26;token=c5a64913-4ec9-4dde-91e7-b68377b561af" alt="ARM webhook API token created confirmation screen"><figcaption></figcaption></figure>

8. Your webhook API token is now created.

***

## B. Create a Webhook with Authentication on Visual Studio Git

1. Log in to your Microsoft Visual Studio Git account.
2. Navigate to the project’s **Service Hooks** page:\
   `https://{orgName}/{projectname}/settings/serviceHooks`

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FtbRE1YFLzqHjp4hHrYLC%2Fimage.png?alt=media&#x26;token=681da1de-3153-4510-a5fe-e15b5b162b6a" alt="Service Hooks tab in Visual Studio Git settings"><figcaption></figcaption></figure>

3. Click **Create Subscription**.
4. The wizard will list all services available for integration.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FFqc62BhepSAUC2YtW9s9%2Fimage.png?alt=media&#x26;token=cbc205db-7c7f-478a-9a9c-37980324c2e7" alt="Integration services selection wizard" width="563"><figcaption></figcaption></figure>

5. Click **Next** to view a list of trigger events. Select a trigger and set filters as needed.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fl5I4yMgf6uiTqNpi7yl4%2Fimage.png?alt=media&#x26;token=b5863263-3075-47db-b18b-7d718118dc33" alt="List of webhook trigger events in Visual Studio Git"><figcaption></figcaption></figure>

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FEOzU8yMtZXnqKvbuXR1s%2Fimage.png?alt=media&#x26;token=5d8cd244-de71-4e26-b325-1240d4dcd1a6" alt="Filter configuration options for webhook events"><figcaption></figcaption></figure>

6. Enter the **Payload URL**, which is the endpoint to receive webhook POST requests. Use the URL format:

Example:\
<https://login.autorabit.com/api/webhook/v2/autorabit.com/trigger-scm-push-request>

7. Configure **Basic Authentication**:

* **Username:** Your AutoRABIT login username
* **Password:** Webhook API Token from ARM

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FlAsvwqqzyRRswFt0ntuc%2Fimage.png?alt=media&#x26;token=b2484db2-70d9-4f76-a41f-b98f8dc597f8" alt="Authentication setup for webhook in Visual Studio Git"><figcaption></figcaption></figure>

8. Re-enter your AutoRABIT username and API token to authenticate.

{% hint style="info" %}
**Note:** If you wish to trigger events such as *Pull Request* or *Pull Request Updated*, use the same URL and credentials as configured above.
{% endhint %}

9. Confirm your settings, test the subscription, and finish the wizard.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FwB2jEcHKTEyKsncNeDYZ%2Fimage.png?alt=media&#x26;token=230c02e7-384c-4543-8bb2-55979fb8ae33" alt="Service hook test and confirmation screen" width="563"><figcaption></figcaption></figure>

10. Click **Finish**. The new webhook will be listed under **Service Hooks**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F3BX3rjXiayyy115hotwi%2Fimage.png?alt=media&#x26;token=60229483-132c-4b62-9030-7659f5cc0b72" alt="List of active service hooks in Visual Studio Git"><figcaption></figcaption></figure>

11. After a build is triggered via webhook and completes successfully, refresh the tab to verify success. Use the webhook history to review trigger events and results.

***

## Smart Commits

Define a pattern to associate commits with ALM stories.\
Example:

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FZoL18vQ5kxlJQLmpRtFj%2Fimage.png?alt=media&#x26;token=3d1f8d5c-4fc6-478c-8d34-0d16e2e066d1" alt="Smart commit pattern configuration screen" width="563"><figcaption></figcaption></figure>

To configure a webhook in your repository:

* Enable the **auto update on webhook** checkbox to display the required URL.
* For repository-specific instructions, refer to the [Webhook Guide](file://product-guides/arm/arm-features/webhooks).
* To sync external smart commits, see the [Version Control Repositories Summary](file://product-guides/arm/arm-features/version-control/introduction-to-version-control/version-control-repositories-summary).

***

## For Enterprise Customers

Use the following endpoints for enterprise environments: /api/webhook/v2//enterprise/trigger-scm-push-request /api/webhook/v2//enterprise/sync-alm-commits
