> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/split-api-reference/environments.md).

# Environments

## Get Environments

> Get a list of environments.

```json
{"openapi":"3.1.0","info":{"title":"Harness FME Admin API","version":"2"},"tags":[{"name":"Environments"}],"servers":[{"url":"https://api.split.io/internal/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Admin API Key, sent as `Authorization: Bearer <ADMIN_API_KEY>`"}}},"paths":{"/environments/ws/{workspace-id}":{"get":{"summary":"Get Environments","description":"Get a list of environments.","operationId":"get-environments","parameters":[{"in":"path","name":"workspace-id","schema":{"type":"string"},"required":true,"description":"The ID of the project (workspace) you want to get an environment from. After migration to Harness, get this value using the [Get Projects (Workspaces)](https://docs.split.io/reference/get-workspaces#/) endpoint and the Harness project name."}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0}}}}}}},"deprecated":false,"tags":["Environments"]}}}}
```

## Create Environments

> Creates an environment. Provide environment details in the JSON body; no query parameters are required.

```json
{"openapi":"3.1.0","info":{"title":"Harness FME Admin API","version":"2"},"tags":[{"name":"Environments"}],"servers":[{"url":"https://api.split.io/internal/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Admin API Key, sent as `Authorization: Bearer <ADMIN_API_KEY>`"}}},"paths":{"/environments/ws/{workspace-id}":{"post":{"summary":"Create Environments","description":"Creates an environment. Provide environment details in the JSON body; no query parameters are required.","operationId":"create-environment","parameters":[{"name":"Content-Type","in":"header","schema":{"type":"string","default":"application/json"}},{"in":"path","name":"workspace-id","schema":{"type":"string"},"required":true,"description":"The ID of the project (workspace) you want to create an FME environment in. After migration to Harness, get this value using the [Get Projects (Workspaces)](https://docs.split.io/reference/get-workspaces#/) endpoint and the Harness project name."}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"type":"string","description":"JSON object that contains the name of the FME environment","format":"json"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"production":{"type":"boolean","default":true},"environmentType":{"type":"string"},"orgId":{"type":"string"},"status":{"type":"string"},"workspaceIds":{"type":"array","items":{"type":"string"}},"creationTime":{"type":"integer","default":0},"apiTokens":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"apiKeyType":{"type":"string"}}}},"changePermissions":{"type":"object","properties":{"allowKills":{"type":"boolean","default":true},"areApprovalsRequired":{"type":"boolean","default":true},"areApproversRestricted":{"type":"boolean","default":true},"approvers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}}},"areEditorsRestricted":{"type":"boolean","default":true},"editors":{}}},"dataExportPermissions":{"type":"object","properties":{"areExportersRestricted":{"type":"boolean","default":true},"exporters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}}}}}}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0}}}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}}},"deprecated":false,"tags":["Environments"]}}}}
```

## Delete Environments

> Deletes an environment

```json
{"openapi":"3.1.0","info":{"title":"Harness FME Admin API","version":"2"},"tags":[{"name":"Environments"}],"servers":[{"url":"https://api.split.io/internal/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Admin API Key, sent as `Authorization: Bearer <ADMIN_API_KEY>`"}}},"paths":{"/environments/ws/{workspace-id}/{environment-name-or-id}":{"delete":{"summary":"Delete Environments","description":"Deletes an environment","operationId":"delete-environment","parameters":[{"in":"path","name":"workspace-id","schema":{"type":"string"},"required":true,"description":"The ID of the project (workspace) you want to delete the environment from. After migration to Harness, get this value using the [Get Projects (Workspaces)](https://docs.split.io/reference/get-workspaces#/) endpoint and the Harness project name."},{"in":"path","name":"environment-name-or-id","schema":{"type":"string"},"required":true,"description":"The FME environment name or ID"}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0}}}}}}},"deprecated":false,"tags":["Environments"]}}}}
```

## Update Environments

> Updates an environment.

```json
{"openapi":"3.1.0","info":{"title":"Harness FME Admin API","version":"2"},"tags":[{"name":"Environments"}],"servers":[{"url":"https://api.split.io/internal/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Admin API Key, sent as `Authorization: Bearer <ADMIN_API_KEY>`"}}},"paths":{"/environments/ws/{workspace-id}/{environment-name-or-id}":{"patch":{"summary":"Update Environments","description":"Updates an environment.","operationId":"update-environment","parameters":[{"in":"path","name":"workspace-id","schema":{"type":"string"},"required":true,"description":"The ID of the project (workspace) you want to update the environment from. After migration to Harness, get this value using the [Get Projects (Workspaces)](https://docs.split.io/reference/get-workspaces#/) endpoint and the Harness project name."},{"in":"path","name":"environment-name-or-id","schema":{"type":"string"},"required":true,"description":"The FME environment name or ID"}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["update_environment"],"properties":{"update_environment":{"type":"string","description":"JSON object that contains the attributes of an FME environment to be updated in JsonPatch format","format":"json"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"production":{"type":"boolean","default":true},"environmentType":{"type":"string"},"orgId":{"type":"string"},"status":{"type":"string"},"workspaceIds":{"type":"array","items":{"type":"string"}},"creationTime":{"type":"integer","default":0},"changePermissions":{"type":"object","properties":{"allowKills":{"type":"boolean","default":true},"areApprovalsRequired":{"type":"boolean","default":true},"areApproversRestricted":{"type":"boolean","default":true},"approvers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}}},"areEditorsRestricted":{"type":"boolean","default":true},"editors":{}}},"dataExportPermissions":{"type":"object","properties":{"areExportersRestricted":{"type":"boolean","default":true},"exporters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}}}}}}}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}},"409":{"description":"409","content":{"application/json":{"schema":{"type":"object","properties":{"changeRequests":{"type":"string"},"editorRestrictions":{"type":"string"}}}}}},"500":{"description":"500","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","default":0},"message":{"type":"string"},"details":{"type":"string"},"transactionId":{"type":"string"}}}}}}},"deprecated":false,"tags":["Environments"]}}}}
```
