# Storyblok

> Create, update and publish stories, and manage assets, datasources and workflow stages in Storyblok.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/storyblok

## Actions

### Change workflow stage

Move a story to another stage of its workflow, such as from Drafting to Reviewing.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.
- Workflow stage (`stage_id`, text, required): The stage to move the story to.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "due_date": "example",
    "id": 1,
    "user_id": 1,
    "workflow_id": 1,
    "workflow_stage_id": 1
  }
}
```

### Create datasource

Create a datasource, a list of keys and values that content can choose from.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Name (`name`, text, required): The datasource's name.
- Slug (`slug`, text): The datasource's slug, used to read it. Leave empty to make one from the name.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "dimensions": [
      {
        "datasource_id": 1,
        "entry_value": "example",
        "id": 1,
        "name": "example"
      }
    ],
    "id": 1,
    "name": "example",
    "slug": "example",
    "updated_at": "example"
  }
}
```

### Create datasource entry

Add an entry, a key and a value, to the end of a datasource.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Datasource (`datasource_id`, text, required): The datasource.
- Name (`name`, text, required): The entry's name, its key.
- Value (`value`, text, required): The entry's value.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "datasource_id": 1,
    "dimension_value": "example",
    "id": 1,
    "name": "example",
    "position": 1,
    "value": "example"
  }
}
```

### Create folder

Create a folder for stories.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Name (`name`, text, required): The folder's name.
- Slug (`slug`, text): The folder's part of the URL of the stories in it. Leave empty to make one from the name.
- Folder (`folder_id`, text): The folder to create it in. Leave empty for the top level of the space.
- Default content type (`default_content_type`, text): The content type new stories in this folder start as.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Create story

Create a story of a content type, as a draft or published at once.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Name (`name`, text, required): The story's name, shown in Storyblok's content list.
- Content type (`content_type`, text, required): The content type of the story, such as a page or an article.
- Slug (`slug`, text): The last part of the story's URL, such as my-first-post. Leave empty to make one from the name.
- Folder (`folder_id`, text): The folder to put it in. Leave empty for the top level of the space.
- Content fields (`fields`, object): The content's fields, keyed by each field's technical name in the content type, such as {"title": "Hello", "body": "..."}.
- Tags (`tags`, list): Tags to give the story.
- Publish now (`publish`, true/false): Publish the story straight away. Otherwise it is saved as a draft.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Delete asset

Delete an asset from the asset library.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Asset (`asset_id`, text, required): The asset.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {}
}
```

### Delete datasource

Delete a datasource and all its entries.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Datasource (`datasource_id`, text, required): The datasource.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {}
}
```

### Delete datasource entry

Delete an entry from a datasource.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Datasource (`datasource_id`, text, required): The datasource the entry is in, to choose the entry from.
- Entry (`entry_id`, text, required): The datasource entry.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {}
}
```

### Delete story

Delete a story or a folder. It goes to the space's trash, where it can be restored.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Duplicate story

Copy a story, into the same folder or another one. The copy is a draft.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.
- Name (`name`, text): The copy's name.
- Slug (`slug`, text): The copy's slug. Leave empty to make one from the name.
- Folder (`folder_id`, text): The folder to copy it into. Leave empty to keep it beside the original.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Get asset

Get an asset with its address, file details, alt text and title.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Asset (`asset_id`, text, required): The asset.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "alt": "example",
    "asset_folder_id": 1,
    "content_length": 1,
    "content_type": "example",
    "copyright": "example",
    "created_at": "example",
    "deleted_at": "example",
    "expire_at": "example",
    "filename": "example",
    "focus": "example",
    "id": 1,
    "is_private": true,
    "locked": true,
    "publish_at": "example",
    "short_filename": "example",
    "source": "example",
    "space_id": 1,
    "title": "example",
    "updated_at": "example"
  }
}
```

### Get story

Get a story with its content, status and workflow stage.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### List asset folders

List the folders in a space's asset library.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Search (`search`, text): Only folders whose name contains this.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "id": 1,
        "name": "example",
        "parent_id": 1,
        "parent_uuid": "example",
        "uuid": "example"
      }
    ]
  }
}
```

### List assets

