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-a96cbad9-da42-45ab-b431-0276b58a61dd
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-a96cbad9-da42-45ab-b431-0276b58a61dd"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUzIiwiZW1haWwiOiJlbWFpbC0yNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5NjY0MTMzfQ.tXjmiEZA3k-VBNcuU5jEhAuDUKODqlObhR3DStPC_bA
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-a96cbad9-da42-45ab-b431-0276b58a61dd"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUzIiwiZW1haWwiOiJlbWFpbC0yNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5NjY0MTMzfQ.tXjmiEZA3k-VBNcuU5jEhAuDUKODqlObhR3DStPC_bA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-a96cbad9-da42-45ab-b431-0276b58a61dd",
    "url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd",
    "created_at": "2015-04-15T00:55:33Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/spaces",
    "organizations_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/organizations",
    "managed_organizations_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-a96cbad9-da42-45ab-b431-0276b58a61dd
X-VCAP-Request-ID: 980e1614-7f13-4a5f-a18f-d0444323e878
Content-Length: 1014
X-Content-Type-Options: nosniff