Home
Version 3
Users API

Users API

Updating a User

PUT /v2/users/:guid

Request

Route

PUT /v2/users/uaa-id-158

Parameters

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

Body

Name Description Default Valid Values Example Values
default_space_guid The guid of the default space for apps created by this user.
admin Whether the user is an admin (Use UAA instead).
{
  "default_space_guid": "51062f62-715a-48d0-bc76-5a423b1446e6"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1OSIsImVtYWlsIjoiZW1haWwtMTM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NTJ9.u-t7YRpTPui3dpTYJiE0cuIg02jlMrda0AZXTHvncnI
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-158" -d '{
  "default_space_guid": "51062f62-715a-48d0-bc76-5a423b1446e6"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1OSIsImVtYWlsIjoiZW1haWwtMTM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NTJ9.u-t7YRpTPui3dpTYJiE0cuIg02jlMrda0AZXTHvncnI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-158",
    "url": "/v2/users/uaa-id-158",
    "created_at": "2015-06-16T23:40:52Z",
    "updated_at": "2015-06-16T23:40:52Z"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "51062f62-715a-48d0-bc76-5a423b1446e6",
    "default_space_url": "/v2/spaces/51062f62-715a-48d0-bc76-5a423b1446e6",
    "spaces_url": "/v2/users/uaa-id-158/spaces",
    "organizations_url": "/v2/users/uaa-id-158/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-158/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-158/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-158/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-158/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-158/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 3fddcdcd-2dc0-4bd0-877c-3388e88eaafe
Content-Length: 863
X-Content-Type-Options: nosniff