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.eyJ1c2VyX2lkIjoxMTE0LCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTh9.cnx68U8Xq45x0DfW5ebckJMb5x625uuB3MB1MwBbNG4" \

Response

Body

{
  "space": {
    "name": "Space B",
    "domain": "http://example.storyblok.com",
    "uniq_domain": null,
    "plan": "starter",
    "plan_level": 0,
    "limits": {
    },
    "created_at": "2018-11-10T15:33:18.402Z",
    "id": 680,
    "role": "admin",
    "owner_id": 1114,
    "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": "8IE7MzYCzw5d7KLckDa38Att",
    "has_pending_tasks": false,
    "options": {
    },
    "collaborators": [

    ],
    "settings": [

    ],
    "owner": {
      "userid": "ewell@feil.io",
      "email": "ewell@feil.io",
      "organization": null,
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 1114,
      "login_strategy": "password",
      "created_at": "2018-11-10T15:33:18.368Z",
      "org_role": null,
      "has_org": false
    }
  }
}

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/681" -d '{"space":{"name":"Space C","uniq_domain":"www.storywww4fcc7c65.com"}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMTE2LCJ0aW1lc3RhbXAiOjE1NDI0Njg3OTh9.tIAz_W5UBatXhDoBm9O3wdzZTJf2ltCl8Yx2BhTBohg" \

Response

Body

{
  "space": {
    "name": "Space C",
    "domain": "http://xxx.me.storyblok.com",
    "uniq_domain": "www.storywww4fcc7c65.com",
    "plan": "starter",
    "plan_level": 999,
    "limits": {
      "plan_level": 999,
      "max_collaborators": 999
    },
    "created_at": "2018-11-10T15:33:18.650Z",
    "id": 681,
    "role": "admin",
    "owner_id": 1116,
    "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": "",
    "has_pending_tasks": false,
    "options": {
    },
    "collaborators": [

    ],
    "settings": [

    ],
    "owner": {
      "userid": "reba@bradtke.io",
      "email": "reba@bradtke.io",
      "organization": null,
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 1116,
      "login_strategy": "password",
      "created_at": "2018-11-10T15:33:18.636Z",
      "org_role": null,
      "has_org": false
    }
  }
}

Documentation