Skip to content

Import a Story

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

Importing a story can be done using a PUT request for each story you want to import.

  • :space_id required number

    Numeric ID of a space

  • :story_id required number

    The numeric id of story

  • version string

    Default: 1. Possible value: 1, 2.

  • lang_code string

    A language code

  • import_lang boolean

    It shows to import language code or not.

Example Request with lang_code and import_lang

curl "https://mapi.storyblok.com/v1/spaces/233027/stories/314931981/import.json?lang_code=pt-br&import_lang=true" \
-X PUT \
-H "Authorization: YOUR_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"story\":{\"alternates\":[],\"breadcrumbs\":[],\"can_not_view\":null,\"content\":{\"_uid\":\"98cccd01-f807-4494-996d-c6b0de2045a5\",\"component\":\"your_content_type\"},\"created_at\":\"2023-05-29T09:53:40.231Z\",\"default_root\":null,\"deleted_at\":null,\"disble_fe_editor\":false,\"expire_at\":null,\"favourite_for_user_ids\":[],\"first_published_at\":\"2023-06-06T08:47:05.426Z\",\"full_slug\":\"home\",\"group_id\":\"fb33b858-277f-4690-81fb-e0a080bd39ac\",\"id\":314931981,\"imported_at\":\"2024-02-08T11:26:42.505Z\",\"is_folder\":false,\"is_scheduled\":null,\"is_startpage\":false,\"last_author\":{\"friendly_name\":\"Storyblok\",\"id\":39821,\"userid\":\"storyblok\"},\"localized_paths\":[{}],\"meta_data\":null,\"name\":\"Home\",\"parent\":null,\"parent_id\":0,\"path\":null,\"pinned\":false,\"position\":0,\"preview_token\":{\"timestamp\":\"1545530576\",\"token\":\"279395174a25be38b702f9ec90d08a960e1a5a84\"},\"publish_at\":null,\"published\":true,\"published_at\":\"2023-08-30T09:16:42.066Z\",\"scheduled_dates\":null,\"slug\":\"home\",\"sort_by_date\":null,\"space_role_ids\":[],\"tag_list\":[],\"translated_slugs\":[{}],\"translated_stories\":[],\"unpublished_changes\":true,\"updated_at\":\"2024-02-08T11:26:42.514Z\",\"user_ids\":[12345],\"uuid\":\"2497c493-168a-443f-bbb1-ccfd6340d319\"}}"

When using the import endpoint with version 2 data, stories no longer need to be stringified. Simply use the exported stories from v2 as-is to ensure compatibility with the updated structure.