---
title: "Stack"
description: "Stack"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/python/reference/stack"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-22"
---

# Stack

## Stack

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

The stack function initializes an instance of the “Stack”.

## accept_ownership

The accept\_ownership method allows the user to take control of the stack.

```
import contentstack_management
client = contentstack.ContentstackClient(authtoken='the_authtoken')
response = client.stack('api_key').accept_ownership('user_id', 'ownership_token')
```

UID of the user

The ownership token received via email by another user.

## assets

Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use. The assets method retrieves a specific asset in the stack

```
import contentstack_management
client = contentstack_management.Client(authtoken="auth_token")
assets = client.stack(api_key).assets()
```

UID of the asset

Branch where the asset is added

## auditlog

A auditLog displays a record of all the activities performed in a stack and helps you keep a track of all published items, updates, deletes, and current status of the existing content.

```
import contentstack_management
client = contentstack_management.Client(authtoken="auth_token")
response = client.stack(api_key).auditlog()
```

UID of the item

## branch

Branch corresponds to Stack branch.

```
import contentstack_management
client = contentstack_management.Client(authtoken="auth_token")
response = client.stack(api_key).branch()
```

UID of the branch

## branch_alias

Branch alias corresponds to the alias of that branch.

```
import contentstack_management
client = contentstack_management.Client(authtoken="auth_token")
response = client.stack(api_key).branch_alias()
```

UID of the alias

## content_types

Content type defines the structure or schema of a page or a section of your web or mobile property.

```
import contentstack_management
client = contentstack_management.Client(authtoken="auth_token")
response = client.stack(api_key).content_types()
```

UID of the content type

## create

The create method creates a new stack.

```
data = {
   "stack": {
        "name": "My New Stack",
        "description": "My new test stack",
        "master_locale": "en-us"
        }
     }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack().create('organization_uid', data).json()
```

UID of the organization

The request body.

## create_settings

The create\_settings method creates stack settings

```
data = {
           "stack_settings": {
               "stack_variables": {
                   "enforce_unique_urls": 'true',
                   "sys_rte_allowed_tags": "style,figure,script",
                   "sys_rte_skip_format_on_paste": "GD:font-size"
              },
               "rte": {
                   "cs_only_breakline": 'true'
               }
           }
       }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').create_stack_settings(data).json()
```

The request body.

## delete

The delete method deletes the stack from the organization.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack('api_key').delete()
```

## environment

The environment method retrieves the details of the environment added in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack('api_key').environment()
```

Name of the environment

## fetch

The fetch method retrieves the entries from the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').fetch()
```

## global_fields

Global field defines the structure or schema of a page or a section of your web or mobile property.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().global_field()
```

UID of the global field

## metadata

Metadata is a piece of information that lets you describe or classify an asset/entry. You can manage your digital entities effectively and facilitate enhanced accessibility with additional metadata.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().metadata()
```

UID of the metadata

## reset_settings

The reset\_settings method resets the stack settings.

```
data = {
      "stack_settings":{}
   }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').reset_stack_settings(data)
```

The request body.

## roles

The roles method retrieves the details of the user roles in the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().roles()
```

UID of the user role

## settings

The settings method retrieves the settings of the stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').settings()
```

## share

The share method shares the stack with the users.

```
data = {
           "emails": [
               "*****"
           ],
           "roles": {
               "manager@example.com": [
                   "*******"
               ]
           }
       }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').share_stack(data).json()
```

The request body

## transfer_ownership

The transfer\_ownership method transfers the ownership of the stack to another user.

```
data = {
            "transfer_to": "manager@example.com"
        }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack('api_key').transfer_ownership(data)
```

The request body

## unshare

The unshare method removes access to a stack from users who have specific user roles.

```
data = {
    "email": "manager@example.com"
  }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack('api_key').unshare(data)
```

The request body

## update

The update method updates the stack entries.

```
data = {
"stack": {
    "name": "My New Stack",
    "description": "My new test stack",
    "master_locale": "en-us"
    }
}
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack('api_key').update(data).json()
```

The request body

## update_user_roles

The update\_user\_roles method updates all the user roles of the stack.

```
data = {
    "users": {
        "user_uid": ["role_uid1", "role_uid2"]
      }
  }
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.stack('api_key').update_user_role(data)
```

The request body

## users

The users method retrieves the details of all the users of a stack.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().users()
```

## webhooks

A Webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().webhooks()
```

UID of the webhook

## workflows

A Workflow is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')

response = client.stack().workflows()
```

UID of the workflow

## Stack | Python Management SDK | Contentstack

Stack is the space that stores a project's content, structures, entries, and users in the Contentstack Python Management SDK.