Home
Version 3
Users API

Users API

Associate Space with the User

PUT /v2/users/:guid/spaces/:space_guid

Request

Route

PUT /v2/users/uaa-id-24/spaces/7e5e2308-0c31-4b47-a10f-fd27a44465e8

Parameters

Name Description Valid Values Example Values
guid The guid of the User
space_guid The guid of the space

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1IiwiZW1haWwiOiJlbWFpbC0xMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc0fQ.sWrXtR30taacqVN0htlO25SEWzhII1ZC-y4qWu6XO1Y
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-24/spaces/7e5e2308-0c31-4b47-a10f-fd27a44465e8" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1IiwiZW1haWwiOiJlbWFpbC0xMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc0fQ.sWrXtR30taacqVN0htlO25SEWzhII1ZC-y4qWu6XO1Y" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-24",
    "url": "/v2/users/uaa-id-24",
    "created_at": "2015-07-06T23:22:54Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "7e5e2308-0c31-4b47-a10f-fd27a44465e8",
    "default_space_url": "/v2/spaces/7e5e2308-0c31-4b47-a10f-fd27a44465e8",
    "spaces_url": "/v2/users/uaa-id-24/spaces",
    "organizations_url": "/v2/users/uaa-id-24/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-24/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-24/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-24/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-24/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-24/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f65a9d3e-53f1-4505-b9cc-f5363b63b1cf
Content-Length: 836
X-Content-Type-Options: nosniff