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.

Fields

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.

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

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDQ3MTY4NH0.pc4g_fFIzRB6utkva0xf4f2OmMvOfA0qWghf_g_TZ6E
Host: example.org
Cookie: 

Route

GET /v2/app_usage_events?results-per-page=1&after_guid=b93b943a-c3cb-4f61-b1a0-b8849127f021

Query Parameters

results-per-page: 1
after_guid: b93b943a-c3cb-4f61-b1a0-b8849127f021

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=b93b943a-c3cb-4f61-b1a0-b8849127f021" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNDQ3MTY4NH0.pc4g_fFIzRB6utkva0xf4f2OmMvOfA0qWghf_g_TZ6E" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: fdaa1b34-a35e-4af1-bd3a-8acda0a8ec9d
Content-Length: 964
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 2,
  "total_pages": 2,
  "prev_url": null,
  "next_url": "/v2/app_usage_events?after_guid=b93b943a-c3cb-4f61-b1a0-b8849127f021&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "71fff2f0-ecaf-467d-9a87-6e2222460ea1",
        "url": "/v2/app_usage_events/71fff2f0-ecaf-467d-9a87-6e2222460ea1",
        "created_at": "2015-02-13T22:34:44Z"
      },
      "entity": {
        "state": "STARTED",
        "memory_in_mb_per_instance": 564,
        "instance_count": 1,
        "app_guid": "guid-4f25bc42-b0af-4846-8c6e-4bf99a57b9a2",
        "app_name": "name-13",
        "space_guid": "guid-8b0a8fd7-db51-4ab8-9ecf-15f1c5e1ea46",
        "space_name": "name-14",
        "org_guid": "guid-828aec58-4db4-420c-a272-6a0bf1842485",
        "buildpack_guid": "guid-73d254f1-f2f8-4bfa-b6eb-aeb3c2d8278a",
        "buildpack_name": "name-15",
        "package_state": "STAGED"
      }
    }
  ]
}