UpdateVariableGroup - Update a variable group

Updated at:

Updates a variable group using OpenAPI.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Obtain an endpoint: Replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • organizationId: Required only for the Central edition. You can obtain the Organization ID from the Basic Information page in the Organization Management console.

Product

Resource

Required permission

Pipeline

Variable group

Read and write

Request syntax

Central edition

PUT https://{domain}/oapi/v1/flow/organizations/{organizationId}/variableGroups/{id}

Region edition

PUT https://{domain}/oapi/v1/flow/variableGroups/{id}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

A personal access token.

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

Request parameters

Parameter

Type

Position

Required

Description

Example

organizationId

string

path

  • Yes. This is the Central edition.

  • No: Dedicated edition

The organization ID.

5ebbc0228123212b59xxxxx

id

integer

path

Yes

The variable group ID.

123

name

string

query

Yes

The name of the variable group.

Variable Group

description

string

query

No

The description of the variable group.

Variable group description

variables

string

query

Yes

A JSON string that contains the variable information. `isEncrypted` specifies whether to encrypt the variable. `name` is the name of the variable. `value` is the value of the variable.

[{"isEncrypted":true,"name":"name1","value":"vaue1"}]

Request examples

Central edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/variableGroups/123?name=Variable%20Group&description=Variable%20group%20description&variables=[{"isEncrypted":true,"name":"name1","value":"vaue1"}]' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/flow/variableGroups/123?name=Variable%20Group&description=Variable%20group%20description&variables=[{"isEncrypted":true,"name":"name1","value":"vaue1"}]' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

boolean

Indicates whether the request was successful.

true

Response example

true

Error codes

For more information, see the Error Code Center.