Home
Version 3
Users API

Users API

Creating a User

POST /v2/users/

Fields

Name Description Default Valid Values Example Values
guid The UAA guid of the user to create.
  • guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89
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).

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc4IiwiZW1haWwiOiJlbWFpbC01OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MTM3MzY0fQ.mNvk7IWMRPuqwBuAKdBNfBHM-U69zI4zVZq_L1O_KT0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/users

Body

{
  "guid": "guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89"
}

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc4IiwiZW1haWwiOiJlbWFpbC01OEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MTM3MzY0fQ.mNvk7IWMRPuqwBuAKdBNfBHM-U69zI4zVZq_L1O_KT0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89
X-VCAP-Request-ID: 51308d2a-7134-4d60-8516-c1704a189a61
Content-Length: 1014
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89",
    "url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89",
    "created_at": "2015-02-10T01:42:44Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/spaces",
    "organizations_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/organizations",
    "managed_organizations_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-6dd2f0ae-be27-4326-90e1-bae0ac9ccd89/audited_spaces"
  }
}