Home
Version 3
App Usage Events API

App Usage Events API

List all App Usage Events

GET /v2/app_usage_events

Events are sorted by internal database IDs. This order may differ from created_at. Events close to the current time should not be processed because other events may still have open transactions that will change their order in the results.

Request

Route

GET /v2/app_usage_events?results-per-page=1&after_guid=945f9588-325b-4e4a-bd1d-0f90ed4e7641

Parameters

Name Description Valid Values Example Values
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
after_guid Restrict results to App Usage Events after the one with the given guid
results-per-page: 1
after_guid: 945f9588-325b-4e4a-bd1d-0f90ed4e7641

Body

Name Description Default Valid Values Example Values
guid The guid of the event.
state The desired state of the app or 'BUILDPACK_SET' when buildpack info has been set.
  • STARTED
  • STOPPED
  • BUILDPACK_SET
package_state The state of the package.
  • PENDING
  • STAGED
  • FAILED
instance_count How many instance of the app.
memory_in_mb_per_instance How much memory per app instance.
  • 128
  • 256
  • 512
app_guid The GUID of the app.
app_name The name of the app.
org_guid The GUID of the organization.
space_guid The GUID of the space.
space_name The name of the space.
buildpack_guid The GUID of the buildpack used to stage the app.
buildpack_name The name of the buildpack or the URL of the custom buildpack used to stage the app.
  • https://example.com/buildpack.git
  • admin_buildpack
created_at The timestamp when the event is recorded. It is possible that later events may have earlier created_at values.

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0NSIsImVtYWlsIjoiZW1haWwtMjQ3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjY2MzM5MTl9.CZJBRVfx-aEO8WNUM2L_GjNlkV86D4B73PzPBpsZKGM
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=945f9588-325b-4e4a-bd1d-0f90ed4e7641" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0NSIsImVtYWlsIjoiZW1haWwtMjQ3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjY2MzM5MTl9.CZJBRVfx-aEO8WNUM2L_GjNlkV86D4B73PzPBpsZKGM" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "total_results": 2,
  "total_pages": 2,
  "prev_url": null,
  "next_url": "/v2/app_usage_events?after_guid=945f9588-325b-4e4a-bd1d-0f90ed4e7641&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "3e52a097-2394-4cd8-8f47-4acec288b639",
        "url": "/v2/app_usage_events/3e52a097-2394-4cd8-8f47-4acec288b639",
        "created_at": "2015-03-10T23:11:59Z"
      },
      "entity": {
        "state": "STARTED",
        "memory_in_mb_per_instance": 564,
        "instance_count": 1,
        "app_guid": "guid-d75fe60a-ebc4-4e65-a88e-53ab06046bd1",
        "app_name": "name-1939",
        "space_guid": "guid-e4babd02-10b0-49a8-b082-70c35eac6bed",
        "space_name": "name-1940",
        "org_guid": "guid-3333072c-0d64-4b36-bb66-75ed9c810d3a",
        "buildpack_guid": "guid-91104f16-aefd-49ab-80cb-29bb1502bd02",
        "buildpack_name": "name-1941",
        "package_state": "STAGED"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 496ec572-1308-41e3-8f28-a82f48cb54e3
Content-Length: 970
X-Content-Type-Options: nosniff