List the images and files in a space's asset library.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Asset folder (`asset_folder_id`, text): Only assets in this folder.
- Search (`search`, text): Only assets whose file name contains this.
- Order (`sort_by`, text): The order to list them in. One of: `created_at:desc` (Newest first), `created_at:asc` (Oldest first), `updated_at:desc` (Recently updated first), `short_filename:asc` (File name, A to Z), `content_length:desc` (Largest first).
- Page (`page`, number): Which page of assets to return, from 1. Use the next_page a previous step returned. At least 1.
- Per page (`per_page`, number): How many assets to return, up to 100. Storyblok's default is 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "alt": "example",
        "asset_folder_id": 1,
        "content_length": 1,
        "content_type": "example",
        "copyright": "example",
        "created_at": "example",
        "deleted_at": "example",
        "expire_at": "example",
        "filename": "example",
        "focus": "example",
        "id": 1,
        "is_private": true,
        "locked": true,
        "publish_at": "example",
        "short_filename": "example",
        "source": "example",
        "space_id": 1,
        "title": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List components

List a space's components: its content types and the blocks they are built from, with their fields.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Show (`show`, text): Only content types, or only nestable blocks. Leave empty for all. One of: `content_types` (Content types), `nestable` (Nestable blocks).
- Search (`search`, text): Only components whose name contains this.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "component_group_uuid": "example",
        "created_at": "example",
        "display_name": "example",
        "id": 1,
        "is_nestable": true,
        "is_root": true,
        "name": "example",
        "real_name": "example",
        "schema": {},
        "updated_at": "example"
      }
    ]
  }
}
```

### List datasource entries

List the entries, each a key and a value, in a datasource.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Datasource (`datasource_id`, text, required): The datasource.
- Search (`search`, text): Only entries whose name contains this.
- Page (`page`, number): Which page of entries to return, from 1. Use the next_page a previous step returned. At least 1.
- Per page (`per_page`, number): How many entries to return, up to 100. Storyblok's default is 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "datasource_id": 1,
        "dimension_value": "example",
        "id": 1,
        "name": "example",
        "position": 1,
        "value": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List datasources

List a space's datasources: the lists of keys and values that content can choose from.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Search (`search`, text): Only datasources whose name contains this.
- Page (`page`, number): Which page of datasources to return, from 1. Use the next_page a previous step returned. At least 1.
- Per page (`per_page`, number): How many datasources to return, up to 100. Storyblok's default is 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "dimensions": [
          {
            "datasource_id": 1,
            "entry_value": "example",
            "id": 1,
            "name": "example"
          }
        ],
        "id": 1,
        "name": "example",
        "slug": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List spaces

List the Storyblok spaces your access token can reach.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "id": 1,
        "name": "example",
        "org_id": 1,
        "owner_id": 1,
        "plan": "example",
        "region": "example",
        "space_type": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List stories

List a space's stories and folders, without their content. Use Get story for a story's content.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Search (`text_search`, text): Only stories with this text in their name, slug or content.
- Folder (`folder_id`, text): Only what is directly inside this folder.
- Tag (`with_tag`, text): Only stories with this tag.
- Status (`status`, text): Only published stories, or only stories that are not published. One of: `published`, `draft` (Not published).
- Show (`show`, text): Only stories, or only folders. Leave empty for both. One of: `stories` (Stories only), `folders` (Folders only).
- Workflow stage (`stage_id`, text): Only stories in this workflow stage.
- Order (`sort`, text): The order to list them in. Newest first unless you choose another. One of: `created_at:desc` (Newest first), `created_at:asc` (Oldest first), `updated_at:desc` (Recently updated first), `published_at:desc` (Recently published first), `name:asc` (Name, A to Z), `name:desc` (Name, Z to A). Default: `created_at:desc`.
- Page (`page`, number): Which page of stories to return, from 1. Use the next_page a previous step returned. At least 1.
- Per page (`per_page`, number): How many stories to return, up to 100. Storyblok's default is 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "content_type": "example",
        "created_at": "example",
        "default_root": "example",
        "first_published_at": "example",
        "full_slug": "example",
        "group_id": "example",
        "id": 1,
        "is_folder": true,
        "is_startpage": true,
        "last_author": {
          "friendly_name": "example",
          "id": 1,
          "userid": "example"
        },
        "last_author_id": 1,
        "name": "example",
        "parent_id": 1,
        "path": "example",
        "position": 1,
        "published": true,
        "published_at": "example",
        "slug": "example",
        "sort_by_date": "example",
        "stage": {
          "created_at": "example",
          "due_date": "example",
          "story_id": 1,
          "workflow_id": 1,
          "workflow_stage_id": 1
        },
        "tag_list": [
          "example"
        ],
        "unpublished_changes": true,
        "updated_at": "example",
        "uuid": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List workflow stages

List the stages of a space's editorial workflows, such as Drafting and Reviewing.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "allow_publish": true,
        "color": "example",
        "id": 1,
        "is_default": true,
        "name": "example",
        "position": 1,
        "workflow_id": 1
      }
    ]
  }
}
```

