1. Retrieve Multiple Links

Retrieve Multiple Links

Returns the links object containing all links of one space including the draft and published links. To get only published links, use the version=published.

/links

This endpoint is paginated by default. To receive more than the default of 25 link entries, the per_page parameter can be set to a maximum of 1000. Please refer to Pagination for further information.

For spaces created before May 9th, 2023, the links endpoint is not paginated by default. To enable pagination, set the paginated parameter to 1.

Query Parameters

  • token

    required string

    A preview or public access token configured in a space.

  • starts_with

    string

    Filter by full_slug. Can be used to retrieve all links from a specific folder. Examples: starts_with=de/beitraege, starts_with=en/posts

  • version

    string

    Default: published. Possible values: draft, published

  • 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.

  • with_parent

    number

    Filters links by parent_id. Can be set to 0 to return entries not located in a folder. In contrast, specifying a folder's id returns only entries located in this particular folder.

  • include_dates

    number

    Default: 0. If set to 1, the following fields are included in the response: published_at, created_at, updated_at.

  • page

    number

    Default: 1. Learn more under Pagination.

  • per_page

    number

    Default: 25. Max: 1000. Learn more under Pagination.

  • paginated

    number

    For spaces created before May 9th, 2023, the links endpoint is not paginated by default. Setting this parameter to 1 enables pagination. This parameter does not impact spaces created after May 9th, 2023, i.e., pagination cannot be disabled for these spaces.

Response Properties

  • links

    The Link Object

    An object of link objects, with each key constituting a link uuid .

    • id

      number

      The numeric ID

    • uuid

      string

      Generated UUID string

    • slug

      string

      The full slug of the story or folder

    • path

      string

      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

      string

      The complete name of the story or folder

    • published

      boolean

      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

        string

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

      • name

        string

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

      • lang

        string

        Language code of this story variant

      • published

        boolean

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

      • translated_slug

        string

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

Request
curl "https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles" \
  -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/links', {
  "version": "published",
  "starts_with": "articles"
})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');

$client->getLinks('/links', [
  "version" =>  "published",
  "starts_with" =>  "articles"
])->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.links({:params => {
  "version" =>  "published",
  "starts_with" =>  "articles"
}})
Request
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles")
  .asString();
Request
var client = new RestClient("https://api.storyblok.com/v2/cdn/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles");
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/links?token=krcV6QGxWORpYLUWt12xKQtt&version=published&starts_with=articles")! 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/links"

querystring = {"token":"krcV6QGxWORpYLUWt12xKQtt","version":"published","starts_with":"articles"}

payload = ""
headers = {}

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

print(response.text)
Response
{
  "links": {
    "47ba3d20-3962-4017-b158-b268a976b683": {
      "id": 444991588,
      "uuid": "47ba3d20-3962-4017-b158-b268a976b683",
      "slug": "articles",
      "path": null,
      "parent_id": null,
      "name": "Articles",
      "is_folder": true,
      "published": false,
      "is_startpage": false,
      "position": 0,
      "real_path": "/articles"
    },
    "660452d2-1a68-4493-b5b6-2f03b6fa722b": {
      "id": 444996765,
      "uuid": "660452d2-1a68-4493-b5b6-2f03b6fa722b",
      "slug": "articles/earths-symphony-navigating-wonders-challenges-blue-oasis",
      "path": null,
      "parent_id": 444991588,
      "name": "Earth's Symphony: Navigating the Wonders and Challenges of Our Blue Oasis",
      "is_folder": false,
      "published": true,
      "is_startpage": false,
      "position": 0,
      "real_path": "/articles/earths-symphony-navigating-wonders-challenges-blue-oasis"
    },
    "a2c57c06-2c5c-4819-acb7-0d9c047d16e9": {
      "id": 445002665,
      "uuid": "a2c57c06-2c5c-4819-acb7-0d9c047d16e9",
      "slug": "articles/mars-unveiled-exploring-mysteries-marvels-red-frontier",
      "path": null,
      "parent_id": 444991588,
      "name": "Mars Unveiled: Exploring the Mysteries and Marvels of the Red Frontier",
      "is_folder": false,
      "published": true,
      "is_startpage": false,
      "position": 0,
      "real_path": "/articles/mars-unveiled-exploring-mysteries-marvels-red-frontier"
    }
  }
}