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

# Contentstack

## Contentstack

A [stack](/docs/headless-cms/about-stack) is a repository or a container that holds all the [entries](/docs/headless-cms/about-entries)/[assets](/docs/headless-cms/about-assets) of your site. It allows multiple users to [create](/docs/headless-cms/create-an-entry), [edit](/docs/headless-cms/edit-an-entry), [approve](/docs/headless-cms/send-an-entry-for-publish-or-unpublish-approval), and [publish](/docs/headless-cms/publish-an-entry) their content within a single space.

The stack function initializes an instance of the Stack. To initialize a stack execute the following code:

## stack

A stack method provides access to the stack of your site. It allows users to get the content within a single space.

```
import com.contentstack.sdk.*;
 
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
Example with Config:

import com.contentstack.sdk.*; 

Config config = new Config().setHost("api.contentstack.io");
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
```

API Key of your application on Contentstack

Delivery Tokens retrieves only the published entries of the environment with which it is associated

A publishing environment refers to one or more deployment servers or a content delivery destination (Webpage’s address) where you will publish your content ([entries](/docs/headless-cms/about-entries) or [assets](/docs/headless-cms/about-assets)).

Config instance to set environment and other configuration details.

## Contentstack

## Contentstack | Java Delivery SDK | Contentstack

Contentstack initializes a Stack instance in the Java Delivery SDK, the repository that holds and serves your entries and assets.