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=4a9625be-a2f7-4f60-a82d-7934a21bb780

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: 4a9625be-a2f7-4f60-a82d-7934a21bb780

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.
parent_app_guid The GUID for a parent v3 application if one exists
parent_app_name The name for a parent v3 application if one exists
process_type The process_type for applictions.
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.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMCIsImVtYWlsIjoiZW1haWwtMjMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MzN9.aXDVuKCbDrV2ynN0Kjw3Od2ZFu4bdHR3BV8RJ1VCHVE
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=4a9625be-a2f7-4f60-a82d-7934a21bb780" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMzMCIsImVtYWlsIjoiZW1haWwtMjMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MzN9.aXDVuKCbDrV2ynN0Kjw3Od2ZFu4bdHR3BV8RJ1VCHVE" \
	-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=4a9625be-a2f7-4f60-a82d-7934a21bb780&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "5f7606da-8a6a-4d80-b132-b0aac9bfc30b",
        "url": "/v2/app_usage_events/5f7606da-8a6a-4d80-b132-b0aac9bfc30b",
        "created_at": "2015-11-30T23:38:53Z"
      },
      "entity": {
        "state": "STARTED",
        "memory_in_mb_per_instance": 564,
        "instance_count": 1,
        "app_guid": "guid-3f913f62-d41d-49d0-9e50-de630dc72cce",
        "app_name": "name-2272",
        "space_guid": "guid-e201f883-926e-4ec3-9f99-93182e600a88",
        "space_name": "name-2273",
        "org_guid": "guid-c3e425fa-57b9-4129-916c-5168bc2c2b0f",
        "buildpack_guid": "guid-f473719e-43e8-472b-abb3-99cbd98caf39",
        "buildpack_name": "name-2274",
        "package_state": "STAGED",
        "parent_app_guid": null,
        "parent_app_name": null,
        "process_type": "web"
      }
    }
  ]
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 1067
X-Content-Type-Options: nosniff