CreateVersion - Create a version

Updated at:

Creates a version in a project.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Get a personal access token.
  • Get organizationId: Required for Central edition only. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Project Collaboration

Version

Read and write

Request syntax

Central edition

POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/{id}/versions

Region edition

POST https://{domain}/oapi/v1/projex/projects/{id}/versions

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

id

string

path

Yes

Unique project identifier.

589c53d622cc8521793e08****

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

-

object

body

No

name

string

body

Yes

Version name.

operatorId

string

body

No

User ID of the operator. Ignored when a personal access token is used.

user-xxx

owners

array[string]

body

Yes

Owner user IDs.

publishDate

string

body

No

Release date.

startDate

string

body

No

Start date.

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/projects/589c53d622cc8521793e08****/versions' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "",
        "operatorId": "user-xxx",
        "owners": [
            
        ],
        "publishDate": "",
        "startDate": ""
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/projects/589c53d622cc8521793e08****/versions' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "",
        "operatorId": "user-xxx",
        "owners": [
            
        ],
        "publishDate": "",
        "startDate": ""
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

Version ID.

1111

Response example

{
    "id": "1111"
}

Error codes

For API-related error codes, see the Error Code Center.