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-b79cfc51-30b5-45a3-87ec-51e3c5c074f2
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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzOCIsImVtYWlsIjoiZW1haWwtMjQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5Nzh9.b4BmMspa4DIEFC8IqydYvcCK5IBBR_5Ek0Rcfi1oe6I
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/users

Body

{
  "guid": "guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2"
}

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzOCIsImVtYWlsIjoiZW1haWwtMjQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTk5ODk5Nzh9.b4BmMspa4DIEFC8IqydYvcCK5IBBR_5Ek0Rcfi1oe6I" \
	-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-b79cfc51-30b5-45a3-87ec-51e3c5c074f2
X-VCAP-Request-ID: 0fba7e9b-c06c-4ffc-91b3-cd34941468d8
Content-Length: 1019
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2",
    "url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2",
    "created_at": "2014-12-24T01:39:38+00:00",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/spaces",
    "organizations_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/organizations",
    "managed_organizations_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-b79cfc51-30b5-45a3-87ec-51e3c5c074f2/audited_spaces"
  }
}