- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateWebhookCommand
Creates a new webhook on an Amplify app.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AmplifyClient, CreateWebhookCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, CreateWebhookCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // CreateWebhookRequest
appId: "STRING_VALUE", // required
branchName: "STRING_VALUE", // required
description: "STRING_VALUE",
};
const command = new CreateWebhookCommand(input);
const response = await client.send(command);
// { // CreateWebhookResult
// webhook: { // Webhook
// webhookArn: "STRING_VALUE", // required
// webhookId: "STRING_VALUE", // required
// webhookUrl: "STRING_VALUE", // required
// appId: "STRING_VALUE",
// branchName: "STRING_VALUE", // required
// description: "STRING_VALUE", // required
// createTime: new Date("TIMESTAMP"), // required
// updateTime: new Date("TIMESTAMP"), // required
// },
// };
CreateWebhookCommand Input
See CreateWebhookCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
appId Required | string | undefined | The unique ID for an Amplify app. |
branchName Required | string | undefined | The name for a branch that is part of an Amplify app. |
description | string | undefined | The description for a webhook. |
CreateWebhookCommand Output
See CreateWebhookCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
webhook Required | Webhook | undefined | Describes a webhook that connects repository events to an Amplify app. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | A request contains unexpected data. |
DependentServiceFailureException | server | An operation failed because a dependent service threw an exception. |
InternalFailureException | server | The service failed to perform an operation due to an internal issue. |
LimitExceededException | client | A resource could not be created because service quotas were exceeded. |
NotFoundException | client | An entity was not found during an operation. |
UnauthorizedException | client | An operation failed due to a lack of access. |
AmplifyServiceException | Base exception class for all service exceptions from Amplify service. |