1. Retrieve Current Space

Retrieve Current Space

Returns the space object for the space associated with the access token provided as a query parameter.

/spaces/me

Query Parameters

  • token

    required string

    A preview or public access token configured in a space.

Response Properties

  • space

    The Space Object

    The complete space object

    • id

      number

      The space ID

    • name

      string

      The space name

    • domain

      string

      The domain associated with the space (configured as the default environment for the Visual Editor).

    • version

      string

      The timestamp of the latest changes in the space. This is useful for filling the cv parameter, for example, calling the story API endpoint.

    • language_codes

      string[]

      An array of language i18n codes, representing all languages that are configured in the space.

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

$client->get('/spaces/me')->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/spaces/me?token=ask9soUkv02QqbZgmZdeDAtt")
  .asString();
Request
var client = new RestClient("https://api.storyblok.com/v2/cdn/spaces/me?token=ask9soUkv02QqbZgmZdeDAtt");
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/spaces/me?token=ask9soUkv02QqbZgmZdeDAtt")! 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/spaces/me"

querystring = {"token":"ask9soUkv02QqbZgmZdeDAtt"}

payload = ""
headers = {}

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

print(response.text)
Response
{
  "space": {
    "id": 123456,
    "name": "Storyblok",
    "domain": "https://www.storyblok.com/",
    "version": 1544117388,
    "language_codes": ["de", "es"]
  }
}