Home
Version 3
Users API

Users API

Updating a User

PUT /v2/users/:guid

Request

Route

PUT /v2/users/uaa-id-349

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": "7fa03808-d7c1-4360-bd62-1cf2c7f6a087"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MCIsImVtYWlsIjoiZW1haWwtMjQwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MjR9.YDHr03k5kHIuWGj5MOqg1De-JV-HW90dPQDiubZw9m4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-349" -d '{
  "default_space_guid": "7fa03808-d7c1-4360-bd62-1cf2c7f6a087"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MCIsImVtYWlsIjoiZW1haWwtMjQwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MjR9.YDHr03k5kHIuWGj5MOqg1De-JV-HW90dPQDiubZw9m4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-349",
    "url": "/v2/users/uaa-id-349",
    "created_at": "2016-05-12T00:45:24Z",
    "updated_at": "2016-05-12T00:45:24Z"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "7fa03808-d7c1-4360-bd62-1cf2c7f6a087",
    "default_space_url": "/v2/spaces/7fa03808-d7c1-4360-bd62-1cf2c7f6a087",
    "spaces_url": "/v2/users/uaa-id-349/spaces",
    "organizations_url": "/v2/users/uaa-id-349/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-349/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-349/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-349/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-349/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-349/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 2d26a3d4-1e19-4691-9540-fa6bdc981ccf
Content-Length: 863
X-Content-Type-Options: nosniff