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-dbbfe811-7054-4235-aba5-6b66ff3a457a
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-dbbfe811-7054-4235-aba5-6b66ff3a457a"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyMyIsImVtYWlsIjoiZW1haWwtMzE5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTV9.P_St9Sdswg9LJU2v9iGXQJlYxhlgaFIcoZFMHfk2ioU
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-dbbfe811-7054-4235-aba5-6b66ff3a457a"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyMyIsImVtYWlsIjoiZW1haWwtMzE5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTV9.P_St9Sdswg9LJU2v9iGXQJlYxhlgaFIcoZFMHfk2ioU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-dbbfe811-7054-4235-aba5-6b66ff3a457a",
    "url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a",
    "created_at": "2016-03-14T22:30:54Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/spaces",
    "organizations_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/organizations",
    "managed_organizations_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-dbbfe811-7054-4235-aba5-6b66ff3a457a
X-VCAP-Request-ID: 
Content-Length: 1014
X-Content-Type-Options: nosniff