1. Retrieve Multiple Datasources

Retrieve Multiple Datasources

Returns an array of all datasources (as datasource objects) contained in a Storyblok space.

/datasources

This endpoint is paginated by default, including a maximum of 1000 datasources in the response. Learn more under Pagination.

Query Parameters

  • token

    required string

    A preview or public access token configured in a space.

  • page

    number

    Numeric. default: 1. Read more at Pagination

  • per_page

    number

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

Response Properties

  • datasources

    The Datasource Object[]

    An array of datasource objects.

    • id

      number

      The numeric ID

    • name

      string

      The complete name provided for the datasource

    • slug

      string

      The unique slug of the datasource

    • dimensions

      object[]

      An array listing the dimensions (e.g., per country, region, language, or other context) defined for the datasource

      • id

        number

        The numeric ID

      • name

        string

        The complete name provided for the datasource

      • entry_value

        string

        The value provided for the datasource dimension (e.g., a language code)

      • datasource_id

        number

        The numeric ID of the datasource that the dimension belongs to

      • created_at

        string

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

      • updated_at

        string

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

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

$client->get('/datasources')->getBody();
Request
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')

client.space()
Request
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt")
  .asString();
Request
var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources?token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
This is swift code
Request
import requests

url = "https://api.storyblok.com/v2/cdn/datasources"

querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}

payload = ""
headers = {}

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

print(response.text)
Response
{
  "datasources": [
    {
      "id": 313699,
      "name": "Background Color Options",
      "slug": "background-color-options",
      "dimensions": []
    },
    {
      "id": 313701,
      "name": "Button Color Options",
      "slug": "button-color-options",
      "dimensions": []
    },
    {
      "id": 313702,
      "name": "Product Labels",
      "slug": "product-labels",
      "dimensions": [
        {
          "id": 68105,
          "name": "German",
          "entry_value": "de",
          "datasource_id": 313702,
          "created_at": "2024-03-15T12:17:10.279Z",
          "updated_at": "2024-03-15T12:17:10.279Z"
        }
      ]
    }
  ]
}