---
title: Get Story Versions
description: Retrieve the versions of a story.
url: https://storyblok.com/docs/api/management/stories/get-story-versions-new
---

# Get Story Versions

GET

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

Retrieve the versions of a story.

> [!NOTE]
> This endpoint returns story versions created after August 28, 2024. For older versions, use the [legacy endpoint](/docs/api/management/stories/get-story-versions).

## Path parameters

-   `:space_id` (required) (number)
    
    Numeric ID of a space
    

## Query parameters

-   `by_story_id` (required) (number)
    
    ID of the story whose versions shall be returned.
    
-   `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](/docs/api/content-delivery/v2/getting-started/pagination).
    
-   `per_page` (number)
    
    Default: `25`. Max: `100`. Learn more under [Pagination](/docs/api/content-delivery/v2/getting-started/pagination).
    
-   `show_content` (boolean)
    
    Enable the retrieval of the content of each story version. Disable by default.
    

## Response properties

-   `story_versions` (object\[\])
    
    An array of objects representing a story version.
    
    -   `id` (number)
        
        Numeric id of the story version
        
    -   `created_at` (string)
        
        Creation date (Format: `yyy-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
        
    -   `content` (object)
        
        This object contains the Story’s content when the `show_content` parameter is used
        
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions\
    ?by_story_id=174957" \
      -H "Authorization: YOUR_OAUTH_TOKEN"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",
    });
    
    try {
      const response = await storyblok.get('spaces/288868932106293/story_versions', {
        "by_story_id": "174957"
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
    
    $client->get('spaces/288868932106293/story_versions', [
      "by_story_id" => "174957"
    ])->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions?by_story_id=174957")
      .header("Authorization", "YOUR_OAUTH_TOKEN")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions?by_story_id=174957");
    var request = new RestRequest(Method.GET);
    
    request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://mapi.storyblok.com/v1/spaces/288868932106293/story_versions"
    
    querystring = {"by_story_id":"174957"}
    
    payload = ""
    headers = {
      'Authorization': "YOUR_OAUTH_TOKEN"
    }
    
    response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
    
    client.get('spaces/288868932106293/story_versions', {:params => {
      "by_story_id" => "174957"
    }})
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))
    var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/story_versions")
    request.url!.append(queryItems: [
        URLQueryItem(name: "by_story_id", value: "174957")
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(MAPI)) {
            accessToken = OAuth("YOUR_OAUTH_TOKEN")
        }
    }
    
    val response = client.get("spaces/288868932106293/story_versions") {
        url {
            parameters.append("by_story_id", "174957")
        }
    }
    
    println(response.body<JsonElement>())
    ```

## Pagination

-   [Previous: Get Story Versions (Legacy)](/docs/api/management/stories/get-story-versions)
-   [Next: Get Unpublished Dependencies](/docs/api/management/stories/get-unpublished-dependencies)
