Spaces API

List all Spaces

GET /v2/spaces

Request

Route

GET /v2/spaces

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
order-by Parameter to order results by
  • name
  • id
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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1OCIsImVtYWlsIjoiZW1haWwtMjUyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg5MDB9.dRPbb3WVGBUAV9Rn60EbWjOw3TAnRCKedEEQwdGK9Sc
Host: example.org
Cookie: 

cURL

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

Response

Status

200 OK

Body

{
  "total_results": 1,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "2e100106-0b74-4062-8671-0d375f951cb4",
        "url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4",
        "created_at": "2016-06-08T16:41:40Z",
        "updated_at": "2016-06-08T16:41:26Z"
      },
      "entity": {
        "name": "name-2050",
        "organization_guid": "d154425c-dccc-42e6-b6b4-27d46c3b42cb",
        "space_quota_definition_guid": null,
        "allow_ssh": true,
        "organization_url": "/v2/organizations/d154425c-dccc-42e6-b6b4-27d46c3b42cb",
        "developers_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/developers",
        "managers_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/managers",
        "auditors_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/auditors",
        "apps_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/apps",
        "routes_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/routes",
        "domains_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/domains",
        "service_instances_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/service_instances",
        "app_events_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/app_events",
        "events_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/events",
        "security_groups_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/security_groups",
        "staging_security_groups_url": "/v2/spaces/2e100106-0b74-4062-8671-0d375f951cb4/staging_security_groups"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 58db6d0e-f873-4fbd-b801-78763ec226ed
Content-Length: 1485
X-Content-Type-Options: nosniff