---
title: "Environment"
description: "Environment"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/java/reference/environment"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-04"
---

# Environment

## Environment

A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.

## update

The "Update environment" call will update the details of an existing publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
Call<ResponseBody> response = environment.update(requestBody).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The request body.

## removeParam

Set header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
environment.removeParam("key");
```

Removes query parameters using the key of the request.

## find

The "Get all environments" call fetches the list of all environments available in a stack.

You can add queries to extend the functionality of this API call.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
Call<ResponseBody> response = environment.find().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## fetch

The "Get a single environment" call returns more details about the specified environment of a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
Call<ResponseBody> response = environment.fetch().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## delete

"Delete environment" call will delete an existing publishing environment from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
Call<ResponseBody> response = environment.delete().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## create

The "Add an environment call" will add a publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
Call<ResponseBody> response = environment.create(body).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The request body.

## addParam

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Environment environment = contentstack.stack().environment();
environment.addParam("key", value);
```

Query parameter key for the request.

Query parameter value for the request.

## Environment | Java Management SDK | Contentstack

Environment maps to deployment servers or delivery destinations where your published entries are served in the Java Management SDK.