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": "cb5a4411-01f9-4de3-92d5-3a7b468c0d15"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUzIiwiZW1haWwiOiJlbWFpbC0zNEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI3MzIzOTU2fQ.nGfqxbTpV65jY1w_y9BdYysGS_zKhPiSY55D6njfY44
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": "cb5a4411-01f9-4de3-92d5-3a7b468c0d15"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUzIiwiZW1haWwiOiJlbWFpbC0zNEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI3MzIzOTU2fQ.nGfqxbTpV65jY1w_y9BdYysGS_zKhPiSY55D6njfY44" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c",
    "url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c",
    "created_at": "2015-03-18T22:52:36Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "cb5a4411-01f9-4de3-92d5-3a7b468c0d15",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/cb5a4411-01f9-4de3-92d5-3a7b468c0d15",
    "spaces_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/spaces",
    "domains_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/domains",
    "private_domains_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/private_domains",
    "users_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/users",
    "managers_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/managers",
    "billing_managers_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/billing_managers",
    "auditors_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/auditors",
    "app_events_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/app_events",
    "space_quota_definitions_url": "/v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/a47d2d8a-8c0a-4d02-bdd2-2d53828a3e3c
X-VCAP-Request-ID: caae5a01-86a9-4101-9313-66a505889b87
Content-Length: 1302
X-Content-Type-Options: nosniff