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-45ab64e6-5167-49ce-a58f-b4c47b37b84b
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.eyJ1c2VyX2lkIjoidWFhLWlkLTM0IiwiZW1haWwiOiJlbWFpbC0zMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE1NzU0MTMxfQ.kxWq5lo0DNWgpEOYToQTvaqbDqKx6-n-ej1GTk2ckbs
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/users

Body

{
  "guid": "guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b"
}

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0IiwiZW1haWwiOiJlbWFpbC0zMkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE1NzU0MTMxfQ.kxWq5lo0DNWgpEOYToQTvaqbDqKx6-n-ej1GTk2ckbs" \
	-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-45ab64e6-5167-49ce-a58f-b4c47b37b84b
X-VCAP-Request-ID: 757afd31-2dd2-4ee4-8e5d-2f4aac23ab6a
Content-Length: 1019
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b",
    "url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b",
    "created_at": "2014-11-05T01:02:11+00:00",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/spaces",
    "organizations_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/organizations",
    "managed_organizations_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-45ab64e6-5167-49ce-a58f-b4c47b37b84b/audited_spaces"
  }
}