Create Asset
contentful.create_asset
ActionBusiness appsconnection required
Calls the Contentful API with the connection's credentials.
Create an asset record from a title, description and file reference, keyed by locale.
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
4 fields, 1 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 |
|---|---|---|---|---|---|
fields Asset fields as JSON, keyed by field id and then by locale, with a 'file' entry naming contentType, fileName and the upload. | object | Yes | — | — | — |
asset_id Create the asset under this id instead of a generated one. | 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 asset id. | string | — |
sys.type The entity type, which is 'Asset'. | string | — |
sys.version The asset's version after this call. | number | — |
sys.createdAt When the asset was created, as an ISO 8601 timestamp. | string | — |
sys.updatedAt When the asset last changed, as an ISO 8601 timestamp. | string | — |
fields The asset's title, description and file, keyed by locale. | object | — |
{
"fields": {},
"sys": {
"createdAt": "",
"id": "",
"type": "",
"updatedAt": "",
"version": 0
}
}Notes
- The file is not usable until contentful.process_asset has run for each locale and the URL has appeared on fields.file.<locale>.url.
See Create Asset 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.