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

# Content Types

## Content Types

[Content Type](/docs/headless-cms/about-content-types) defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.

## create

The create method creates a new content type in a particular stack.

```
import contentstack_management
data = {
            "content_type": {
                    "title": "test content type",
                    "uid": "content_type_uid",
                    "schema": [{
                                    "display_name": "Title",
                                    "uid": "title",
                                    "data_type": "text",
                                    "field_metadata": {
                                            "_default": True
                                    },
                                    "unique": False,
                                    "mandatory": True,
                                    "multiple": False
                            },
                            {
                            "display_name": "URL",
                            "uid": "url",
                            "data_type": "text",
                            "field_metadata": {
                                    "_default": True
                            },
                            "unique": False,
                            "multiple": False
                        }
                        ],
                        "options": {
                            "title": "title",
                            "publishable": True,
                            "is_page": True,
                            "singleton": False,
                            "sub_title": [
                                    "url"
                                    ],
                                "url_pattern": "/:title",
                                "url_prefix": "/"
                            }
                    }
            }
content_type = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').content_type()
response = content_type.create(data)
```

The request body

## delete

The delete method deletes an existing content type in a particular stack

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

UID of the content type

## entry

The entry method retrieves the details of a particular entry in the content type.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.entry()
```

UID of the entry

## export

The export method exports a specific content type and its schema.

```
import contentstack
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.export()
```

UID of the content type

## fetch

The fetch method retrieves the details of a specific content type.

```
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.fetch()
```

UID of the content type

## find

The find method retrieves the details of all content types.

```
import contentstack
import contentstack_management
content_type = contentstack_management.Client(authtoken='auth_token').stack(api_key='api_key').content_type()
response = content_type.find()
```

## imports

The imports method imports the content type into the stack by uploading a JSON file.

```
import contentstack
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.imports(file_path)
```

UID of the content type

File path of the content type to be uploaded

## references

The references method retrieves the details of the content types in which a specific content type is referred.

```
import contentstack
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.references()
```

## set_field_visibility_rules

The set\_field\_visibility\_rules method lets you add the field visibility rules to an existing content type.

```
import contentstack
import contentstack_management
data = {
                "content_type": {
                "title": "updatedContentType",
                "uid": "content_type_uid",
                "schema": [{
                            "display_name": "Title",
                                "uid": "title",
                                "data_type": "text",
                                "field_metadata": {
                                    "_default": True
                                },
                                "unique": False,
                                "mandatory": True,
                                "multiple": False
                        },
                            {
                                    "display_name": "URL",
                                    "uid": "url",
                                    "data_type": "text",
                                "field_metadata": {
                                        "_default": True
                                },
                                "unique": False,
                                "multiple": False
                            },
                            {
                                    "display_name": "Single Line Textbox",
                                    "uid": "single_line_textbox",
                                "data_type": "text",
                                "field_metadata": {
                                    "_default": True
                                },
                                "unique": False,
                                "multiple": False
                            },
                            {
                                    "display_name": "Multi Line Textbox",
                                    "uid": "multi_line_textbox",
                                    "data_type": "text",
                                    "field_metadata": {
                                            "_default": True
                                    },
                                    "unique": False,
                                    "multiple": False
                            }
                    ],
                    "field_rules": [{
                            "conditions": [{
                                    "operand_field": "single_line_textbox",
                                    "operator": "equals",
                                    "value": "abc"
                            }],
                            "match_type": "all",
                            "actions": [{
                            "action": "show",
                                    "target_field": "multi_line_textbox"
                            }]
                    }],
                    "options": {
                            "title": "title",
                            "publishable": True,
                            "is_page": True,
                            "singleton": False,
                            "sub_title": ["url"],
                            "url_pattern": "/:title",
                            "url_prefix": "/"
                        }
                }
        }
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type('content_type_uid')
response = content_type.set_field_visibility_rules(data)
```

UID of the content type

The Request body

## update

The update method updates the schema of an existing content type

```
import contentstack
import contentstack_management
data = {
        >>>        "content_type": {
        >>>         "title": "updated content type",
        >>>         "uid": "content_type_uid",
        >>>         "schema": [
        >>>             {}
            >>>            ],
            >>>            "options": {
            >>>             "title": "title",
            >>>             "sub_title": [
            >>>                     "url"
            >>>             ],
            >>>             "url_pattern": "/:title",
            >>>             "url_prefix": "/"
            >>>             }
            >>>           }
        >>>        }
client = contentstack_management.Client(authtoken='auth_token')
content_type = client.stack(api_key='api_key').content_type("content_type_uid")
response = content_type.update(data)
```

UID of the content type

The Request body

## Content Types | Python Management SDK | Contentstack

Content Types define the schema of a page or section so you can create entries against it, in the Python Management SDK.