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": "5feb1248-ec5f-4171-b107-2a289966a38d"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2NSIsImVtYWlsIjoiZW1haWwtOTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0NDI2MDY0MX0.1UitTyFGMMaaMgYOuIS7T_SuatlK5xZ7Ih0qNoH1dl4
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": "5feb1248-ec5f-4171-b107-2a289966a38d"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2NSIsImVtYWlsIjoiZW1haWwtOTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0NDI2MDY0MX0.1UitTyFGMMaaMgYOuIS7T_SuatlK5xZ7Ih0qNoH1dl4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "ffd6a8e1-8402-4821-ae96-abe69783d6e5",
    "url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5",
    "created_at": "2015-09-30T23:30:41Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "5feb1248-ec5f-4171-b107-2a289966a38d",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/5feb1248-ec5f-4171-b107-2a289966a38d",
    "spaces_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/spaces",
    "domains_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/domains",
    "private_domains_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/private_domains",
    "users_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/users",
    "managers_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/managers",
    "billing_managers_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/billing_managers",
    "auditors_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/auditors",
    "app_events_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/app_events",
    "space_quota_definitions_url": "/v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/ffd6a8e1-8402-4821-ae96-abe69783d6e5
X-VCAP-Request-ID: 154aa21f-b28f-460d-836e-aa935d35ef12
Content-Length: 1302
X-Content-Type-Options: nosniff