POST /v1/webhook
Deploy code by triggering your Code Manager webhook.
Request format
Unlike other POST
requests, when forming Code Manager API requests to the webhook
endpoint, you must append parameters to the URI path, rather than
using a JSON body. Available parameters include:
type
: Always required. Identifies your Git host.prefix
: Required if your source configuration uses prefixing. Specifies the prefix to use when converting branch names to environment names.token
: Required unless you disabledauthenticate_webhook
in your Code Manager configuration. You must supply the authentication token in thetoken
parameter. Tokens supplied in query parameters might appear in access logs.
For more information and examples for each parameter, refer to Code Manager webhook query parameters.
For example, this request includes the type
and token
parameters:
curl -X POST "https://$(puppet config print server):8170/code-manager/v1/webhook?type=github&token=<TOKEN>"
Response format
When your Code Manager webhook is automatically triggered by a push to the control repo, all responses appear in your Git provider's interface. Code Manager does not give command line responses to automatic webhook triggers.
If you use a curl command to manually trigger the webhook, and your request is well-formed and valid, Code Manager returns an OK response. This only indicates that the request was valid, it does not indicate whether a resulting code deployment succeeded or failed.
Error responses
If an error occurs when the webhook is automatically triggered, check your Git provider interface for error responses. If there is a problem with the webhook, refer to Troubleshoot a Code Manager webhook.
If you use a curl command to manually trigger the webhook, and the request has a
missing or invalid type
, the endpoint returns an
unrecognized-webhook-type error along with a copy of the supplied
type
value and a list of valid type
values.