Home
Version 3
Organizations API

Organizations API

Creating an Organization

POST /v2/organizations/

Fields

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

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1IiwiZW1haWwiOiJlbWFpbC0zNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MTM3MzYzfQ.3I2Nh3bUs8JT8QH7Ie0bEqk_qOFlMnmkqbIbpPM__ok
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/organizations

Body

{
  "name": "my-org-name",
  "quota_definition_guid": "922e2a11-d0c6-4f92-af03-4d0ba14518f4"
}

cURL

curl "https://api.[your-domain.com]/v2/organizations" -d '{
  "name": "my-org-name",
  "quota_definition_guid": "922e2a11-d0c6-4f92-af03-4d0ba14518f4"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1IiwiZW1haWwiOiJlbWFpbC0zNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0MTM3MzYzfQ.3I2Nh3bUs8JT8QH7Ie0bEqk_qOFlMnmkqbIbpPM__ok" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545
X-VCAP-Request-ID: f97e4f20-e798-4100-993e-f9d7b55fd405
Content-Length: 1302
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "4587d921-60ca-4786-87b0-ee6b944b0545",
    "url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545",
    "created_at": "2015-02-10T01:42:43Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "922e2a11-d0c6-4f92-af03-4d0ba14518f4",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/922e2a11-d0c6-4f92-af03-4d0ba14518f4",
    "spaces_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/spaces",
    "domains_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/domains",
    "private_domains_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/private_domains",
    "users_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/users",
    "managers_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/managers",
    "billing_managers_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/billing_managers",
    "auditors_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/auditors",
    "app_events_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/app_events",
    "space_quota_definitions_url": "/v2/organizations/4587d921-60ca-4786-87b0-ee6b944b0545/space_quota_definitions"
  }
}