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": "dbad211c-ab21-4fa4-8a08-6c62e53a40e0"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkzIiwiZW1haWwiOiJlbWFpbC03NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5MDM4NzAxfQ.ntBGniOZ3f0RtXQg81cFkcZN71fLeqjTIQFJ1IBiAKU
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": "dbad211c-ab21-4fa4-8a08-6c62e53a40e0"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTkzIiwiZW1haWwiOiJlbWFpbC03NEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI5MDM4NzAxfQ.ntBGniOZ3f0RtXQg81cFkcZN71fLeqjTIQFJ1IBiAKU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd",
    "url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd",
    "created_at": "2015-04-07T19:11:41Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "dbad211c-ab21-4fa4-8a08-6c62e53a40e0",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/dbad211c-ab21-4fa4-8a08-6c62e53a40e0",
    "spaces_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/spaces",
    "domains_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/domains",
    "private_domains_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/private_domains",
    "users_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/users",
    "managers_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/managers",
    "billing_managers_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/billing_managers",
    "auditors_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/auditors",
    "app_events_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/app_events",
    "space_quota_definitions_url": "/v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/8a3fe8a4-fcb8-40ad-bacc-c6b56a42cfdd
X-VCAP-Request-ID: 0267b4e0-fa93-4b98-a016-9268e0ca9d0a
Content-Length: 1302
X-Content-Type-Options: nosniff