Home
Version 3
Spaces API

Spaces API

Creating a Space

POST /v2/spaces/

Request

Route

POST /v2/spaces

Body

Name Description Default Valid Values Example Values
name The name of the space
  • development
  • demo
  • production
organization_guid The guid of the associated organization
  • guid-4467dcf0-a2e4-48d9-af0b-e145c807e63c
developer_guids The list of the associated developers
manager_guids The list of the associated managers
auditor_guids The list of the associated auditors
domain_guids The list of the associated domains
security_group_guids The list of the associated security groups
space_quota_definition_guid The guid of the associated space quota definition
allow_ssh Whether or not Space Developers can enable ssh on apps in the space
{
  "name": "development",
  "organization_guid": "db47d891-81e7-4af1-af5a-7cdff8de09e2"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwNyIsImVtYWlsIjoiZW1haWwtMzAzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzUwMDB9.q95t3MexSv2HUcbyamGRntEt0zFIZHJ6N_nfIjBL_cs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces" -d '{
  "name": "development",
  "organization_guid": "db47d891-81e7-4af1-af5a-7cdff8de09e2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQwNyIsImVtYWlsIjoiZW1haWwtMzAzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzI3NzUwMDB9.q95t3MexSv2HUcbyamGRntEt0zFIZHJ6N_nfIjBL_cs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "f8f904d3-72f7-4c8f-b821-a21600dcc25e",
    "url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e",
    "created_at": "2015-05-21T01:03:20Z",
    "updated_at": null
  },
  "entity": {
    "name": "development",
    "organization_guid": "db47d891-81e7-4af1-af5a-7cdff8de09e2",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/db47d891-81e7-4af1-af5a-7cdff8de09e2",
    "developers_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/developers",
    "managers_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/managers",
    "auditors_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/auditors",
    "apps_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/apps",
    "routes_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/routes",
    "domains_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/domains",
    "service_instances_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/service_instances",
    "app_events_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/app_events",
    "events_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/events",
    "security_groups_url": "/v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/spaces/f8f904d3-72f7-4c8f-b821-a21600dcc25e
X-VCAP-Request-ID: 1174821e-8253-4d81-82ef-be0b3b61ce2c
Content-Length: 1280
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.create

Attribute Name Value
id 11
guid 8c02e687-e6f3-41c1-9696-a0859b8b36ca
created_at 2015-05-21 01:03:20 UTC
updated_at
timestamp 2015-05-21 01:03:20 UTC
type audit.space.create
actor uaa-id-407
actor_type user
actee f8f904d3-72f7-4c8f-b821-a21600dcc25e
actee_type space
metadata
{
  "request": {
    "name": "development",
    "organization_guid": "db47d891-81e7-4af1-af5a-7cdff8de09e2",
    "allow_ssh": true
  }
}
space_id 67
organization_guid db47d891-81e7-4af1-af5a-7cdff8de09e2
space_guid f8f904d3-72f7-4c8f-b821-a21600dcc25e
actor_name email-303@somedomain.com
actee_name development