Skip to content

Create a Story

Terminal window
https://mapi.storyblok.com/v1/spaces/:space_id/stories

You can set most of the fields that are available in the story object, below we only list the properties in the example and the possible required fields. Stories are not published by default. If you want to create a published story add the parameter publish with the value 1.

You can save any data in the story[content] attribute, and use it in the editor, as long as you follow these rules:

  • The story[content] property needs to be an object at the root level
  • Every object inside needs to have the property "component":"your_components_name"
  • Only nest components using arrays, except if you want to build a custom field type.
  • Every nested object which is a component or custom field type needs a _uid property.

This lets you import data and define the schema of your components afterwards in the interface where necessary.

  • :space_id required number

    Numeric ID of a space

  • story The Story Object

    A single story object

  • publish number

    Should the story be published immediately (set 1 to publish)

  • release_id number

    ID of the current release (can be requested with the from_release API parameter)

curl "https://mapi.storyblok.com/v1/spaces/606/stories" \
-X POST \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"publish\":1,\"story\":{\"content\":{\"body\":[],\"component\":\"page\"},\"name\":\"Story Name\",\"slug\":\"story-name\"}}"