Retrieving Stories with Resolved Relations
Resolve referenced stories using the resolve_relations parameter. The resolved stories are found in the rels array of the response.
Example Request and Response
Section titled “Example Request and Response”The following example demonstrates how to resolve the relations of the categories and author fields.
curl "https://api.storyblok.com/v2/cdn/stories/posts/my-first-post\?resolve_relations=post.categories%2Cpost.author\&token=ask9soUkv02QqbZgmZdeDAtt\&version=published"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "ask9soUkv02QqbZgmZdeDAtt",});
try { const response = await storyblok.get('cdn/stories/posts/my-first-post', { "resolve_relations": "post.categories,post.author", "version": "published" }) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStoryBySlug('posts/my-first-post', [ "resolve_relations" => "post.categories,post.author", "version" => "published"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories/posts/my-first-post?resolve_relations=post.categories%2Cpost.author&token=ask9soUkv02QqbZgmZdeDAtt&version=published") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/stories/posts/my-first-post?resolve_relations=post.categories%2Cpost.author&token=ask9soUkv02QqbZgmZdeDAtt&version=published");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/stories/posts/my-first-post"
querystring = {"resolve_relations":"post.categories,post.author","token":"ask9soUkv02QqbZgmZdeDAtt","version":"published"}
payload = ""headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.story('posts/my-first-post', {:params => { "resolve_relations" => "post.categories,post.author", "version" => "published"}})// .package(url: "https://github.com/storyblok/storyblok-swift.git", from: "1.1.0")// Requires a `Block` content model — see https://www.storyblok.com/docs/quickstarts/apple-platforms/content-modelinglet client = StoryblokClient( library: Block.self, accessToken: "ask9soUkv02QqbZgmZdeDAtt", version: .published, region: .eu)
let story: Story<Block>? = try await client .story("posts/my-first-post") { @Sendable query in query.parameter("resolve_relations", "post.categories,post.author") } .last() .values .first { @Sendable _ in true }
print(story!)// implementation("com.storyblok:content-api-client:0.7.1")val client = StoryblokClient( accessToken = "ask9soUkv02QqbZgmZdeDAtt", version = Published,)
val story = client .story("posts/my-first-post") { parameter("resolve_relations", "post.categories,post.author") } .last()
println(story){ "story": { "name": "My first Post", "created_at": "2018-04-24T11:57:29.321Z", "published_at": "2026-10-12T10:03:52.422Z", "updated_at": "2026-10-13T08:59:51.886Z", "id": 107351, "uuid": "bfea4895-8a19-4e82-ae1c-1c591dce3094", "content": { "_uid": "2caef8f8-9c37-46b4-af19-8744ec5e1053", "image": "//a.storyblok.com/f/44162/1500x500/68b522b06d/1500x500.jpeg", "title": "This is my first post title", "author": "c47be9f0-47c3-4315-a95a-550f0c560eb5", "topics": "Finance", "content": "Lorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. ***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n## H2\n\nLorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. \n\n---\n\n***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n### H3\n\nunordered list:\n\n* item-1\n * sub-item-1\n * sub-item-2\n- item-2\n - sub-item-3\n - sub-item-4\n+ item-3\n + sub-item-5\n + sub-item-6\n\n\nordered list:\n\n1. item-1\n 1. sub-item-1\n 2. sub-item-2\n2. item-2\n 1. sub-item-3\n 2. sub-item-4\n3. item-3\n\n#### Header4\n\nTable Header-1 | Table Header-2 | Table Header-3\n:--- | :---: | ---:\nTable Data-1 | Table Data-2 | Table Data-3\nTD-4 | Td-5 | TD-6\nTable Data-7 | Table Data-8 | Table Data-9\n\n##### Header5\n\nYou may also want some images right in here like  - you can do that but I would recommend you to use the component \"image\" and simply split your text.\n\n###### Header6\n\nLet us do some links -\n this for example: https://github.com/MinhasKamal/github-markdown-syntax is **NOT** a link but this:\n is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)", "schedule": "2026-10-12 09:00", "component": "post", "categories": [ "9aa72a2f-04ae-48df-b71f-25f53044dc97", "84550816-245d-4fe6-8ae8-b633d4a328f4" ], "description": "Description of the first", "highlighted": true }, "slug": "my-first-post", "full_slug": "posts/my-first-post", "sort_by_date": null, "position": 0, "tag_list": [], "is_startpage": false, "parent_id": 107348, "meta_data": null, "group_id": "6900d2ec-034a-420a-a1c5-9dca2039a81d", "first_published_at": "2018-07-26T12:38:22.000Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null }, "cv": 1792059567, "rels": [ { "name": "Finance", "created_at": "2018-04-24T12:08:20.288Z", "published_at": "2026-10-08T09:57:33.172Z", "updated_at": "2026-10-08T09:57:33.186Z", "id": 107381, "uuid": "84550816-245d-4fe6-8ae8-b633d4a328f4", "content": { "_uid": "4f8c0622-460a-43eb-bbac-56d6c79bd634", "name": "Finance", "image": "//a.storyblok.com/f/44203/922x889/87f39955f8/undraw_bitcoin2_ave7.png", "component": "category" }, "slug": "finance", "full_slug": "categories/finance", "sort_by_date": null, "position": -20, "tag_list": [], "is_startpage": false, "parent_id": 107356, "meta_data": null, "group_id": "99e812a2-eb05-4a20-a65f-276cd21f0d8b", "first_published_at": "2018-04-24T12:08:56.552Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null }, { "name": "Design", "created_at": "2018-04-24T11:59:26.578Z", "published_at": "2018-04-24T12:07:46.278Z", "updated_at": "2018-10-02T07:55:18.938Z", "id": 107357, "uuid": "9aa72a2f-04ae-48df-b71f-25f53044dc97", "content": { "_uid": "6fc4a8e1-52a1-46b3-85b2-a1a93452c97a", "name": "Design", "image": "//a.storyblok.com/f/44203/1177x841/8c69867d6e/undraw_lighthouse2_1ebd.png", "component": "category" }, "slug": "design", "full_slug": "categories/design", "sort_by_date": null, "position": 0, "tag_list": [], "is_startpage": false, "parent_id": 107356, "meta_data": null, "group_id": "ce7f9c87-c3e8-443a-b9f7-aa4cf9f83cd5", "first_published_at": "2018-04-24T12:07:46.278Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null }, { "name": "Jane Doe", "created_at": "2018-04-24T11:57:29.378Z", "published_at": "2026-10-13T09:03:07.816Z", "updated_at": "2026-10-13T09:03:07.829Z", "id": 107354, "uuid": "c47be9f0-47c3-4315-a95a-550f0c560eb5", "content": { "_uid": "b8b14760-b7a7-49f9-9e60-e3f8da23ad7b", "name": "Jane Doe", "avatar": "//a.storyblok.com/f/44162/1211x822/c73551377a/john-doe.png", "component": "author" }, "slug": "jane-doe", "full_slug": "authors/jane-doe", "sort_by_date": null, "position": -10, "tag_list": [], "is_startpage": false, "parent_id": 107352, "meta_data": null, "group_id": "e70ef646-5de2-42d6-acb3-0cda9f3388be", "first_published_at": "2018-08-23T08:18:08.196Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null } ], "links": []}Thanks! We received your feedback.
An error occurred. Please try again.
Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community