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-277/spaces/a9097c54-247d-4d72-922f-c5a6bbb44e3a

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OCIsImVtYWlsIjoiZW1haWwtMjAxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1Mjl9.AXEhSNH-M1Iyeu8rc19UTGVSMbxXxg_NmkMMlSHU9P8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-277/spaces/a9097c54-247d-4d72-922f-c5a6bbb44e3a" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3OCIsImVtYWlsIjoiZW1haWwtMjAxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1Mjl9.AXEhSNH-M1Iyeu8rc19UTGVSMbxXxg_NmkMMlSHU9P8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-277",
    "url": "/v2/users/uaa-id-277",
    "created_at": "2015-11-30T23:38:49Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "a9097c54-247d-4d72-922f-c5a6bbb44e3a",
    "default_space_url": "/v2/spaces/a9097c54-247d-4d72-922f-c5a6bbb44e3a",
    "spaces_url": "/v2/users/uaa-id-277/spaces",
    "organizations_url": "/v2/users/uaa-id-277/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-277/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-277/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-277/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-277/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-277/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 845
X-Content-Type-Options: nosniff