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-cb24b36d-4656-468e-a50d-b53113ac6177
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-cb24b36d-4656-468e-a50d-b53113ac6177"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxNiIsImVtYWlsIjoiZW1haWwtMjEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.S0R8SBEdT_SBF6KDX2y_wL_lamOYNL-fPsqVEXVk7M8
Host: example.org
Content-Type: application/json
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users" -d '{
  "guid": "guid-cb24b36d-4656-468e-a50d-b53113ac6177"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxNiIsImVtYWlsIjoiZW1haWwtMjEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg4OTd9.S0R8SBEdT_SBF6KDX2y_wL_lamOYNL-fPsqVEXVk7M8" \
	-H "Host: example.org" \
	-H "Content-Type: application/json" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "guid-cb24b36d-4656-468e-a50d-b53113ac6177",
    "url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177",
    "created_at": "2016-06-08T16:41:37Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": null,
    "spaces_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/spaces",
    "organizations_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/organizations",
    "managed_organizations_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/audited_organizations",
    "managed_spaces_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/managed_spaces",
    "audited_spaces_url": "/v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/users/guid-cb24b36d-4656-468e-a50d-b53113ac6177
X-VCAP-Request-ID: 909d8501-cdb5-461b-bf09-bab60582ee7c
Content-Length: 1014
X-Content-Type-Options: nosniff