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-356/spaces/13d51a8e-733a-4765-9ad5-f7d9bf595429

Parameters

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

Body

Name Description Default Valid Values Example Values

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1NyIsImVtYWlsIjoiZW1haWwtMjc2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjZ9.SscC9B-fDuNwzbXNhPVI9W9gnSwU7jaPdmriCcCo-Mw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-356/spaces/13d51a8e-733a-4765-9ad5-f7d9bf595429" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1NyIsImVtYWlsIjoiZW1haWwtMjc2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjZ9.SscC9B-fDuNwzbXNhPVI9W9gnSwU7jaPdmriCcCo-Mw" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-356",
    "url": "/v2/users/uaa-id-356",
    "created_at": "2015-05-15T16:53:46Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "13d51a8e-733a-4765-9ad5-f7d9bf595429",
    "default_space_url": "/v2/spaces/13d51a8e-733a-4765-9ad5-f7d9bf595429",
    "spaces_url": "/v2/users/uaa-id-356/spaces",
    "organizations_url": "/v2/users/uaa-id-356/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-356/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-356/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-356/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-356/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-356/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 0234550e-f288-4e7b-8adc-f44ea869c1b2
Content-Length: 845
X-Content-Type-Options: nosniff