Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5

Parameters

Name Description Valid Values Example Values
guid The guid of the Space

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-49a92455-864e-435e-a62a-1f78c6875119
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
allow_ssh Whether or not Space Developers can enable ssh on apps in the space
{
  "name": "New Space Name"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMSIsImVtYWlsIjoiZW1haWwtNzVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTM3NDYyN30.Mb77Yt_4w4tZ6P-qQTzxzIBPO3vdD2P5Jk7qDz7CIl4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExMSIsImVtYWlsIjoiZW1haWwtNzVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTM3NDYyN30.Mb77Yt_4w4tZ6P-qQTzxzIBPO3vdD2P5Jk7qDz7CIl4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5",
    "url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5",
    "created_at": "2016-04-16T01:23:47Z",
    "updated_at": "2016-04-16T01:23:47Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "fca8f0a5-3882-403f-ab10-6140c6ea8af5",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/fca8f0a5-3882-403f-ab10-6140c6ea8af5",
    "developers_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/developers",
    "managers_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/managers",
    "auditors_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/auditors",
    "apps_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/apps",
    "routes_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/routes",
    "domains_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/domains",
    "service_instances_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/service_instances",
    "app_events_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/app_events",
    "events_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/events",
    "security_groups_url": "/v2/spaces/37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: d2e1df14-560d-4f70-a575-62c82c5379c4
Content-Length: 1301
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.update

Attribute Name Value
id 12
guid 389053ad-2b1d-4b24-b557-45e03e43ead4
created_at 2016-04-16 01:23:47 UTC
updated_at
timestamp 2016-04-16 01:23:47 UTC
type audit.space.update
actor uaa-id-111
actor_type user
actee 37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid fca8f0a5-3882-403f-ab10-6140c6ea8af5
space_guid 37427b12-d04b-4d3a-8cbf-63cb3e9fe2d5
actor_name email-75@somedomain.com
actee_name New Space Name