Getting recent activity via API
This method returns a list of recent events across all your projects. By default it returns events from the last 7 days, and you can choose a different window with the range parameter. Optionally include deployment statistics.
Tip: You can explore and test this endpoint interactively using our OpenAPI documentation.
URL
/activity
HTTP Method
GET
Supported Parameters
- range (optional) - The window of events to return. One of
today,last_7_days,last_30_days, orthis_week. Defaults tolast_7_days. Unrecognised values fall back to the default. - include (optional) - Set to
statsto include deployment statistics alongside the events
Example cURL Request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user your-email@example.com:your-api-key \
https://test.deployhq.com/activity
Example Response
[
{
"event": "deploy_completed",
"properties": {
"end_ref": "abc123def456",
"servers": ["production"]
},
"project": {
"name": "My App",
"permalink": "my-app",
"identifier": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
},
"user": "Jane Doe",
"created_at": "2026-03-30T14:22:00Z"
}
]
Including Deployment Statistics
Add ?include=stats to also receive deployment statistics. The statistics cover the same window as the event list, so they follow the range parameter:
Changed on 21 September 2026: these statistics previously always covered the current calendar week, whichever range you chose for the event list. They now follow range, so the numbers describe the same period as the events returned alongside them. The response format is unchanged. If you were relying on the previous behaviour, pass ?range=this_week to get the same figures as before.
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user your-email@example.com:your-api-key \
https://test.deployhq.com/activity?include=stats
When stats are included, the response wraps events in an object:
{
"events": [
{
"event": "deploy_completed",
"properties": {
"end_ref": "abc123def456",
"servers": ["production"]
},
"project": {
"name": "My App",
"permalink": "my-app",
"identifier": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
},
"user": "Jane Doe",
"created_at": "2026-03-30T14:22:00Z"
}
],
"stats": {
"total_deployments": 12,
"total_deployments_delta": 3,
"success_rate": 91.7,
"success_rate_delta": -2.1,
"avg_duration": "2m 34s",
"active_servers": 8
}
}
Response Fields
Event fields
- event - The event type (e.g.
deploy_completed,deploy_failed) - properties - Event-specific metadata (e.g.
end_ref,servers) - project - The associated project with
name,permalink, andidentifier - user - Name of the user who triggered the event
- created_at - ISO 8601 timestamp of when the event occurred
Stats fields (when ?include=stats is used)
- total_deployments - Number of deployments within the selected range
- totaldeploymentsdelta - Change compared to the preceding period of the same length
- success_rate - Percentage of successful deployments (null if no deployments)
- successratedelta - Change in success rate compared to the preceding period (null if that period had no deployments)
- avg_duration - Average deployment duration as a human-readable string
- active_servers - Number of currently enabled servers (a point-in-time count, not affected by
range)
Deltas compare against the period immediately before the selected one, measured over the same elapsed duration. For today and this_week — which are only partway through when you request them — the comparison uses the matching portion of the previous day or week, so a request at 11am compares against midnight-to-11am the day before.
Events are ordered by most recent first. The response is limited to the latest 100 events within the selected range, so a wider range such as last_30_days returns the 100 most recent events from that window.