PutWebhook - CodePipeline


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.


When creating CodePipeline webhooks, do not use your own credentials or reuse the same secret token across multiple webhooks. For optimal security, generate a unique secret token for each webhook you create. The secret token is an arbitrary string that you provide, which GitHub uses to compute and sign the webhook payloads sent to CodePipeline, for protecting the integrity and authenticity of the webhook payloads. Using your own credentials or reusing the same token across multiple webhooks can lead to security vulnerabilities.

Request Syntax

{ "tags": [ { "key": "string", "value": "string" } ], "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.


The tags for the webhook.

Type: Array of Tag objects

Required: No


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 that helps you identify it. You might 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, "tags": [ { "key": "string", "value": "string" } ], "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.


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

Type: ListWebhookItem object


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


Unable to modify the tag due to a simultaneous update request.

HTTP Status Code: 400


The specified resource tags are invalid.

HTTP Status Code: 400


The specified authentication type is in an invalid format.

HTTP Status Code: 400


The specified event filter rule is in an invalid format.

HTTP Status Code: 400


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

HTTP Status Code: 400


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

HTTP Status Code: 400


The tags limit for a resource has been exceeded.

HTTP Status Code: 400


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: