Create a test environment, such as UAT or Staging, in a Jira space. Use the environment when recording test execution or filtering results in Vansah.
Before you begin
Create a Vansah API token and use the Vansah URL supplied for your workspace.
The token account must be a Jira administrator or a space administrator for the destination Jira space.
Choose a name not already used by another active environment in that space.
The examples use Bash and cURL. Set VANSAH_URL to your Vansah base URL without a trailing slash and VANSAH_TOKEN to your API token. Replace DEMO with your Jira space key. Keep your token private.
Endpoint and headers
POST /api/v2/properties/environment
Header | Value |
| Your Vansah API token, without a |
|
|
|
|
1. Prepare the request
Body field | What to send |
| Required string, 1–255 characters. Use a plain-text environment name, for example |
| The Jira space key, for example |
The space context can also be supplied using the projectKey query parameter. This create endpoint allows up to 50 active environment records per Jira space.
Example JSON body:
{
"name": "UAT",
"project": {
"key": "DEMO"
}
}
2. Create the environment
curl --request POST \
--url "$VANSAH_URL/api/v2/properties/environment" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"name":"UAT","project":{"key":"DEMO"}}'
Example successful response:
{
"success": true,
"message": "Updated successfully",
"data": {
"identifier": "f94d0e7d-1edb-41ed-bdf2-ae827922bf87",
"name": "UAT"
}
}
Response field | Meaning |
|
|
| A summary of the outcome. |
| The new environment’s UUID. Save it for API requests that require an environment identifier. |
| The saved environment name. |
3. Confirm the environment
List the environments in the same Jira space:
curl --request GET --get \
--url "$VANSAH_URL/api/v2/properties/environments" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "startAt=0"
Find the new name and identifier in data. See List Test Environments (API) for pagination and result-filter examples. To change the name later, use Update an Environment (API).
Troubleshooting
Message or issue | What to check |
| Inspect |
| List the space’s environments and reuse the existing environment, or choose a different name. |
| Review the existing environments before adding another. |
| Include the correct |
Authentication or permission error | Check the Vansah URL, token, Jira space key, and the token account’s administrator permissions. |
| Check the environment list before retrying. If the issue continues, contact Vansah Support with the request and response, without your token. |
Example duplicate-name response:
{
"success": false,
"errorCode": 1390,
"message": "Duplicate environment(UAT)",
"data": []
}
You can also view this request in the Vansah API collection in Postman.
