Retrieve Current Space
Retrieve information about the current Storyblok space including cache version, domain, and language configuration.
https://api.storyblok.com/v2/cdn/spaces/meQuery parameters
Section titled “Query parameters”versionstringThe content version to retrieve:
draftorpublished. Default ispublished. Retrievingdraftrequires a preview access token.tokenrequired stringA preview or public access token configured in a space.
Response properties
Section titled “Response properties”spaceSpaceShow child properties
idintegerSpace ID.
namestringSpace name.
domainstringDomain associated with the space (configured under Visual Editor → Location).
versionintegerCached version Unix timestamp. Learn more in the Caching concept.
language_codesarray<string>An array of language codes configured in the space.
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/spaces/me\?token=YOUR_ACCESS_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "ask9soUkv02QqbZgmZdeDAtt",});
try { const response = await storyblok.get('cdn/spaces/me', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('spaces/me')->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/spaces/me?token=YOUR_ACCESS_TOKEN") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/spaces/me?token=YOUR_ACCESS_TOKEN");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/spaces/me"
querystring = {"token":"YOUR_ACCESS_TOKEN"}
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.space()// .package(url: "https://github.com/storyblok/storyblok-swift.git", from: "1.1.0")let storyblok = URLSession(storyblok: .cdn(accessToken: "YOUR_ACCESS_TOKEN"))let request = URLRequest(storyblok: storyblok, path: "spaces/me")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))// implementation("com.storyblok:ktor-client-storyblok:0.7.1")val client = HttpClient { install(Storyblok(CDN)) { accessToken = "YOUR_ACCESS_TOKEN" }}
val response = client.get("spaces/me")
println(response.body<JsonElement>()){"space": { "id": 12345, "name": "Space A", "domain": "http://example.storyblok.com", "version": 1717516800, "language_codes": [ "de", "fr" ]}}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.
- Need help?Contact support (opens in a new window)
- Something isn’t right?Check system status (opens in a new window)
Get in touch with the Storyblok community