Create Content Type
contentful.create_content_type
ActionBusiness appsconnection required
Calls the Contentful API with the connection's credentials.
Create a content type from a name and a list of field definitions; it stays a draft until it is activated.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Bearer token
- Providers
- Contentful
- Secret shape
- the CMA access token, or {"access_token": "…"}
- Config it needs
- space_id, environment_id, base_url
- Resolved by
- config.connection_id, else node.connection_id
Configuration
7 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
name The content type's display name. | string | Yes | — | — | — |
fields The field definitions as a JSON array, each with an id, name and type. | array | Yes | — | array of object | — |
content_type_id Create the content type under this id instead of a generated one. | string | No | — | — | — |
description What this content type is for. | string | No | — | — | — |
display_field The id of the field used as an entry's title in the editor. | string | No | — | — | — |
space_id The space to act on. Leave blank to use the connection's space. | string | No | — | — | — |
environment_id The environment to act on. Leave blank to use the connection's environment, or 'master'. | string | No | — | — | — |
Output
One shape.
result
| Field | Type | Example |
|---|---|---|
sys.id The content type id. | string | — |
sys.version The content type's version after this call. | number | — |
name The content type's display name. | string | — |
displayField The id of the field used as the entry title. | string | — |
fields The content type's field definitions. | array | — |
{
"displayField": "",
"fields": [],
"name": "",
"sys": {
"id": "",
"version": 0
}
}Notes
- Activate it with contentful.activate_content_type before entries can use it.
See Create Content Type run in a workflow.
In a technical demo we add the Contentful connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.