Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32

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-013db2f3-cfdd-4bc6-80bb-58d8f49701d8
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.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OSIsImVtYWlsIjoiZW1haWwtMjg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NjV9.8f_5mGVtmcwYvohhqgFBPtyhDV21rVZkBJzzD3BOYr4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OSIsImVtYWlsIjoiZW1haWwtMjg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NjV9.8f_5mGVtmcwYvohhqgFBPtyhDV21rVZkBJzzD3BOYr4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "b0bda016-e1f8-4751-90ad-766d87d45c32",
    "url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32",
    "created_at": "2015-06-16T23:41:05Z",
    "updated_at": "2015-06-16T23:41:05Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "5664a129-ce05-44ab-93d9-cb2850a7275f",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/5664a129-ce05-44ab-93d9-cb2850a7275f",
    "developers_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/developers",
    "managers_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/managers",
    "auditors_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/auditors",
    "apps_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/apps",
    "routes_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/routes",
    "domains_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/domains",
    "service_instances_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/service_instances",
    "app_events_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/app_events",
    "events_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/events",
    "security_groups_url": "/v2/spaces/b0bda016-e1f8-4751-90ad-766d87d45c32/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: e6dddb94-b635-4344-bb9d-8226a4cfba0c
Content-Length: 1301
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.update

Attribute Name Value
id 171
guid 9d5223c4-940a-4e4f-8e21-675e01cc9a76
created_at 2015-06-16 23:41:05 UTC
updated_at
timestamp 2015-06-16 23:41:05 UTC
type audit.space.update
actor uaa-id-369
actor_type user
actee b0bda016-e1f8-4751-90ad-766d87d45c32
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id 172
organization_guid 5664a129-ce05-44ab-93d9-cb2850a7275f
space_guid b0bda016-e1f8-4751-90ad-766d87d45c32
actor_name email-285@somedomain.com
actee_name New Space Name