Skip to main content
Use this endpoint to link your GitHub repository to your Virtus Cloud application. Once configured, every push to the repository will automatically trigger a new deployment. The API registers a webhook in your GitHub repository using the access token you provide, and returns the resulting webhook URL for your records.

Endpoint

POST https://api.virtuscloud.app/v2/apps/{app_id}/deploy/webhook

Authorization

Include your API key in the request header:
Authorization: <api_key>

Path Parameters

app_id
string
required
The unique identifier of your application. You can find this in the URL of your application’s dashboard.

Body Parameters

access_token
string
required
A GitHub Personal Access Token (classic) with repo scope permissions. Virtus Cloud uses this token to register the webhook in your repository on your behalf. Generate one at GitHub Tokens (Classic).

Response

status
string
Indicates the outcome of the request. Returns "success" when the webhook has been registered successfully.
message
string
A human-readable message describing the result of the operation.
response
object
An object containing details about the newly created webhook.

Examples

curl --request POST \
  --url "https://api.virtuscloud.app/v2/apps/{app_id}/deploy/webhook" \
  --header "Authorization: <api_key>" \
  --header "Content-Type: application/json" \
  --data '{
    "access_token": "ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }'

Response Example

{
  "status": "success",
  "response": {
    "webhook": "https://api.virtuscloud.app/v2/git/webhook/<webhook-code>"
  }
}
Store your GitHub Personal Access Token securely and never commit it to source control. The token is used only during registration — Virtus Cloud does not store it after the webhook is created.
To verify the webhook is active, use the Current Deploy endpoint to retrieve the registered webhook URL, then confirm it appears in your GitHub repository’s Settings → Webhooks page.