younifyd
Menu

Get Story By Id

Retrieve a Single Story

GET/v2/cdn/stories/{id}

Use it in a workflow

  1. Add a step and choose the Storyblok Delivery connector.
  2. Pick the Get Story By Id action (under Stories).
  3. Fill in the fields below, then reference the result from later steps as {{getStoryById.response.data}}.

Request

Path parameters

idstringrequired

The story’s `id`, `uuid`, or `full_slug`.

Query parameters

find_bystring

Required when using the story `uuid` as a path parameter.

versionstring

The content version to retrieve: `draft` or `published`. Default is `published`. Retrieving `draft` requires a preview access token.

One ofdraftpublishedDefault "published"

resolve_linksstring

Resolve [link fields](https://www.storyblok.com/docs/concepts/fields#link). The `links` property of the response includes resolved links: - `link`: provides access to additional information, such as a linked story’s `full_slug`, `path`, `parent_id`, `is_folder`, `published`, `is_startpage`, `position`, `alternates`, `real_path`, and more. - `url`: provides the minimum amount of information. Use when you only need the path of a linked story. - `story`: resolves and returns the complete story object of a linked story.

One ofstoryurllink

resolve_links_levelinteger

Resolve up to two levels of links.

One of12Default 1

resolve_links_in_relationsinteger

To resolve the links inside related stories, set `resolve_links_in_relations=1`. This parameter requires both `resolve_relations` and `resolve_links`. The `links` property of the response includes both the story’s own links and the ones returned from the related stories. Links in `resolve_level=2` relations remain unresolved. When exceeding the limit, the response includes `link_uuids` instead of `links`.

One of1

resolve_relationsstring

Used to resolve [referenced stories](https://www.storyblok.com/docs/concepts/references). Resolved stories appear in the `rels` property of the response. A single request can resolve up to 50 stories. Afterward, all story `UUID` appear in the `rel_uuids` property of the response and need to resolve in subsequent API requests. 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 string. Example: `resolve_relations=page.author,page.categories`.

from_releasestring

Access a story version in a specific release by providing the release ID.

content_typestring

Retrieve stories of a specific content type block. For example, `content_type=page`.

cvinteger

Cached version Unix timestamp. Learn more in the [Caching concept](https://www.storyblok.com/docs/concepts/caching).

excluding_fieldsstring

To exclude specific fields of a content type, provide the field names as a comma-separated string. For example, `excluding_fields=body,meta_description`. Excluding the `component` field from the response returns the content of the story in the default language instead of the requested `language`. When a request has both `excluding_fields` and `including_fields`, the API ignores `excluding_fields`.

including_fieldsstring

To return only specific fields of a content type, provide the field names as a comma-separated string. For example, `including_fields=title,image`. The response always returns `_uid`, `component`, and `_editable`, as well as translated versions of a listed field. Takes precedence over `excluding_fields`.

excluding_story_fieldsstring

Exclude top-level story response fields with a comma-separated list. For example, `excluding_story_fields=alternates,translated_slugs`.

languagestring

Retrieve translated story version. Supports languages defined in **Settings** → **Internationalization**.

fallback_langstring

Define a custom fallback language to handle untranslated fields. Supports languages defined in **Settings** → **Internationalization**. Provide language code with underscores. For example, `es_co` instead of `es-co`.

resolve_assetsinteger

Used to resolve asset metadata, including custom metadata. When `resolve_assets=1`, an array of assets associated with the stories appear in the `assets` property of the response.

resolve_levelinteger

Used to force resolve second-level relations when the first level reaches a limit of 100 relations. While resolving relations, if the first level exceeds 100 relations, the API stops looking for the second level. To resolve second-level relations regardless of the first-level relations’ limit, use `resolve_level=2`.

One of2

Response

Returns 200 with an object. Read it in later steps with {{getStoryById.response.data.<field>}}.

storyoneOf
cvinteger

Cached version Unix timestamp. Learn more in the [Caching concept](https://www.storyblok.com/docs/concepts/caching).

relsarray<oneOf>

An array of resolved stories.

linksarray<oneOf>

An array of resolved links. The properties depend on the `resolve_links` value.

rel_uuidsarray<string (uuid)>

An array of all referenced stories’ UUIDs.

link_uuidsarray<string (uuid)>

An array of all linked stories’ UUIDs.

json
{
  "story": null,
  "cv": 1234,
  "rels": [
    null
  ],
  "links": [
    null
  ],
  "rel_uuids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "link_uuids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}

Need more? See the Storyblok Delivery guide for connection setup and behaviour shared by every action.

Was this page helpful?
Get Story By Id — Storyblok Delivery — Documentation