Home
Version 3
Spaces API

Spaces API

List all Spaces

GET /v2/spaces

Fields

Name Description Default Valid Values Example Values

Parameters

Name Description Valid Values Example Values
q Parameters used to filter the result set.
Format queries as <filter><op><value>
Valid ops: : >= <= < > IN
Valid filters: name, organization_guid, developer_guid, app_guid
  • q=filter:value
  • q=filter>value
  • q=filter IN a,b,c
page Page of results to fetch
results-per-page Number of results per page
order-direction Order of the results: asc (default) or desc
inline-relations-depth 0 - don't inline any relations and return URLs. Otherwise, inline to depth N.
orphan-relations 0 - de-duplicate object entries in response
exclude-relations comma-delimited list of relations to drop from response
include-relations comma-delimited list of the only relations to include in response

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTcxIiwiZW1haWwiOiJlbWFpbC01MkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0NDcxNjg4fQ.iGtlm2ZYzqE-P5UyydrITeGpkWQgWPh_651R2vblJjw
Host: example.org
Cookie: 

Route

GET /v2/spaces

cURL

curl "https://api.[your-domain.com]/v2/spaces" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTcxIiwiZW1haWwiOiJlbWFpbC01MkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0NDcxNjg4fQ.iGtlm2ZYzqE-P5UyydrITeGpkWQgWPh_651R2vblJjw" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: fcfae33d-7386-4ad8-8801-7d5c865c7a50
Content-Length: 1457
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 1,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "8b8d55d9-2878-49ae-b8de-bdb0b73dca76",
        "url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76",
        "created_at": "2015-02-13T22:34:48Z",
        "updated_at": null
      },
      "entity": {
        "name": "name-211",
        "organization_guid": "36731537-bffd-4872-b2a8-6b58531e54cd",
        "space_quota_definition_guid": null,
        "organization_url": "/v2/organizations/36731537-bffd-4872-b2a8-6b58531e54cd",
        "developers_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/developers",
        "managers_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/managers",
        "auditors_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/auditors",
        "apps_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/apps",
        "routes_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/routes",
        "domains_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/domains",
        "service_instances_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/service_instances",
        "app_events_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/app_events",
        "events_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/events",
        "security_groups_url": "/v2/spaces/8b8d55d9-2878-49ae-b8de-bdb0b73dca76/security_groups"
      }
    }
  ]
}