Users API

Associate Space with the User

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

Request

Route

PUT /v2/users/uaa-id-305/spaces/063d1561-16ab-4ece-825d-30e3814f4e2f

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwNiIsImVtYWlsIjoiZW1haWwtMjA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.UEzbJLICFlDZmEWErqoYTkAQ9KqlneTYW5leYi1VZ3M
Host: example.org
Content-Type: application/json
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-305/spaces/063d1561-16ab-4ece-825d-30e3814f4e2f" -d '' -X PUT \
  -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwNiIsImVtYWlsIjoiZW1haWwtMjA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.UEzbJLICFlDZmEWErqoYTkAQ9KqlneTYW5leYi1VZ3M" \
  -H "Host: example.org" \
  -H "Content-Type: application/json" \
  -H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-305",
    "url": "/v2/users/uaa-id-305",
    "created_at": "2016-06-08T16:41:36Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "063d1561-16ab-4ece-825d-30e3814f4e2f",
    "default_space_url": "/v2/spaces/063d1561-16ab-4ece-825d-30e3814f4e2f",
    "spaces_url": "/v2/users/uaa-id-305/spaces",
    "organizations_url": "/v2/users/uaa-id-305/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-305/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-305/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-305/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-305/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-305/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 1895ea1d-5867-4dfc-b8f3-28893ad96b37
Content-Length: 845
X-Content-Type-Options: nosniff

Audit Records Created By The Request

Audit Record: audit.user.space_developer_add

Attribute Name Value
id 3
guid 3ae5862c-fb43-49ed-935b-8feb7d0e19e8
created_at 2016-06-08 16:41:40 UTC
updated_at
timestamp 2016-06-08 16:41:40 UTC
type audit.user.space_developer_add
actor uaa-id-360
actor_type user
actee 2a01cf80-9fbf-448f-a7a0-1e415e28771e
actee_type space
metadata
{
  "request": null
}
organization_guid 28960823-1b68-4a2b-8f36-77cc573bccca
space_guid 2a01cf80-9fbf-448f-a7a0-1e415e28771e
actor_name [email protected]
actee_name development