Space

Creating a space

Endpoint

POST /v1/spaces

Parameters

Name Description
space[name] required Name of space
space[domain] Domain
space[parent_id] Parent id = Space id of master space
space[dup_id] Space id for duplication

Request

cURL

curl "https://api.storyblok.com/v1/spaces" -d '{"space":{"name":"Space B","domain":"http://example.storyblok.com"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMjksInRpbWVzdGFtcCI6MTUyODY1MjQwMX0.SOgRkYXJv6yxPHfisVSi_9qkxRCFBlHcpEAfi_TNpVw" \

Response

Body

{
  "space": {
    "name": "Space B",
    "domain": "http://example.storyblok.com",
    "uniq_domain": null,
    "plan": "starter",
    "plan_level": 0,
    "limits": {
    },
    "created_at": "2018-06-03T17:40:01.554Z",
    "id": 148,
    "role": "admin",
    "owner_id": 229,
    "story_published_hook": null,
    "environments": null,
    "stories_count": 1,
    "parent_id": null,
    "assets_count": 0,
    "searchblok_id": null,
    "duplicatable": null,
    "request_count_today": 0,
    "api_requests": 1000,
    "exceeded_requests": 0,
    "billing_address": {
    },
    "routes": [

    ],
    "euid": null,
    "trial": true,
    "default_root": "page",
    "has_slack_webhook": false,
    "api_logs_per_month": [

    ],
    "first_token": "yncr3nI4xMUxU1BIGdinQwtt",
    "collaborators": [

    ],
    "settings": [

    ],
    "owner": {
      "userid": "fern@schumm.co",
      "email": "fern@schumm.co",
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 229,
      "login_strategy": "password",
      "created_at": "2018-06-03T17:40:01.530Z"
    }
  }
}

Updating a space

Endpoint

PUT /v1/spaces/:id

Parameters

Name Description
space[name] required Name of space
space[uniq_domain] Domain of space
space[owner_id] Owner of the space

Request

cURL

curl "https://api.storyblok.com/v1/spaces/149" -d '{"space":{"name":"Space C","uniq_domain":"www.storywwwac0d723c.com"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMzEsInRpbWVzdGFtcCI6MTUyODY1MjQwMX0.e4pve9_NhOXhUUu-uTlGVHvyWkh-_oiuBKBjmV2WEcU" \

Response

Body

{
  "space": {
    "name": "Space C",
    "domain": "http://xxx.me.storyblok.com",
    "uniq_domain": "www.storywwwac0d723c.com",
    "plan": "starter",
    "plan_level": 999,
    "limits": {
      "plan_level": 999,
      "max_collaborators": 999
    },
    "created_at": "2018-06-03T17:40:01.693Z",
    "id": 149,
    "role": "admin",
    "owner_id": 231,
    "story_published_hook": null,
    "environments": null,
    "stories_count": 0,
    "parent_id": null,
    "assets_count": 0,
    "searchblok_id": null,
    "duplicatable": null,
    "request_count_today": 0,
    "api_requests": 1000,
    "exceeded_requests": 0,
    "billing_address": {
    },
    "routes": [

    ],
    "euid": null,
    "trial": true,
    "default_root": "root",
    "has_slack_webhook": false,
    "api_logs_per_month": [

    ],
    "first_token": "",
    "collaborators": [

    ],
    "settings": [

    ],
    "owner": {
      "userid": "leanna@parisianboehm.io",
      "email": "leanna@parisianboehm.io",
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 231,
      "login_strategy": "password",
      "created_at": "2018-06-03T17:40:01.685Z"
    }
  }
}

Documentation