Get build analytics

OpenAPI contract

Method
GET
Path
/api/v1/analytics/builds
Security
jwtBearer (bearer) OR automationKey (bearer)
Response status
200 400 401 403 429 500
Request and response schemas
JSON
{
  "requestBody": {},
  "responses": {
    "200": {
      "description": "Build analytics",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/AnalyticsBuildsResponse"
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

GET /api/v1/analytics/builds accepts a JWT or an nfy_ key with analytics:read. It includes only the authenticated user's non-draft builds created after the requested window. range is one of 7d, 30d (default), 90d, or 1y; interval is one of 1h, 6h, 1d (default), or 7d.

The response contains time buckets with total builds, successful builds, failed-or-cancelled builds, and average duration in milliseconds for successful builds that have both start and completion timestamps. Empty intervals are omitted.

http
GET /api/v1/analytics/builds?range=30d&interval=1d
Authorization: Bearer <access token>