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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNiIsImVtYWlsIjoiZW1haWwtMjQyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5Nzh9.rJR0TkWD3b2J87wda79aT1VQNn6gh8TcUBPwLjXB1Ec
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

PUT /v2/users/uaa-id-335

Body

{
  "default_space_guid": "96fc8385-8ae3-4bcd-935a-6f275534a11a"
}

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-335" -d '{
  "default_space_guid": "96fc8385-8ae3-4bcd-935a-6f275534a11a"
}' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzNiIsImVtYWlsIjoiZW1haWwtMjQyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5Nzh9.rJR0TkWD3b2J87wda79aT1VQNn6gh8TcUBPwLjXB1Ec" \
	-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: 0de1376c-0145-4ccf-8439-806fdcdbcec6
Content-Length: 873
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-335",
    "url": "/v2/users/uaa-id-335",
    "created_at": "2014-12-24T01:39:38+00:00",
    "updated_at": "2014-12-24T01:39:38+00:00"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "96fc8385-8ae3-4bcd-935a-6f275534a11a",
    "default_space_url": "/v2/spaces/96fc8385-8ae3-4bcd-935a-6f275534a11a",
    "spaces_url": "/v2/users/uaa-id-335/spaces",
    "organizations_url": "/v2/users/uaa-id-335/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-335/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-335/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-335/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-335/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-335/audited_spaces"
  }
}