### Publish story

Publish a story's current draft, so your website shows it.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.
- Languages (`languages`, list): With translations published separately: the language codes to change, such as de or es, and [default] for the default language. Leave empty for all.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```

### Unpublish story

Unpublish a story, so your website no longer shows it. The story is kept as a draft.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.
- Languages (`languages`, list): With translations published separately: the language codes to change, such as de or es, and [default] for the default language. Leave empty for all.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {}
}
```

### Update asset

Change an asset's alt text, title, copyright or source, or move it to another folder. Anything left empty stays as it is.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Asset (`asset_id`, text, required): The asset.
- Alt text (`alt`, text): The alt text that describes the image.
- Title (`title`, text): The asset's title.
- Copyright (`copyright`, text): The copyright notice.
- Source (`source`, text): Where the asset comes from.
- Move to folder (`move_to_folder`, text): Move the asset into this folder.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "alt": "example",
    "asset_folder_id": 1,
    "content_length": 1,
    "content_type": "example",
    "copyright": "example",
    "created_at": "example",
    "deleted_at": "example",
    "expire_at": "example",
    "filename": "example",
    "focus": "example",
    "id": 1,
    "is_private": true,
    "locked": true,
    "publish_at": "example",
    "short_filename": "example",
    "source": "example",
    "space_id": 1,
    "title": "example",
    "updated_at": "example"
  }
}
```

### Update datasource entry

Change a datasource entry's name or value. Whatever you leave empty stays as it is.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Datasource (`datasource_id`, text, required): The datasource the entry is in, to choose the entry from.
- Entry (`entry_id`, text, required): The datasource entry.
- Name (`name`, text): A new name, the entry's key.
- Value (`value`, text): A new value.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "datasource_id": 1,
    "dimension_value": "example",
    "id": 1,
    "name": "example",
    "position": 1,
    "value": "example"
  }
}
```

### Update story

Change a story's name, slug, folder, tags or content fields. Anything left empty stays as it is.

**Inputs**

- Space (`space_id`, text, required): The Storyblok space.
- Story (`story_id`, text, required): The story.
- Name (`name`, text): A new name.
- Slug (`slug`, text): A new slug, the last part of the story's URL.
- Folder (`folder_id`, text): Move the story into this folder.
- Content fields (`fields`, object): Content fields to change, keyed by each field's technical name, such as {"title": "New title"}. Fields you leave out keep their values.
- Tags (`tags`, list): The story's tags. These replace its current tags.
- Publish now (`publish`, true/false): Publish the story with the changes. Otherwise they are saved as a draft.

**Outputs**

- `data` (object): The response from Storyblok.

**Example output**

```json
{
  "data": {
    "content": {},
    "created_at": "example",
    "default_root": "example",
    "first_published_at": "example",
    "full_slug": "example",
    "group_id": "example",
    "id": 1,
    "is_folder": true,
    "is_startpage": true,
    "last_author": {
      "friendly_name": "example",
      "id": 1,
      "userid": "example"
    },
    "last_author_id": 1,
    "name": "example",
    "parent_id": 1,
    "path": "example",
    "position": 1,
    "published": true,
    "published_at": "example",
    "slug": "example",
    "sort_by_date": "example",
    "stage": {
      "created_at": "example",
      "due_date": "example",
      "story_id": 1,
      "workflow_id": 1,
      "workflow_stage_id": 1
    },
    "tag_list": [
      "example"
    ],
    "unpublished_changes": true,
    "updated_at": "example",
    "uuid": "example"
  }
}
```
