CreateTestPlan - Create a test plan

Updated at:

Applicable editions

Central edition, Region edition

Service endpoints and authorization information

  • Obtain the service endpoint: use it to replace the {domain} parameter in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organizationId: required only for the Central edition. Go to the Organization Management console > Basic Information page to obtain the organization ID.

Product

Resource

Required permission

Test Management

Test plan

Read/write

Request syntax

Central edition

POST https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testPlans

Region edition

POST https://{domain}/oapi/v1/testhub/testPlans

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Your personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

organizationId.

-

object

body

No

description

string

body

No

The description of the test plan.

Regression test plan covering the login and checkout core flows

endDate

string

body

No

The end date, in yyyy-MM-dd format.

2026-07-17

managerIdentifiers

array[string]

body

Yes

The list of user identifiers of the test plan managers. Required.

["4f8a1b2c3d4e5f6a7b8c9d0e"]

memberIdentifiers

array[string]

body

No

The list of user identifiers of the test plan members.

["1a2b3c4d5e6f7a8b9c0d1e2f"]

name

string

body

Yes

The name of the test plan.

Regression test plan

projectIdentifier

string

body

No

The unique identifier of the associated project. Optional.

5f3a2b1c4d5e6f7a8b9c0d1e2f

scope

string

body

No

The visibility scope: public or private. Default: public. Valid values: [public private].

public

sprintIdentifier

string

body

No

The unique identifier of the associated iteration. Optional; when provided, projectIdentifier must also be provided, and the iteration must belong to that project.

6a1b2c3d4e5f6a7b8c9d0e1f2a

startDate

string

body

No

The start date, in yyyy-MM-dd format.

2026-07-13

versionIdentifiers

array[string]

body

No

The list of unique identifiers of associated versions. Multiple values allowed. Optional.

["7b2c3d4e5f6a7b8c9d0e1f2a3b"]

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testPlans' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "description": "Regression test plan covering the login and checkout core flows",
        "endDate": "2026-07-17",
        "managerIdentifiers": ["4f8a1b2c3d4e5f6a7b8c9d0e"],
        "memberIdentifiers": ["1a2b3c4d5e6f7a8b9c0d1e2f"],
        "name": "Regression test plan",
        "projectIdentifier": "5f3a2b1c4d5e6f7a8b9c0d1e2f",
        "scope": "public",
        "sprintIdentifier": "6a1b2c3d4e5f6a7b8c9d0e1f2a",
        "startDate": "2026-07-13",
        "versionIdentifiers": ["7b2c3d4e5f6a7b8c9d0e1f2a3b"]
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/testPlans' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "description": "Regression test plan covering the login and checkout core flows",
        "endDate": "2026-07-17",
        "managerIdentifiers": ["4f8a1b2c3d4e5f6a7b8c9d0e"],
        "memberIdentifiers": ["1a2b3c4d5e6f7a8b9c0d1e2f"],
        "name": "Regression test plan",
        "projectIdentifier": "5f3a2b1c4d5e6f7a8b9c0d1e2f",
        "scope": "public",
        "sprintIdentifier": "6a1b2c3d4e5f6a7b8c9d0e1f2a",
        "startDate": "2026-07-13",
        "versionIdentifiers": ["7b2c3d4e5f6a7b8c9d0e1f2a3b"]
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

id.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For more information, see the error code center for API-related error codes.