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-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af
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-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4NCIsImVtYWlsIjoiZW1haWwtMTUwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDJ9.R90wvfmD2nwpVD0rqbIcmGULmw9eS1wxPCpu1rMok5s" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af",
    "url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af",
    "created_at": "2016-04-22T19:33:22Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/spaces",
    "organizations_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/organizations",
    "managed_organizations_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-d7ee92ec-1b95-4d4c-a63d-ab7159bfa9af
X-VCAP-Request-ID: a2acecdb-f700-49df-8758-80c8ab009d2e
Content-Length: 1014
X-Content-Type-Options: nosniff