PutWebhook - CodePipeline

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

{ "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.

tags

The tags for the webhook.

Type: Array of Tag objects

Required: No

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 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.

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.

ConcurrentModificationException

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

HTTP Status Code: 400

InvalidTagsException

The specified resource tags are invalid.

HTTP Status Code: 400

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 pipeline was specified in an invalid format or cannot be found.

HTTP Status Code: 400

TooManyTagsException

The tags limit for a resource has been exceeded.

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: