Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/216e0503-fa8e-434c-abca-213871775bc9

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-8bec5bab-16cb-49d9-bf7b-faef22384d82
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.eyJ1c2VyX2lkIjoidWFhLWlkLTE3IiwiZW1haWwiOiJlbWFpbC0xN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ0NzgyOTIwfQ.GR-HMjrjFeQIHnInrp9LM8V4sXW7cd85peN5qNrvkcc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3IiwiZW1haWwiOiJlbWFpbC0xN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQ0NzgyOTIwfQ.GR-HMjrjFeQIHnInrp9LM8V4sXW7cd85peN5qNrvkcc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "216e0503-fa8e-434c-abca-213871775bc9",
    "url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9",
    "created_at": "2015-10-07T00:35:20Z",
    "updated_at": "2015-10-07T00:35:20Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "634e9242-67da-4b1f-9b52-d1df492a037e",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/634e9242-67da-4b1f-9b52-d1df492a037e",
    "developers_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/developers",
    "managers_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/managers",
    "auditors_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/auditors",
    "apps_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/apps",
    "routes_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/routes",
    "domains_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/domains",
    "service_instances_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/service_instances",
    "app_events_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/app_events",
    "events_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/events",
    "security_groups_url": "/v2/spaces/216e0503-fa8e-434c-abca-213871775bc9/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 27e77c56-ea7a-4e5d-a572-303e5322bcc5
Content-Length: 1301
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.space.update

Attribute Name Value
id 4
guid fa59f649-bfc9-4f59-9863-52c57bedcd0f
created_at 2015-10-07 00:35:20 UTC
updated_at
timestamp 2015-10-07 00:35:20 UTC
type audit.space.update
actor uaa-id-17
actor_type user
actee 216e0503-fa8e-434c-abca-213871775bc9
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid 634e9242-67da-4b1f-9b52-d1df492a037e
space_guid 216e0503-fa8e-434c-abca-213871775bc9
actor_name email-17@somedomain.com
actee_name New Space Name