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": "f0353f8e-fbdc-4e39-967b-d076b0bf2187"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MyIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTl9.03OlDGZ3ube981RjBnBsgkAuh3SLbJqKqJKUygniUJI
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": "f0353f8e-fbdc-4e39-967b-d076b0bf2187"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MyIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTl9.03OlDGZ3ube981RjBnBsgkAuh3SLbJqKqJKUygniUJI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "e97cdc71-b681-4d61-b894-b088db5f3a78",
    "url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78",
    "created_at": "2015-07-06T23:23:19Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "f0353f8e-fbdc-4e39-967b-d076b0bf2187",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/f0353f8e-fbdc-4e39-967b-d076b0bf2187",
    "spaces_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/spaces",
    "domains_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/domains",
    "private_domains_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/private_domains",
    "users_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/users",
    "managers_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/managers",
    "billing_managers_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/billing_managers",
    "auditors_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/auditors",
    "app_events_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/app_events",
    "space_quota_definitions_url": "/v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/e97cdc71-b681-4d61-b894-b088db5f3a78
X-VCAP-Request-ID: c7ee9cb7-8664-4273-8a56-1674f8519752
Content-Length: 1302
X-Content-Type-Options: nosniff