Home
Version 3
Users API

Users API

Creating a User

POST /v2/users/

Request

Route

POST /v2/users

Body

Name Description Default Valid Values Example Values
guid The UAA guid of the user to create.
  • guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee
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).
{
  "guid": "guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkxIiwiZW1haWwiOiJlbWFpbC02NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2MTg3NzQxfQ.KN0-3UvTRO-r9rfY6BZ_WnT_Mn0wYqPbCQgLJDLF4VE
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkxIiwiZW1haWwiOiJlbWFpbC02NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI2MTg3NzQxfQ.KN0-3UvTRO-r9rfY6BZ_WnT_Mn0wYqPbCQgLJDLF4VE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee",
    "url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee",
    "created_at": "2015-03-05T19:15:41Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/spaces",
    "organizations_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/organizations",
    "managed_organizations_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-ab31d269-e8ad-4171-8dbd-4bc9766473ee
X-VCAP-Request-ID: 2fe2fd29-6db5-4167-b9bc-32afd429173b
Content-Length: 1014
X-Content-Type-Options: nosniff