Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4

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-5747df10-fc10-4ad6-9482-ca0f6486e677
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.eyJ1c2VyX2lkIjoidWFhLWlkLTEiLCJlbWFpbCI6ImVtYWlsLTFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MjYwMTUyNH0.EujG5I5Xi1m0WxdTrhsj5pl0GLfevKTgTCdEOLdswF0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEiLCJlbWFpbCI6ImVtYWlsLTFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MjYwMTUyNH0.EujG5I5Xi1m0WxdTrhsj5pl0GLfevKTgTCdEOLdswF0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "025b2c6e-11d3-40af-8cbf-04cbdf49fee4",
    "url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4",
    "created_at": "2015-09-11T18:38:44Z",
    "updated_at": "2015-09-11T18:38:44Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "1f36dba6-46bb-4d2c-9683-4d26cf1ff85e",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/1f36dba6-46bb-4d2c-9683-4d26cf1ff85e",
    "developers_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/developers",
    "managers_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/managers",
    "auditors_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/auditors",
    "apps_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/apps",
    "routes_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/routes",
    "domains_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/domains",
    "service_instances_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/service_instances",
    "app_events_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/app_events",
    "events_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/events",
    "security_groups_url": "/v2/spaces/025b2c6e-11d3-40af-8cbf-04cbdf49fee4/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 19c7e5a5-79e7-4192-b516-b461814c83d7
Content-Length: 1301
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.update

Attribute Name Value
id 1
guid 3a8a7b80-f81e-48c8-bb82-c72cf12ac63e
created_at 2015-09-11 18:38:44 UTC
updated_at
timestamp 2015-09-11 18:38:44 UTC
type audit.space.update
actor uaa-id-1
actor_type user
actee 025b2c6e-11d3-40af-8cbf-04cbdf49fee4
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid 1f36dba6-46bb-4d2c-9683-4d26cf1ff85e
space_guid 025b2c6e-11d3-40af-8cbf-04cbdf49fee4
actor_name email-1@somedomain.com
actee_name New Space Name