Storyblok
Search Storyblok's Documentation
  1. Get Story Versions (New)

Get Story Versions (New)

This allows you to retrieve the versions of a story and the corresponding author information. You can also filter the results based on pagination using the page parameter. This can be done with a GET request on the story version you wish to retrieve.

https://mapi.storyblok.com/v1/spaces/:space_id/story_versions

This endpoint returns story versions created after 2024-08-28. For older versions, use the legacy endpoint.

Path Parameters

  • :space_id

    required number

    Numeric ID of a space

Query Parameters

  • by_story_id

    required number

    ID of the story. When this is passed, the endpoint returns versions of this particular story.

  • by_release_id

    number

    ID of the release. When this is passed, the endpoint returns versions of all stories within the release and stories not associated with a particular release.

  • page

    number

    Default: 1. Learn more under Pagination.

  • per_page

    number

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

Response Properties

  • story_versions

    object[]

    An array of objects with each object representing a version and details about the version

    • id

      number

      Numeric id of the story version

    • created_at

      string

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

    • user_id

      number

      User/numeric id of collaborator

    • user

      object

      Name of the author

      • id

        number

        The user ID

      • firstname

        string

        First name of collaborator

      • lastname

        string

        Last name of collaborator

      • alt_email

        string

        Email of collaborator

      • avatar

        string

        Avatar of collaborator usually an image

      • userid

        string

        User ID of collaborator

      • friendly_name

        string

        Friendly name of collaborator

    • story_id

      number

      ID of the story

    • status

      string

      Publication status of the version

    • release_id

      number

      ID of the release

    • parent_id

      number

      ID of the parent folder

Example Request

Request
curl "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957" \
  -X GET \
  -H "Authorization: YOUR_OAUTH_TOKEN" \
  -H "Content-Type: application/json"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('/spaces/302787/story_versions', {
  "by_story_id": "174957"
})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');

$client->get('/spaces/302787/story_versions', [
  "by_story_id" =>  "174957"
])->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.false('/spaces/302787/story_versions', {:params => {
  "by_story_id" =>  "174957"
}})
Request
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957")
  .header("Authorization", "YOUR_OAUTH_TOKEN")
  .asString();
Request
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957");
var request = new RestRequest(Method.GET);

request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
Request
import Foundation

let headers = [
  "Content-Type": "application/json",
  "Authorization": "YOUR_OAUTH_TOKEN"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
request.allHTTPHeaderFields = headers

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://mapi.storyblok.com/v1/spaces/302787/story_versions"

querystring = {"by_story_id":"174957"}

payload = ""
headers = {
  'Content-Type': "application/json",
  'Authorization': "YOUR_OAUTH_TOKEN"
}

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

print(response.text)

Example Request with Pagination

Request
curl "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2" \
  -X GET \
  -H "Authorization: YOUR_OAUTH_TOKEN" \
  -H "Content-Type: application/json"
Request
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('/spaces/302787/story_versions', {
  "by_story_id": "174957",
  "page": "2"
})
  .then(response => {
    console.log(response)
  }).catch(error => { 
    console.log(error)
  })
Request
$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');

$client->get('/spaces/302787/story_versions', [
  "by_story_id" =>  "174957",
  "page" =>  "2"
])->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.false('/spaces/302787/story_versions', {:params => {
  "by_story_id" =>  "174957",
  "page" =>  "2"
}})
Request
HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2")
  .header("Authorization", "YOUR_OAUTH_TOKEN")
  .asString();
Request
var client = new RestClient("https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2");
var request = new RestRequest(Method.GET);

request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
IRestResponse response = client.Execute(request);
Request
import Foundation

let headers = [
  "Content-Type": "application/json",
  "Authorization": "YOUR_OAUTH_TOKEN"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://mapi.storyblok.com/v1/spaces/302787/story_versions?by_story_id=174957&page=2")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.method = "GET"
request.allHTTPHeaderFields = headers

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://mapi.storyblok.com/v1/spaces/302787/story_versions"

querystring = {"by_story_id":"174957","page":"2"}

payload = ""
headers = {
  'Content-Type': "application/json",
  'Authorization': "YOUR_OAUTH_TOKEN"
}

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

print(response.text)