---
title: "ContentType"
description: "ContentType"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/contenttype"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-06"
---

# ContentType

## ContentType

[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.

## update

The Update ContentType call lets you update the name and description of an existing ContentType. You can also update the JSON schema of a content type, including fields and different features associated with the content type.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType('content_type_uid').fetch()
.then((contentType) => {
 contentType.title = 'My New Content Type'
 contentType.description = 'Content Type description'
 return contentType.update()
})
.then((contentType) => console.log(contentType))
```

## delete

The Delete ContentType call is used to delete an existing ContentType permanently from your Stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType('content_type_uid').delete()
.then((response) => console.log(response.notice))
```

## fetch

The fetch ContentType call fetches ContentType details.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType('content_type_uid').fetch()
.then((contentType) => console.log(contentType))
```

Version number to fetch specific version of ContentType.

## entry

Entry is the actual piece of content created using one of the defined content types.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry()
//OR
client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('entry_uid')
```

Entry uid to perform operation on

Pass "3.2" to enable enhanced logic for the [publish](/docs/developers/sdks/content-management-sdk/javascript/reference#publish) operation only.

## generateUid

Generate uid from the title of content type

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType().generateUid('name')
```

Title for which ContentType uid needs to be generated.

## create

The Create a content type call creates a new content type in a particular stack of your Contentstack account.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const content_type = {name: 'My New contentType'}

client.stack({ api_key: 'api_key'}).contentType().create({ content_type })
.then((contentType) => console.log(contentType))
```

ContentType details and schema to create.

## query

The Query on Content Type will allow to fetch details of all or specific Content Type

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).contentType().query({ query: { name: 'Content Type Name' } }).find()
.then((contentTypes) => console.log(contentTypes))
```

## import

The Import a content type call imports a content type into a stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const data = {
 content_type: 'path/to/file.json',
}

client.stack({ api_key: 'api_key'}).contentType().import(data)
.then((contentType) => console.log(contentType))
```

File path to import content type

## ContentType | JavaScript Management SDK | Contentstack

ContentType defines the structure or schema of a page or section that you use to create entries in the JavaScript Management SDK.