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": "5504af1a-ff01-44d1-9bd2-d2d799bdd58a"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMyIsImVtYWlsIjoiZW1haWwtMTAyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NTB9.H5SNWAlWssL2yUX-QDniBAeIXxLUdY3UD0Qoac2-38U
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": "5504af1a-ff01-44d1-9bd2-d2d799bdd58a"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMyIsImVtYWlsIjoiZW1haWwtMTAyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NTB9.H5SNWAlWssL2yUX-QDniBAeIXxLUdY3UD0Qoac2-38U" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8b0939ca-3a69-40c4-aa12-f771f3e1cf3e",
    "url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e",
    "created_at": "2015-06-16T23:40:50Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-org-name",
    "billing_enabled": false,
    "quota_definition_guid": "5504af1a-ff01-44d1-9bd2-d2d799bdd58a",
    "status": "active",
    "quota_definition_url": "/v2/quota_definitions/5504af1a-ff01-44d1-9bd2-d2d799bdd58a",
    "spaces_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/spaces",
    "domains_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/domains",
    "private_domains_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/private_domains",
    "users_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/users",
    "managers_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/managers",
    "billing_managers_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/billing_managers",
    "auditors_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/auditors",
    "app_events_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/app_events",
    "space_quota_definitions_url": "/v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e/space_quota_definitions"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/organizations/8b0939ca-3a69-40c4-aa12-f771f3e1cf3e
X-VCAP-Request-ID: 982d6aa6-5f9e-4cad-9186-f6fb7102d13a
Content-Length: 1302
X-Content-Type-Options: nosniff