Start working with Drafts

Drafts is turned off by default if your environment has REST API access tokens. No changes are made to the functioning of the API endpoints. Keep the following in mind when activating Drafts.

Before activating this feature, contact the web agency if you didn't develop your website/app yourself.

What's changed

Publish On

If drafts is switched off (and the current behaviour), every content item requires you to post and update it with a publish_on date/time.

When you start using drafts the publish on field is only required when you acutely want to publish the current version of the item. If the workflow_stage is set to Done, and you add a publish_on date/time the item will be published on that specified date/time.

Note

Please take in mind that if you until now items always had a publish_on param on requests, from now this is optional.

The Status field

When you start using draft the status field for a content item is renamed to workflow_stage. Also the response is simplified:

Using the status field:

"status": {
    "nl-NL": {
        "id": "cff13c2a-615a-4f85-a50d-cc05104e6d6b",
        "created_on": "2018-12-24T09:09:25+00:00",
        "changed_on": null,
        "label": "Status",
        "body": "In progress"
    }
}

Using the new workflow_stage field:

"workflow_stage": {
    "nl-NL": "In progress"
}

On creating a new content item

When creating a new content item the input for the workflow_stage field is the same as the new simplified response.

On updating an existing content item

When updating an existing content item, changing the workflow_stage to something else than Done will no longer unpublish the item. To unpublish an existing content item, use the new unpublish endpoint.

Note

Please take in mind that if you request that status in your ?fields param, you need to update this to workflow_stage too.

Webhooks

When you enabled drafts, everytime a new version is published the content_item.published event is sent to your webhook endpoint.

What's new

Filtering on published state content items

To filter our all content items that are not published, use the following new filter:

"published_status" : {
    "eq" : "published"
}

Options are: `published`, `not published`, `scheduled`

If you use the new REST API scope content_items_published this filter is automatically applied with the published value.

Unpublishing an existing version

To unpublish an existing item.

PUT: /content_items/{id}/{locale}/unpublish

The published version field

If a content item has a version published you can easily resolve the version by using the new field published_version.

"published_version": {
    "nl-NL": {
        "id": "203405a9-9330-4116-89ec-905a63ed34f7",
        "created_on": "2023-09-28T12:03:42+00:00",
        "publish_on": "2023-09-28T12:03:00+00:00",
        "expire_on": null,
        "body": "7bcfgjao58ri"
    }
}

Was this article helpful?

We’d love to learn from your feedback