Home
Version 3
Organizations API

Organizations API

Creating an Organization

POST /v2/organizations/

Request

Route

POST /v2/organizations

Body

Name Description Default Valid Values Example Values
name The name of the organization
  • my-org-name
status Status of the organization
quota_definition_guid The guid of quota to associate with this organization
  • org-quota-def-guid
billing_enabled If billing is enabled for this organization
{
  "name": "my-org-name",
  "quota_definition_guid": "0cb946a4-2985-4f50-9a86-678f9acb6ea0"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/organizations" -d '{
  "name": "my-org-name",
  "quota_definition_guid": "0cb946a4-2985-4f50-9a86-678f9acb6ea0"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MCIsImVtYWlsIjoiZW1haWwtMTE4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzE2NDY2MzN9.jAa6cVojcC8sppbQWmLtvOnxPCuBtGU7rvC32mZW8tw" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "fb433a9a-06a7-4e8f-ba7f-48dd3df89973",
    "url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973",
    "created_at": "2015-05-07T23:37:13Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "0cb946a4-2985-4f50-9a86-678f9acb6ea0",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/0cb946a4-2985-4f50-9a86-678f9acb6ea0",
    "spaces_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/spaces",
    "domains_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/domains",
    "private_domains_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/private_domains",
    "users_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/users",
    "managers_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/managers",
    "billing_managers_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/billing_managers",
    "auditors_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/auditors",
    "app_events_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/app_events",
    "space_quota_definitions_url": "/v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/fb433a9a-06a7-4e8f-ba7f-48dd3df89973
X-VCAP-Request-ID: c019b3ae-f7a8-4cf9-b010-e6573277398f
Content-Length: 1302
X-Content-Type-Options: nosniff