Webhooks

Create webhook

Creates a new webhook for a stack. The webhook secret is auto-generated and only returned in the creation response. Requires admin role.

post/api/webhooks

Request body

namestring required
stack_namestring required

Target stack name.

action'deploy' | 'restart' | 'stop' | 'start' | 'pull' | 'git-pull' required

Action to execute when the webhook is triggered. git-pull requires a Git source attached to the stack.

enabledboolean
node_idinteger

Node the webhook executes against. Defaults to the request's resolved node or the default node.

Example request

{
  "name": "GitHub Deploy Hook",
  "stack_name": "my-app"
}

Response

Webhook created. The secret field is the HMAC signing key; save it now.

idinteger required
secretstring required

HMAC-SHA256 signing secret. Store securely; this is the only time it's returned in full.

Changes

Changed in 3 of the 36 revisions of this API.48

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 400

      response-property-enum-value-removed

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 403

      response-property-enum-value-removed

    • removed the ADMIRAL_REQUIRED enum value from the code response property for the response status 500

      response-property-enum-value-removed

  • 3e94162e8e6412See the full diff
    • the name request property's maxLength was set to 100

      request-property-max-length-set

    • added the new optional request property node_id

      new-optional-request-property

    • added the new git-pull enum value to the request property action

      request-property-enum-value-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 400

      response-property-enum-value-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 403

      response-property-enum-value-added

    • added the new PAID_REQUIRED enum value to the code response property for the response status 500

      response-property-enum-value-added

    • removed the PRO_REQUIRED enum value from the code response property for the response status 400

      response-property-enum-value-removed

    • removed the PRO_REQUIRED enum value from the code response property for the response status 403

      response-property-enum-value-removed

    • removed the PRO_REQUIRED enum value from the code response property for the response status 500

      response-property-enum-value-removed