Skip to main content
GET
/
spaces
/
{spaceId}
/
environments
/
{environmentId}
/
content_types
/
{contentTypeId}
Get a single content type
const contentful = require('contentful')

const client = contentful.createClient({
  space: '<space_id>',
  environment: '<environment_id>', // defaults to 'master' if not set
  accessToken: '<content_delivery_api_key>'
})

client.getContentType('<content_type_id>')
.then((contentType) => console.log(contentType))
.catch(console.error)
{
  "sys": {
    "space": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    },
    "id": "<string>",
    "type": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "environment": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    },
    "publishedVersion": 123,
    "publishedAt": "2023-11-07T05:31:56Z",
    "firstPublishedAt": "2023-11-07T05:31:56Z",
    "createdBy": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    },
    "updatedBy": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    },
    "publishedCounter": 123,
    "version": 123,
    "publishedBy": {
      "sys": {
        "type": "<string>",
        "linkType": "<string>",
        "id": "<string>"
      }
    }
  },
  "displayField": "<string>",
  "name": "<string>",
  "description": "<string>",
  "fields": [
    {
      "id": "<string>",
      "name": "<string>",
      "type": "Symbol",
      "localized": true,
      "required": true,
      "disabled": true,
      "omitted": true,
      "items": {
        "type": {
          "type": "Symbol",
          "validations": [
            "<any>"
          ],
          "linkType": "<string>"
        },
        "linkType": "Asset",
        "validations": [
          "<any>"
        ]
      },
      "validations": [
        "<any>"
      ],
      "linkType": "<string>"
    }
  ]
}
This is custom content

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

spaceId
string
required

ID of the space in form of a string

Required string length: 1 - 20
environmentId
string
required

ID of the environment in form of a string

Required string length: 1 - 40
contentTypeId
string
required

ID of the content type in form of a string

Required string length: 1 - 64

Response

200 - application/vnd.contentful.management.v1+json

Successful response

sys
object
required
displayField
string
required
name
string
required
description
string
required
fields
object[]
required