Search Storyblok's Documentation
  1. Retrieve a Single Story

Retrieve a Single Story

Returns a single story object for the specified full_slug, id or uuid.

https://api.storyblok.com/v2/cdn/stories/(:full_slug|:id|:uuid)

Path Parameters

  • :full_slug

    string

    The full slug of the story, combining the parent folder(s) and the designated story slug

  • :id

    number

    The numeric ID of the story

  • :uuid

    string

    The UUID of the story (important: it is required to append the query param find_by=uuid )

Query Parameters

  • token

    required string

    A preview or public access token configured in a space.

  • find_by

    string

    Added if you want to query by uuid instead of using the numeric id

  • version

    string

    Default: published. Possible values: draft, published

  • resolve_links

    enum

    Used to resolve internal links of link fields used in a story. Resolved links are included in the links property of the response. Possible values are story, url, and link. Entries can be resolved two levels deep using resolve_links_level. Learn more in this developer guide.

    Possible valuesDescription
    linkProvides access to additional information such as a linked story's path, parent_id, is_folder, published, is_startpage, position, alternates, real_path, and more.
    urlIf only the path of a linked story is required, this value provides the minimum amount of information in the response.
    storyResolves and returns the complete story object of a linked story.
  • resolve_links_level

    number

    Default: 1. Possible values: 1, 2
    Used to resolve up to two levels of links. For example, if a story has a link field that references another story, the links in this story will also be resolved if resolve_links_level is set to 2.

  • resolve_relations

    string

    Used to resolve relations to other stories established via a multi-option or single-option field. Resolved relations are included in the rels property of the response. A maximum of 50 stories can be resolved. If this limit is exceeded, the story UUIDs are included in the rel_uuids property of the response and can be used for further API requests (this is handled automatically when using one of Storyblok's official frontend SDKs). Entries can be resolved two levels deep.

    To resolve the stories selected in one field, provide the technical name of the immediate parent component of the field, followed by a . and the field name. To resolve the stories selected in multiple fields, provide a comma-separated list.

    Example: resolve_relations=page.author,page.categories

    Further information can be found in this tutorial.

  • from_release

    string

    Used to access a story version associated with a specific release by providing the release ID

  • cv

    number

    Used to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.

  • language

    string

    Used to obtain translated versions of one or more stories. Accepts any language code that is configured in the Storyblok space. Used in the context of field-level translation.

  • fallback_lang

    string

    Used to define a custom fallback language to handle untranslated fields. As standard, the default language defined in the Storyblok is used. Please note that the language code needs to be specified with underscores, even if it is defined with hyphens. E.g., es_co instead of es-co.

  • resolve_assets

    number

    Used to resolve asset metadata, including custom metadata. The resolved metadata is included in the assets property of the response. This parameter is only available in the Business plan and above. Please refer to our Pricing for further information.

Response Properties

  • story

    The Story Object

    The complete story object

    • name

      string

      The complete name provided for the story

    • created_at

      string

      Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • published_at

      string

      Latest publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • updated_at

      string

      Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • id

      number

      The numeric ID

    • uuid

      string

      Generated UUID string

    • content

      object

      An object containing the field data associated with the specific story type's specific content structure. Also includes a component property with the story type's technical name.

    • slug

      string

      The slug specific for the story

    • full_slug

      string

      The full slug of the story, combining the parent folder(s) and the designated story slug

    • sort_by_date

      string

      Date defined in the story's entry configuration (Format: YYYY-mm-dd)

    • position

      number

      Numeric representation of the story's position in the folder

    • tag_list

      string[]

      Array of tag names

    • is_startpage

      boolean

      true if the story is defined as root for the folder

    • parent_id

      number

      ID of the parent folder

    • meta_data

      object

      Object to store non-editable data that is exclusively maintained with the Management API

    • group_id

      string

      Group ID (UUID string), shared between stories defined as alternates

    • first_published_at

      string

      First publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • release_id

      number

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

    • lang

      string

      Language code of the current language (can be requested with the language API parameter)

    • path

      string

      Value of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)

    • alternates

      object[]

      An array containing objects that provide basic data of the stories defined as alternates of the current story

      • id

        number

        The numeric ID

      • name

        string

        The complete name provided for the story

      • slug

        string

        The slug specific for the story

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

      • full_slug

        string

        The full slug of the story, combining the parent folder(s) and the designated story slug

      • is_folder

        boolean

        true if the instance constitutes a folder

    • default_full_slug

      string

      Contains the complete slug of the default language (if the app Translatable Slugs is installed)

    • translated_slugs

      object[]

      Array of translated slug objects (if the app Translatable Slugs is installed)

      • path

        string

        Value of the translated slug

      • name

        string

        The complete name provided for the story

      • lang

        string

        Language code of the current language (can be requested with the language API parameter)

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

  • cv

    number

    Used to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.

  • rels

    The Story Object

    Array of resolved stories (if the resolve_relations parameter is in use)

    • name

      string

      The complete name provided for the story

    • created_at

      string

      Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • published_at

      string

      Latest publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • updated_at

      string

      Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • id

      number

      The numeric ID

    • uuid

      string

      Generated UUID string

    • content

      object

      An object containing the field data associated with the specific story type's specific content structure. Also includes a component property with the story type's technical name.

    • slug

      string

      The slug specific for the story

    • full_slug

      string

      The full slug of the story, combining the parent folder(s) and the designated story slug

    • sort_by_date

      string

      Date defined in the story's entry configuration (Format: YYYY-mm-dd)

    • position

      number

      Numeric representation of the story's position in the folder

    • tag_list

      string[]

      Array of tag names

    • is_startpage

      boolean

      true if the story is defined as root for the folder

    • parent_id

      number

      ID of the parent folder

    • meta_data

      object

      Object to store non-editable data that is exclusively maintained with the Management API

    • group_id

      string

      Group ID (UUID string), shared between stories defined as alternates

    • first_published_at

      string

      First publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • release_id

      number

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

    • lang

      string

      Language code of the current language (can be requested with the language API parameter)

    • path

      string

      Value of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)

    • alternates

      object[]

      An array containing objects that provide basic data of the stories defined as alternates of the current story

      • id

        number

        The numeric ID

      • name

        string

        The complete name provided for the story

      • slug

        string

        The slug specific for the story

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

      • full_slug

        string

        The full slug of the story, combining the parent folder(s) and the designated story slug

      • is_folder

        boolean

        true if the instance constitutes a folder

    • default_full_slug

      string

      Contains the complete slug of the default language (if the app Translatable Slugs is installed)

    • translated_slugs

      object[]

      Array of translated slug objects (if the app Translatable Slugs is installed)

      • path

        string

        Value of the translated slug

      • name

        string

        The complete name provided for the story

      • lang

        string

        Language code of the current language (can be requested with the language API parameter)

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

  • links

    The Link Object[] or The Story Object[]

    An array of resolved links (dependent on the value of the resolve_links parameter).

    • id

      number

      The numeric ID

    • uuid

      string

      Generated UUID string

    • slug

      string

      The full slug of the story or folder

    • path

      Value of the real path defined in the story's entry configuration

    • real_path

      string

      Either the full slug of the story or folder with a leading /, or, if existent, the value of the real path defined in the story's entry configuration with a leading /

    • name

      The complete name of the story or folder

    • published

      true if a story has been published at least once (even if it is currently in draft)

    • parent_id

      number

      ID of the parent folder

    • is_folder

      boolean

      true if the instance constitutes a folder

    • is_startpage

      boolean

      true if the story is defined as root for the folder

    • position

      number

      Numeric representation of the story's position in the folder

    • published_at

      string

      Latest publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ); only included if include_dates=1 is specified

    • created_at

      string

      Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ); only included if include_dates=1 is specified

    • updated_at

      string

      Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ); only included if include_dates=1 is specified

    • alternates

      object

      An array containing objects that provide basic data of the different language versions of a story using Storyblok's Field Level Translation. Important: not to be confused with actual story alternates.

      • path

        Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)

      • name

        Translated name of the story (if the app Translatable Slugs is installed)

      • lang

        Language code of this story variant

      • published

        true if a story has been published at least once (even if it is currently in draft)

      • translated_slug

        Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)

    • name

      string

      The complete name provided for the story

    • created_at

      string

      Creation date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • published_at

      string

      Latest publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • updated_at

      string

      Latest update date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • id

      number

      The numeric ID

    • uuid

      string

      Generated UUID string

    • content

      object

      An object containing the field data associated with the specific story type's specific content structure. Also includes a component property with the story type's technical name.

    • slug

      string

      The slug specific for the story

    • full_slug

      string

      The full slug of the story, combining the parent folder(s) and the designated story slug

    • sort_by_date

      string

      Date defined in the story's entry configuration (Format: YYYY-mm-dd)

    • position

      number

      Numeric representation of the story's position in the folder

    • tag_list

      string[]

      Array of tag names

    • is_startpage

      boolean

      true if the story is defined as root for the folder

    • parent_id

      number

      ID of the parent folder

    • meta_data

      object

      Object to store non-editable data that is exclusively maintained with the Management API

    • group_id

      string

      Group ID (UUID string), shared between stories defined as alternates

    • first_published_at

      string

      First publishing date (Format: yyyy-MM-dd'T'HH:mm:ssZ)

    • release_id

      number

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

    • lang

      string

      Language code of the current language (can be requested with the language API parameter)

    • path

      string

      Value of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)

    • alternates

      object[]

      An array containing objects that provide basic data of the stories defined as alternates of the current story

      • id

        number

        The numeric ID

      • name

        string

        The complete name provided for the story

      • slug

        string

        The slug specific for the story

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

      • full_slug

        string

        The full slug of the story, combining the parent folder(s) and the designated story slug

      • is_folder

        boolean

        true if the instance constitutes a folder

    • default_full_slug

      string

      Contains the complete slug of the default language (if the app Translatable Slugs is installed)

    • translated_slugs

      object[]

      Array of translated slug objects (if the app Translatable Slugs is installed)

      • path

        string

        Value of the translated slug

      • name

        string

        The complete name provided for the story

      • lang

        string

        Language code of the current language (can be requested with the language API parameter)

      • published

        boolean

        true if a story has been published at least once (even if it is currently in draft)

  • rel_uuids

    string

    An array of all UUIDS of resolvable stories. Only provided if the resolve_relations parameter is in use and the limit of resolvable relations is exceeded.

  • link_uuids

    string

    An array of all UUIDS of linked stories. Only provided if the resolve_links parameter is in use and the limit of resolvable links is exceeded.

