Home
Version 3
Users API

Users API

List all Spaces for the User

GET /v2/users/:guid/spaces

Fields

Name Description Default Valid Values Example Values

Parameters

Name Description Valid Values Example Values
guid The guid of the User
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.

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ0IiwiZW1haWwiOiJlbWFpbC0zN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE1NzU0MTMyfQ.tNexBZK04R7LPcM2P3Y18x0zQQFfx4n9RjzBOZTozlY
Host: example.org
Cookie: 

Route

GET /v2/users/uaa-id-43/spaces

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-43/spaces" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ0IiwiZW1haWwiOiJlbWFpbC0zN0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE1NzU0MTMyfQ.tNexBZK04R7LPcM2P3Y18x0zQQFfx4n9RjzBOZTozlY" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 02a6e49b-36e0-42ee-baee-2ac49b342c5a
Content-Length: 1462
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 1,
  "total_pages": 1,
  "prev_url": null,
  "next_url": null,
  "resources": [
    {
      "metadata": {
        "guid": "ca3104ca-5493-4203-9a05-0899a5bdfd2a",
        "url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a",
        "created_at": "2014-11-05T01:02:11+00:00",
        "updated_at": null
      },
      "entity": {
        "name": "name-145",
        "organization_guid": "d8001097-38fc-43a2-8ac2-98fc7b11d70e",
        "space_quota_definition_guid": null,
        "organization_url": "/v2/organizations/d8001097-38fc-43a2-8ac2-98fc7b11d70e",
        "developers_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/developers",
        "managers_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/managers",
        "auditors_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/auditors",
        "apps_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/apps",
        "routes_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/routes",
        "domains_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/domains",
        "service_instances_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/service_instances",
        "app_events_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/app_events",
        "events_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/events",
        "security_groups_url": "/v2/spaces/ca3104ca-5493-4203-9a05-0899a5bdfd2a/security_groups"
      }
    }
  ]
}