UpdateAppStackWebhook - Update AppStack Webhook

Updated at:

Updates the configuration of an AppStack Webhook.

Applicable editions

Central Edition, Region Edition

Prerequisites

  • Obtain the service endpoint: Replace the {domain} placeholder in the API request syntax.
  • Obtain a Personal Access Token.
  • Obtain the organization ID: Required for Central Edition only. You can find your organization ID on the Basic Information page of the organization management console.

Product

Resource

Required permissions

application delivery

webhook

Read/Write

Request syntax

Central Edition

POST https://{domain}/oapi/v1/appstack/organizations/{organizationId}/hook/{sn}/api

Region Edition

POST https://{domain}/oapi/v1/appstack/hook/{sn}/api

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your personal access token from Alibaba Cloud DevOps.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

In

Required

Description

Example

organizationId

string

path

  • Yes (for Central Edition)

  • No (for Region Edition)

The organization ID.

ec766e6xxxxxxxxxx34d6exe671

sn

string

path

Yes

The unique identifier of the webhook.

c263a6749757xxxxxxx842f45f2f80e

-

object

body

No

The request body for updating the AppStack Webhook.

description

string

body

Yes

A description of the webhook. The description can be up to 256 characters long.

test-webhook

events

array

body

Yes

The list of events.

-

object

body

No

An event object.

action

string

body

Yes

The action that triggers the webhook. Supported actions, which vary by event type, include Create, Delete, Update, and StatusUpdate.

Create

event

string

body

Yes

The type of event that triggers the webhook. Supported types include AppOrchestration, ChangeOrder, ChangeRequest, Env, ReleaseStageExecution, VariableGroup, and App.

App

scopeId

string

body

Yes

The ID of the scope.

my-org-id,my-app-name

scopeType

string

body

Yes

The type of the scope. Valid values: ORGANIZATION and APP.

ORGANIZATION

sn

string

body

Yes

The unique identifier of the webhook.

c263a6749xxxxx2f45f2f80e

spec

object

body

Yes

The specification of the webhook.

token

string

body

No

The token for the webhook. The token can be up to 128 characters long.

type

string

body

Yes

The type of the webhook.

WEBHOOK

url

string

body

Yes

The destination URL for webhook notifications, up to 1,024 characters long.

https://devops.aliyun.com/appstack/setting/webhooks

type

string

body

Yes

The type of the webhook.

WEBHOOK

Request examples

Central Edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e6xxxxxxxxxx34d6exe671/hook/c263a6749757xxxxxxx842f45f2f80e/api' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "description": "test-webhook",
        "events": [
            {
                "action": "Create",
                "event": "App"
            }
        ],
        "scopeId": "my-org-id,my-app-name",
        "scopeType": "ORGANIZATION",
        "sn": "c263a6749xxxxx2f45f2f80e",
        "spec": {
            "token": "",
            "type": "WEBHOOK",
            "url": "https://devops.aliyun.com/appstack/setting/webhooks"
        },
        "type": "WEBHOOK"
    }'

Region Edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/appstack/hook/c263a6749757xxxxxxx842f45f2f80e/api' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "description": "test-webhook",
        "events": [
            {
                "action": "Create",
                "event": "App"
            }
        ],
        "scopeId": "my-org-id,my-app-name",
        "scopeType": "ORGANIZATION",
        "sn": "c263a6749xxxxx2f45f2f80e",
        "spec": {
            "token": "",
            "type": "WEBHOOK",
            "url": "https://devops.aliyun.com/appstack/setting/webhooks"
        },
        "type": "WEBHOOK"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

The AppStack Webhook configuration.

description

string

The description of the webhook.

Test

disabledExpired

string

The timestamp for when the webhook's disabled status expires.

enabled

boolean

Indicates whether the webhook is enabled.

true

events

array

The list of events.

-

object

An event object.

action

string

The event action.

Create

event

string

The event type.

App

scopeId

string

The ID of the scope.

my-org-id,my-app-name

scopeType

string

The type of the scope. Valid values: ORGANIZATION and APP.

ORGANIZATION

sn

string

The unique identifier of the webhook.

c263a6749757xxxxxx2f45f2f80e

spec

object

The specification of the webhook.

token

string

The token for the webhook.

type

string

The type of the webhook.

WEBHOOK

url

string

The destination URL for webhook notifications.

https://devops.aliyun.com/appstack/setting/webhooks

timeout

integer

The timeout period, in seconds.

3

type

string

The type of the webhook.

WEBHOOK

Response example

{
    "description": "Test",
    "disabledExpired": "",
    "enabled": true,
    "events": [
        {
            "action": "Create",
            "event": "App"
        }
    ],
    "scopeId": "my-org-id,my-app-name",
    "scopeType": "ORGANIZATION",
    "sn": "c263a6749757xxxxxx2f45f2f80e",
    "spec": {
        "token": "",
        "type": "WEBHOOK",
        "url": "https://devops.aliyun.com/appstack/setting/webhooks"
    },
    "timeout": 3,
    "type": "WEBHOOK"
}

Error codes

For a list of API error codes, see the Error Code Center.