Request
curl "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt" \
  -X GET \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/stories/posts/my-third-post', {})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');

$client->getStoryBySlug('/posts/my-third-post')->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.story('/posts/my-third-post')
Request
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt")
  .asString();
Request
var client = new RestClient("https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
Request
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post?token=ask9soUkv02QqbZgmZdeDAtt")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
Request
import requests

url = "https://api.storyblok.com/v2/cdn/stories/posts/my-third-post"

querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}

payload = ""
headers = {}

response = requests.request("GET", url, data=payload, headers=headers, params=querystring)

print(response.text)
Response
{
  "story": {
    "name": "My third post",
    "created_at": "2024-02-08T16:26:24.425Z",
    "published_at": "2024-02-08T16:30:09.300Z",
    "id": 440448565,
    "uuid": "e656e146-f4ed-44a2-8017-013e5a9d9395",
    "content": {
      "_uid": "cfe0ff0b-3211-4bb7-8128-66e6ad262a56",
      "component": "page"
    },
    "slug": "my-third-post",
    "full_slug": "posts/my-third-post",
    "sort_by_date": null,
    "position": 0,
    "tag_list": [],
    "is_startpage": false,
    "parent_id": 440448337,
    "meta_data": null,
    "group_id": "b913a671-f1e9-436a-bc5d-2795d2740198",
    "first_published_at": "2024-02-08T16:27:05.705Z",
    "release_id": null,
    "lang": "default",
    "path": null,
    "alternates": [
      {
        "id": 440452827,
        "name": "Mein dritter Beitrag",
        "slug": "mein-dritter-beitrag",
        "published": true,
        "full_slug": "beitraege/mein-dritter-beitrag",
        "is_folder": false,
        "parent_id": 440452826
      }
    ],
    "default_full_slug": "posts/my-third-post",
    "translated_slugs": [
      {
        "path": "posts/my-third-post",
        "name": null,
        "lang": "fr",
        "published": null
      },
      {
        "path": "posts/mein-dritter-beitrag",
        "name": "Mein dritter Beitrag",
        "lang": "de",
        "published": true
      }
    ]
  },
  "cv": 1707409909,
  "rels": [],
  "links": []
}