Skip to content

Export a Story

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

Exporting a story can be done using a GET request for each story you want to export.

  • :space_id required number

    Numeric ID of a space

  • :story_id required number

    ID of the story

  • version string

    Default: 1. Possible values: 1, 2.

  • lang_code string

    The language code for which the export should happen

  • export_lang boolean

    If the values of the lang_code should be exported or not

Example Request with lang_code

curl "https://mapi.storyblok.com/v1/spaces/233027/stories/314931981/export.json?lang_code=pt-br&export_lang=true" \
-H "Authorization: YOUR_OAUTH_TOKEN"

Example Request with version=2

In version one, the page:richtext response was stringified, requiring parsing before processing. In version two, it is exported directly as a text value. This updated version also preserves the structure of blocks within rich text, including nested blocks, making it particularly beneficial for translation scenarios.

curl "https://mapi.storyblok.com/v1/spaces/233027/stories/314931981/export.json?lang_code=pt-br&export_lang=true&version=2" \
-H "Authorization: YOUR_OAUTH_TOKEN"
Example v2 response
{
'59ea90a7-c548-4d96-ae11-3d4ed40a5176:dp_richtext:richtext:content/content[0].content[0].text':
'Dummy text content',
'59ea90a7-c548-4d96-ae11-3d4ed40a5176:dp_richtext:richtext:content/content[1].attrs.body[0].content.content[0].content[0].text':
'This is a hint component',
'i-19d10cb3-3884-45bf-a1c4-5f27e852d636:dp_hint:color': 'green',
'i-19d10cb3-3884-45bf-a1c4-5f27e852d636:dp_hint:richtext:content/content[0].content[0].text':
'This is a hint component',
'6fae1c25-6c32-4268-8d52-173e8ca4996a:dp_page:og_title': '',
page: '592234781',
language: 'default',
url: 'docs/plugins/tool-plugins',
text_nodes: 0,
}