Home
Version 3
Spaces API

Spaces API

Update a Space

PUT /v2/spaces/:guid

Request

Route

PUT /v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d

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-01c51577-1048-4057-9cc8-7a6086cd8fa7
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.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MCIsImVtYWlsIjoiZW1haWwtMTI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg4NTU2NzR9.5nzVeCUWEZOYZdkqMvZzyK7d7y0jdA3W98oOsCDZLBY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d" -d '{
  "name": "New Space Name"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MCIsImVtYWlsIjoiZW1haWwtMTI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg4NTU2NzR9.5nzVeCUWEZOYZdkqMvZzyK7d7y0jdA3W98oOsCDZLBY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "0b074c59-f20d-4552-84bc-50f5eca1807d",
    "url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d",
    "created_at": "2016-03-17T21:41:14Z",
    "updated_at": "2016-03-17T21:41:14Z"
  },
  "entity": {
    "name": "New Space Name",
    "organization_guid": "cff09422-a602-4c7f-8986-29120436a250",
    "space_quota_definition_guid": null,
    "allow_ssh": true,
    "organization_url": "/v2/organizations/cff09422-a602-4c7f-8986-29120436a250",
    "developers_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/developers",
    "managers_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/managers",
    "auditors_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/auditors",
    "apps_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/apps",
    "routes_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/routes",
    "domains_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/domains",
    "service_instances_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/service_instances",
    "app_events_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/app_events",
    "events_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/events",
    "security_groups_url": "/v2/spaces/0b074c59-f20d-4552-84bc-50f5eca1807d/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 21
guid d15aa209-c0c0-43ae-9065-93dc5cf13c65
created_at 2016-03-17 21:41:14 UTC
updated_at
timestamp 2016-03-17 21:41:14 UTC
type audit.space.update
actor uaa-id-190
actor_type user
actee 0b074c59-f20d-4552-84bc-50f5eca1807d
actee_type space
metadata
{
  "request": {
    "name": "New Space Name"
  }
}
space_id
organization_guid cff09422-a602-4c7f-8986-29120436a250
space_guid 0b074c59-f20d-4552-84bc-50f5eca1807d
actor_name email-129@somedomain.com
actee_name New Space Name