Home
Version 3
Users API

Users API

Updating a User

PUT /v2/users/:guid

Fields

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).

Parameters

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

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTYiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjMyMzUyOH0.53dWHo_LIHXHXlDiPn9GM-tSrjDTcGSTAgDdFOGucsA
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

PUT /v2/users/uaa-id-5

Body

{
  "default_space_guid": "aa6df058-d1ab-4a5a-886f-b4f35d8be5bf"
}

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-5" -d '{
  "default_space_guid": "aa6df058-d1ab-4a5a-886f-b4f35d8be5bf"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTYiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyMjMyMzUyOH0.53dWHo_LIHXHXlDiPn9GM-tSrjDTcGSTAgDdFOGucsA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 15d1657f-dad6-4494-9b9e-2afcdb726af4
Content-Length: 855
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-5",
    "url": "/v2/users/uaa-id-5",
    "created_at": "2015-01-20T01:52:08+00:00",
    "updated_at": "2015-01-20T01:52:08+00:00"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "aa6df058-d1ab-4a5a-886f-b4f35d8be5bf",
    "default_space_url": "/v2/spaces/aa6df058-d1ab-4a5a-886f-b4f35d8be5bf",
    "spaces_url": "/v2/users/uaa-id-5/spaces",
    "organizations_url": "/v2/users/uaa-id-5/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-5/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-5/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-5/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-5/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-5/audited_spaces"
  }
}