Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f

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-805f80f0-49ee-42c3-ab91-82d379650c43
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.eyJ1c2VyX2lkIjoidWFhLWlkLTExIiwiZW1haWwiOiJlbWFpbC0xMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDUzMzEwOTcwfQ.KLJRgwS4AFw6Wo2FmbSyimWCELnZ9O9IlU4yxJ4jpBA
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTExIiwiZW1haWwiOiJlbWFpbC0xMUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDUzMzEwOTcwfQ.KLJRgwS4AFw6Wo2FmbSyimWCELnZ9O9IlU4yxJ4jpBA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a402975b-9615-423a-9fb1-3aaa439b295f",
    "url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f",
    "created_at": "2016-01-13T17:29:30Z",
    "updated_at": "2016-01-13T17:29:30Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "269796ce-51cb-46a9-a907-f9ba43304f92",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/269796ce-51cb-46a9-a907-f9ba43304f92",
    "developers_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/developers",
    "managers_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/managers",
    "auditors_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/auditors",
    "apps_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/apps",
    "routes_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/routes",
    "domains_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/domains",
    "service_instances_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/service_instances",
    "app_events_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/app_events",
    "events_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/events",
    "security_groups_url": "/v2/spaces/a402975b-9615-423a-9fb1-3aaa439b295f/security_groups"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
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 6040d272-5ffc-4e04-9218-fbc9c1325ed8
created_at 2016-01-13 17:29:30 UTC
updated_at
timestamp 2016-01-13 17:29:30 UTC
type audit.space.update
actor uaa-id-11
actor_type user
actee a402975b-9615-423a-9fb1-3aaa439b295f
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid 269796ce-51cb-46a9-a907-f9ba43304f92
space_guid a402975b-9615-423a-9fb1-3aaa439b295f
actor_name email-11@somedomain.com
actee_name New Space Name