AWS CodePipeline
API Reference (API Version 2015-07-09)

PutWebhook

Defines a webhook and returns a unique webhook URL generated by CodePipeline. This URL can be supplied to third party source hosting providers to call every time there's a code change. When CodePipeline receives a POST request on this URL, the pipeline defined in the webhook is started as long as the POST request satisfied the authentication and filtering requirements supplied when defining the webhook. RegisterWebhookWithThirdParty and DeregisterWebhookWithThirdParty APIs can be used to automatically configure supported third parties to call the generated webhook URL.

Request Syntax

{ "webhook": { "authentication": "string", "authenticationConfiguration": { "AllowedIPRange": "string", "SecretToken": "string" }, "filters": [ { "jsonPath": "string", "matchEquals": "string" } ], "name": "string", "targetAction": "string", "targetPipeline": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

webhook

The detail provided in an input file to create the webhook, such as the webhook name, the pipeline name, and the action name. Give the webhook a unique name which identifies the webhook being defined. You may choose to name the webhook after the pipeline and action it targets so that you can easily recognize what it's used for later.

Type: WebhookDefinition object

Required: Yes

Response Syntax

{ "webhook": { "arn": "string", "definition": { "authentication": "string", "authenticationConfiguration": { "AllowedIPRange": "string", "SecretToken": "string" }, "filters": [ { "jsonPath": "string", "matchEquals": "string" } ], "name": "string", "targetAction": "string", "targetPipeline": "string" }, "errorCode": "string", "errorMessage": "string", "lastTriggered": number, "url": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

webhook

The detail returned from creating the webhook, such as the webhook name, webhook URL, and webhook ARN.

Type: ListWebhookItem object

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidWebhookAuthenticationParametersException

The specified authentication type is in an invalid format.

HTTP Status Code: 400

InvalidWebhookFilterPatternException

The specified event filter rule is in an invalid format.

HTTP Status Code: 400

LimitExceededException

The number of pipelines associated with the AWS account has exceeded the limit allowed for the account.

HTTP Status Code: 400

PipelineNotFoundException

The specified pipeline was specified in an invalid format or cannot be found.

HTTP Status Code: 400

ValidationException

The validation was specified in an invalid format.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: