patch https://app.vwo.com/api/v2/accounts//projects/
Request URL for Workspace
PATCH /accounts/account_id/projects/project_id
Request Payload Schema Format
{
"name": "Project Name",
"languages": [
"NODEJS",
"PYTHON",
"PHP",
"JAVA",
"DOTNET",
"RUBY",
"GO",
"JAVASCRIPT"
],
"environments": [
{
"id": 1,
"name": "Staging",
"isEnabled": true
},
{
"id": 2,
"name": "Production",
"isEnabled": false
}
]
}
Key Rules
- All fields (
name
,languages
,environments
) are mandatory in the payload. - Partial updates are not supported. You must always send the full updated state of the project.
- Environments behave like a full replacement. Any environment not included in the payload will be considered deleted.
- New environments are created when an
ID
is passed that does not match the existing ones. - The
isEnabled
flag in environments is used to indicate the default or active environment. It does not affect existence.
Example Use Cases
- No Change Update
If you’re not changing anything but still calling the update API, you must send all current values to avoid unintentional data loss.If you only passed{ "name": "Acme Project", "languages": ["DOTNET", "RUBY"], "environments": [ { "id": 1, "name": "Staging", "isEnabled": true }, { "id": 2, "name": "Production", "isEnabled": false } ] }
"GO"
in the list, it would replace the entire language list, removing"DOTNET"
and"RUBY"
. - Add a New Language
If the project currently has["DOTNET", "RUBY"]
and you want to add"GO"
, you must provide all languages:{ "name": "Acme Project", "languages": ["DOTNET", "RUBY", "GO"], "environments": [ { "id": 1, "name": "Staging", "isEnabled": true }, { "id": 2, "name": "Production", "isEnabled": false } ] }
- Remove an Environment
To remove an environment (e.g.,Production
), simply omit it from the list:This would delete the{ "name": "Acme Project", "languages": ["DOTNET", "RUBY"], "environments": [ { "id": 1, "name": "Staging", "isEnabled": true } ] }
Production
environment. - Replace an Environment
To replace an environment, pass an environment object with a new ID. The system will delete the old one and create the new one.In this case, the environment with{ "name": "Acme Project", "languages": ["DOTNET", "RUBY"], "environments": [ { "id": 1, "name": "Staging", "isEnabled": false }, { "id": 3, "name": "Testing", "isEnabled": true } ] }
id: 2 (Production)
will be deleted, and a new one(id: 3, Testing)
will be added.
Notes
- Always pass the complete current state of the
name
,languages
andenvironments
lists.- Omitting an environment or language will remove it permanently.
isEnabled
only affects whether an environment is considered the default one which linking a project in a campaign, and does not impact its presence in the system.