Edit
- PATCH
- /workspaces
- /:workspace
- /projects
- /:project_name
- /environments
- /:environment_id
Edits an environment in the project.
Example:
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/projects/:project_name/environments/:environment_id" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"identifier": "stage_env",
"name": "Staging environment",
"type": "STAGE",
"tags": [
"staging",
"tag1"
],
"public_url": "http://staging.com",
"variables": [
{
"key": "myVar1",
"value": "myValue1",
"type": "VAR",
"settable": true,
"encrypted": false,
"description": "some variable1"
},
{
"key": "myVar2",
"value": "myValue2",
"type": "VAR",
"settable": true,
"encrypted": false,
"description": "some variable2"
}
],
"permissions": {
"others": "DENIED",
"users": [
{
"id": 1,
"access_level": "MANAGE"
}
],
"groups": [
{
"id": 2,
"access_level": "USE_ONLY"
}
]
},
"all_pipelines_allowed": false,
"allowed_pipelines": [
{
"id": 1
}
]
}'
EXAMPLE RESPONSE{ "url": "https://api.buddy.works/workspaces/buddy/projects/company-website", "html_url": "https://app.buddy.works/buddy/company-website/environments/environment/9DBbgP4q", "id": "9DBbgP4q", "name": "Staging environment", "identifier": "stage_env", "type": "STAGE", "tags": [ "staging", "tag1" ], "public_url": "http://staging.com", "all_pipelines_allowed": false, "allowed_pipelines": [ { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/1", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/1", "id": 1, "name": "Tests" } ], "project": { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website", "html_url": "https://app.buddy.works/buddy/company-website", "name": "company-website", "display_name": "Company Website", "status": "ACTIVE" }, "variables": [ { "id": 1, "key": "myVar1", "value": "myValue1", "type": "VAR", "settable": true, "description": "some variable1" }, { "id": 2, "key": "myVar2", "value": "myValue2", "type": "VAR", "settable": true, "description": "some variable2" } ], "permissions": { "others": "DENIED", "users": [ { "id": 1, "access_level": "MANAGE" } ], "groups": [ { "id": 422, "access_level": "USE_ONLY" } ] } }
STATUS201 Created
LIMITSX-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999