Skip to main content

Create a content type

Log in to add to favourites
This endpoint allows you to create a new content type, which can be an entry, asset, or form based on a specified data format.
POST/api/management/projects/{projectId}/contenttypes/

Parameter

NameParameter typeTypeDescription
projectId(required)pathstringThe project identifier found in the project overview screen of the management console.

Responses

HTTP status codeReasonModel
201CreatedContent type
401UnauthorizedError
404Project not foundError
409Resource already existsError
422Validation errorError
500Internal server errorError

Examples

An example content type representing a movie, including essential details such as title, release date, and overview.

JSON
{
    "id": "movie",
    "name": {
        "en-GB": "Movie"
    },
    "description": {
        "en-GB": "A content type representing a movie, including essential details such as title, release date, and overview."
    },
    "entryTitleField": "title",
    "entryDescriptionField": "overview",
    "fields": [
        {
            "id": "title",
            "name": {
                "en-GB": "Movie Title"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {
                "en-GB": "The official title of the movie, suitable for display in various regions."
            },
            "default": null,
            "validations": {},
            "editor": {
                "id": "text",
                "instructions": {
                    "en-GB": "Provide the full official title of the movie."
                },
                "label": {},
                "properties": {
                    "placeholderText": {
                        "en-GB": "e.g., Inception, The Godfather"
                    }
                }
            },
            "groupId": "summary"
        },
        {
            "id": "tagline",
            "name": {
                "en-GB": "Movie Tagline"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {
                "en-GB": "A short, catchy tagline used to market the movie."
            },
            "default": null,
            "validations": {},
            "editor": {
                "id": "text",
                "instructions": {
                    "en-GB": "Enter the movie's promotional tagline, if available."
                },
                "label": {},
                "properties": {
                    "placeholderText": {
                        "en-GB": "e.g., \"In space, no one can hear you scream.\""
                    }
                }
            },
            "groupId": "summary"
        },
        {
            "id": "releaseDate",
            "name": {
                "en-GB": "Release Date"
            },
            "dataType": "dateTime",
            "dataFormat": null,
            "description": {
                "en-GB": "The date when the movie was or will be released."
            },
            "default": null,
            "validations": {},
            "editor": {
                "id": "date",
                "instructions": {
                    "en-GB": "Select the official release date of the movie."
                },
                "label": {},
                "properties": null
            },
            "groupId": "summary"
        },
        {
            "id": "overview",
            "name": {
                "en-GB": "Movie Overview"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {
                "en-GB": "A brief summary of the movie, providing an overview of the plot."
            },
            "default": null,
            "validations": {},
            "editor": {
                "id": "multiline",
                "instructions": {
                    "en-GB": "Write a concise summary that describes the movie's storyline, without revealing spoilers."
                },
                "label": {},
                "properties": null
            },
            "groupId": "additionalInfo"
        },
        {
            "id": "genre",
            "name": {
                "en-GB": "Movie Genre"
            },
            "dataType": "stringArray",
            "dataFormat": null,
            "description": {
                "en-GB": "The category or type of film based on its narrative style, target audience, or thematic content. Multiple genres can apply."
            },
            "default": null,
            "validations": {
                "minCount": {
                    "message": {
                        "en-GB": "Please select one or more genres that best describe the movie."
                    },
                    "value": 1
                },
                "allowedValues": {
                    "values": [
                        {
                            "en-GB": "Action"
                        },
                        {
                            "en-GB": "Comedy"
                        },
                        {
                            "en-GB": "Drama"
                        },
                        {
                            "en-GB": "Horror"
                        },
                        {
                            "en-GB": "Science fiction"
                        },
                        {
                            "en-GB": "Thriller"
                        }
                    ],
                    "labeledValues": [
                        {
                            "value": "action",
                            "label": {
                                "en-GB": "Action"
                            }
                        },
                        {
                            "value": "comedy",
                            "label": {
                                "en-GB": "Comedy"
                            }
                        },
                        {
                            "value": "drama",
                            "label": {
                                "en-GB": "Drama"
                            }
                        },
                        {
                            "value": "horror",
                            "label": {
                                "en-GB": "Horror"
                            }
                        },
                        {
                            "value": "science-fiction",
                            "label": {
                                "en-GB": "Science fiction"
                            }
                        },
                        {
                            "value": "thriller",
                            "label": {
                                "en-GB": "Thriller"
                            }
                        }
                    ],
                    "message": {
                        "en-GB": "Please select one or more genres that best describe the movie."
                    }
                }
            },
            "editor": {
                "id": null,
                "instructions": {
                    "en-GB": "Choose one or more genres that best categorise the movie."
                },
                "label": {},
                "properties": null
            },
            "groupId": "additionalInfo"
        }
    ],
    "defaultLanguage": "en-GB",
    "supportedLanguages": [
        "en-GB",
        "fr-FR",
        "de-DE",
        "es-ES"
    ],
    "workflowId": "contensisEntryApproval",
    "dataFormat": "entry",
    "groups": [
        {
            "id": "summary",
            "name": {
                "en-GB": "Primary Movie Details"
            },
            "description": {
                "en-GB": "Contains the core information such as title, release date, and tagline."
            }
        },
        {
            "id": "additionalInfo",
            "name": {
                "en-GB": "Additional Movie Information"
            },
            "description": {
                "en-GB": "Holds supplementary data, including the movie's overview and other relevant details."
            }
        }
    ]
}

An example content type for capturing enquiry form responses with a basic confirmation message

JSON
{
    "id": "enquiryForm",
    "name": {
        "en-GB": "Enquiry Form"
    },
    "description": {},
    "entryTitleField": "reference",
    "fields": [
        {
            "id": "name",
            "name": {
                "en-GB": "Name"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {},
            "default": null,
            "validations": {},
            "editor": {
                "id": null,
                "instructions": {},
                "label": {
                    "en-GB": "Name"
                },
                "properties": {
                    "placeholderText": {
                        "en-GB": "Name placeholder"
                    }
                }
            },
            "groupId": "main"
        },
        {
            "id": "mobileNumber",
            "name": {
                "en-GB": "Mobile Number"
            },
            "dataType": "string",
            "dataFormat": "phone",
            "description": {},
            "default": null,
            "validations": {},
            "editor": {
                "id": null,
                "instructions": {},
                "label": {
                    "en-GB": "Mobile Number"
                },
                "properties": null
            },
            "groupId": "main"
        },
        {
            "id": "emailAddress",
            "name": {
                "en-GB": "Email address"
            },
            "dataType": "string",
            "dataFormat": "email",
            "description": {},
            "default": null,
            "validations": {},
            "editor": {
                "id": null,
                "instructions": {},
                "label": {
                    "en-GB": "Email address"
                },
                "properties": null
            },
            "groupId": "main"
        },
        {
            "id": "typeOfEnquiry",
            "name": {
                "en-GB": "Type of enquiry"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {},
            "default": null,
            "validations": {
                "allowedValues": {
                    "labeledValues": [
                        {
                            "value": "general-enquiry",
                            "label": {
                                "en-GB": "General enquiry"
                            }
                        },
                        {
                            "value": "complaint",
                            "label": {
                                "en-GB": "Complaint"
                            }
                        },
                        {
                            "value": "request-for-information",
                            "label": {
                                "en-GB": "Request for information"
                            }
                        }
                    ],
                    "message": null
                }
            },
            "editor": {
                "id": "list-dropdown",
                "instructions": {},
                "label": {
                    "en-GB": "Type of enquiry"
                },
                "properties": null
            },
            "groupId": "enquiryDetails"
        },
        {
            "id": "enquiry",
            "name": {
                "en-GB": "Enquiry"
            },
            "dataType": "string",
            "dataFormat": null,
            "description": {},
            "default": null,
            "validations": {},
            "editor": {
                "id": "multiline",
                "instructions": {},
                "label": {
                    "en-GB": "Enquiry"
                },
                "properties": {
                    "rows": 4
                }
            },
            "groupId": "enquiryDetails"
        },
        {
            "id": "reference",
            "name": {
                "en-GB": "Reference"
            },
            "dataType": "string",
            "dataFormat": "reference",
            "description": {},
            "default": null,
            "validations": {},
            "editor": {
                "id": null,
                "instructions": {},
                "label": {},
                "properties": {
                    "prefix": "EF"
                }
            },
            "groupId": "main"
        }
    ],
    "workflowId": "contensisFormBasic",
    "dataFormat": "form",
    "groups": [
        {
            "id": "main",
            "name": {
                "en-GB": "Your details"
            },
            "description": {}
        },
        {
            "id": "enquiryDetails",
            "name": {
                "en-GB": "Enquiry details"
            },
            "description": {}
        }
    ],
    "properties": {
        "confirmationRules": [
            {
                "return": {
                    "content": {
                        "en-GB": [
                            {
                                "id": "8deda4a8",
                                "type": "_paragraph",
                                "value": "Thanks for your enquiry"
                            }
                        ]
                    }
                }
            }
        ]
    }
}

Remarks

If the defaultLanguage value is not included in the supportedLanguages array then it will be automatically added when the content type is created.

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request