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-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b
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-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NyIsImVtYWlsIjoiZW1haWwtMTgzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5NzB9.6Pc5whkcKAK-HfJJoNzoykrxpSVbScjUFbPfOxpgJf0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NyIsImVtYWlsIjoiZW1haWwtMTgzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5NzB9.6Pc5whkcKAK-HfJJoNzoykrxpSVbScjUFbPfOxpgJf0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b",
    "url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b",
    "created_at": "2015-03-18T22:52:50Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/spaces",
    "organizations_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/organizations",
    "managed_organizations_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-6e5dc9c2-7d31-4534-aeab-5bdaaca3e36b
X-VCAP-Request-ID: 8f32f4f9-5b09-43c2-9bfc-171e443adc0a
Content-Length: 1014
X-Content-Type-Options: nosniff