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.eyJ1c2VyX2lkIjo4NzAsInRpbWVzdGFtcCI6MTUzMjY4MDQ4NH0.16ggPaAuI7gDDqXD3OF_PAI682qceNvuvc9an6E-H4s" \

Response

Body

{
  "space": {
    "name": "Space B",
    "domain": "http://example.storyblok.com",
    "uniq_domain": null,
    "plan": "starter",
    "plan_level": 0,
    "limits": {
    },
    "created_at": "2018-07-20T08:34:44.866Z",
    "id": 612,
    "role": "admin",
    "owner_id": 870,
    "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": "DQHNg7RhMrFaWERqtkKz7Att",
    "collaborators": [

    ],
    "settings": [

    ],
    "owner": {
      "userid": "moie.connelly@blockweimann.biz",
      "email": "moie.connelly@blockweimann.biz",
      "organization": null,
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 870,
      "login_strategy": "password",
      "created_at": "2018-07-20T08:34:44.845Z"
    }
  }
}

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

Response

Body

{
  "space": {
    "name": "Space C",
    "domain": "http://xxx.me.storyblok.com",
    "uniq_domain": "www.storywwwb6cdc96e.com",
    "plan": "starter",
    "plan_level": 999,
    "limits": {
      "plan_level": 999,
      "max_collaborators": 999
    },
    "created_at": "2018-07-20T08:34:45.030Z",
    "id": 613,
    "role": "admin",
    "owner_id": 872,
    "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": "troy.romaguera@leannongoyette.org",
      "email": "troy.romaguera@leannongoyette.org",
      "organization": null,
      "username": null,
      "use_username": false,
      "alt_email": null,
      "firstname": null,
      "lastname": null,
      "phone": null,
      "id": 872,
      "login_strategy": "password",
      "created_at": "2018-07-20T08:34:45.021Z"
    }
  }
}

Documentation