{
  "openapi": "3.1.1",
  "info": {
    "title": "CopilotDashboard | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://copilot-dash.poc.xanalys.net/"
    }
  ],
  "paths": {
    "/api/metrics/users-28-day": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Per-user Copilot activity for the last 28 days (one record per user per day)",
        "description": "Proxies /orgs/{org}/copilot/metrics/reports/users-28-day/latest. Optional since/until (YYYY-MM-DD) filter the returned days inclusively.",
        "operationId": "GetUsers28Day",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfUserUsageRecord"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/organization-28-day": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Organization-aggregate Copilot activity for the last 28 days",
        "description": "Proxies /orgs/{org}/copilot/metrics/reports/organization-28-day/latest. Includes PR lifecycle metrics and cloud-agent user counts not present in the per-user report.",
        "operationId": "GetOrganization28Day",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfOrganizationDayTotals"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/users-1-day": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Per-user Copilot activity for a single day",
        "description": "Proxies /orgs/{org}/copilot/metrics/reports/users-1-day?day=YYYY-MM-DD. Results are cached per calendar day (24-hour TTL) and shared across callers.",
        "operationId": "GetUsers1Day",
        "parameters": [
          {
            "name": "day",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfUserUsageRecord"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/organization-1-day": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Organization-aggregate Copilot activity for a single day",
        "description": "Proxies /orgs/{org}/copilot/metrics/reports/organization-1-day?day=YYYY-MM-DD. Per-day caching identical to users-1-day (24-hour TTL).",
        "operationId": "GetOrganization1Day",
        "parameters": [
          {
            "name": "day",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfOrganizationDayTotals"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/users-range": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Per-user Copilot activity assembled from 1-day reports across a date range",
        "description": "Fans out parallel calls to /orgs/{org}/copilot/metrics/reports/users-1-day for each day in [since, until]. Range is capped at 180 days. Each day is cached individually so overlapping ranges hit the per-day cache.",
        "operationId": "GetUsersRange",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfUserUsageRecord"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/organization-range": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Organization-aggregate Copilot activity assembled from 1-day reports across a date range",
        "description": "Fans out parallel calls to /orgs/{org}/copilot/metrics/reports/organization-1-day for each day in [since, until]. Range is capped at 180 days.",
        "operationId": "GetOrganizationRange",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfOrganizationDayTotals"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/users-monthly": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Per-user Copilot activity rolled up by calendar month",
        "description": "Aggregates per-day data into (user, month) records across [since, until] (YYYY-MM). Range capped at 24 months. Result envelope cached 5 minutes; per-day cache reused.",
        "operationId": "GetUsersMonthly",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfUserMonthlyAggregate"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/metrics/organization-monthly": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Organization-aggregate Copilot activity rolled up by calendar month",
        "description": "Aggregates per-day org data into one record per month across [since, until] (YYYY-MM). Active-user windows are reported as per-day peaks; PR median-merge-minutes is a weighted average over merge counts. Range capped at 24 months.",
        "operationId": "GetOrganizationMonthly",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportEnvelopeOfOrganizationMonthlyAggregate"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/seats": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "All Copilot seat assignments for the organization",
        "description": "Paginates /orgs/{org}/copilot/billing/seats. Cached 1h. Includes pending_cancellation_date, plan_type, last_authenticated_at, assigning_team for reclamation workflows.",
        "operationId": "GetSeats",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeatsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-profiles": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "GitHub login → display name map for active + licensed users",
        "description": "Fans out /users/{login} with bounded concurrency. Cached 1h. Response is a JSON object whose keys are GitHub logins and values are display names (or null).",
        "operationId": "GetUserProfiles",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CliTokenUsage": {
        "type": "object",
        "properties": {
          "prompt_tokens_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "output_tokens_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "avg_tokens_per_request": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CliTotals": {
        "type": "object",
        "properties": {
          "session_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "request_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "prompt_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "token_usage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CliTokenUsage"
              }
            ]
          },
          "last_known_cli_version": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CopilotSeat": {
        "type": "object",
        "properties": {
          "login": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatar_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_activity_at": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_activity_editor": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_authenticated_at": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ]
          },
          "pending_cancellation_date": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "assigning_team": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SeatAssigningTeam"
              }
            ]
          }
        }
      },
      "FeatureTotals": {
        "type": "object",
        "properties": {
          "feature": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "IdeTotals": {
        "type": "object",
        "properties": {
          "ide": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "LanguageFeatureTotals": {
        "type": "object",
        "properties": {
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "feature": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "LanguageModelTotals": {
        "type": "object",
        "properties": {
          "language": {
            "type": [
              "null",
              "string"
            ]
          },
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "ModelFeatureTotals": {
        "type": "object",
        "properties": {
          "model": {
            "type": [
              "null",
              "string"
            ]
          },
          "feature": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "OrganizationDayTotals": {
        "type": "object",
        "properties": {
          "daily_active_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "weekly_active_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_active_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_active_chat_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_active_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "daily_active_cli_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "daily_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "weekly_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "daily_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "weekly_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "daily_passive_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "weekly_passive_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "monthly_passive_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "pull_requests": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PullRequestActivity"
              }
            ]
          },
          "day": {
            "type": [
              "null",
              "string"
            ]
          },
          "organization_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "enterprise_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "totals_by_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FeatureTotals"
            }
          },
          "totals_by_ide": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IdeTotals"
            }
          },
          "totals_by_language_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageFeatureTotals"
            }
          },
          "totals_by_model_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelFeatureTotals"
            }
          },
          "totals_by_language_model": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageModelTotals"
            }
          },
          "totals_by_cli": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CliTotals"
              }
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "OrganizationMonthlyAggregate": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "dau_peak": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "wau_peak": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "mau_peak": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "monthly_active_chat_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "monthly_active_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "daily_active_cli_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "daily_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "weekly_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "monthly_active_copilot_cloud_agent_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "daily_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "weekly_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "monthly_active_copilot_code_review_users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stickiness_pct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pull_requests": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PullRequestActivity"
              }
            ]
          },
          "partial_month": {
            "type": "boolean"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PullRequestActivity": {
        "type": "object",
        "properties": {
          "total_created": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_reviewed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_merged": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "median_minutes_to_merge": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "total_suggestions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_applied_suggestions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_created_by_copilot": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_reviewed_by_copilot": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_merged_created_by_copilot": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "median_minutes_to_merge_copilot_authored": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "total_copilot_suggestions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "total_copilot_applied_suggestions": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "SeatAssigningTeam": {
        "type": "object",
        "properties": {
          "slug": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SeatsResponse": {
        "type": "object",
        "properties": {
          "total_seats": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "seats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CopilotSeat"
            }
          }
        }
      },
      "UsageReportEnvelopeOfOrganizationDayTotals": {
        "type": "object",
        "properties": {
          "report_start_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "report_end_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "record_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationDayTotals"
            }
          }
        }
      },
      "UsageReportEnvelopeOfOrganizationMonthlyAggregate": {
        "type": "object",
        "properties": {
          "report_start_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "report_end_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "record_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationMonthlyAggregate"
            }
          }
        }
      },
      "UsageReportEnvelopeOfUserMonthlyAggregate": {
        "type": "object",
        "properties": {
          "report_start_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "report_end_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "record_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserMonthlyAggregate"
            }
          }
        }
      },
      "UsageReportEnvelopeOfUserUsageRecord": {
        "type": "object",
        "properties": {
          "report_start_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "report_end_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "record_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserUsageRecord"
            }
          }
        }
      },
      "UserMonthlyAggregate": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "user_login": {
            "type": "string"
          },
          "user_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "active_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_agent_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_chat_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_cli_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_copilot_cloud_agent_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_copilot_code_review_active_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used_copilot_code_review_passive_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "totals_by_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FeatureTotals"
            }
          },
          "totals_by_ide": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IdeTotals"
            }
          },
          "totals_by_language_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageFeatureTotals"
            }
          },
          "totals_by_model_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelFeatureTotals"
            }
          },
          "partial_month": {
            "type": "boolean"
          }
        }
      },
      "UserUsageRecord": {
        "type": "object",
        "properties": {
          "user_login": {
            "type": [
              "null",
              "string"
            ]
          },
          "user_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "report_start_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "report_end_day": {
            "type": [
              "null",
              "string"
            ]
          },
          "used_agent": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_chat": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_cli": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_copilot_coding_agent": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_copilot_cloud_agent": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_copilot_code_review_active": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "used_copilot_code_review_passive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "day": {
            "type": [
              "null",
              "string"
            ]
          },
          "organization_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "enterprise_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "totals_by_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FeatureTotals"
            }
          },
          "totals_by_ide": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IdeTotals"
            }
          },
          "totals_by_language_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageFeatureTotals"
            }
          },
          "totals_by_model_feature": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ModelFeatureTotals"
            }
          },
          "totals_by_language_model": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LanguageModelTotals"
            }
          },
          "totals_by_cli": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CliTotals"
              }
            ]
          },
          "user_initiated_interaction_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_generation_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "code_acceptance_activity_count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_add_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_added_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_suggested_to_delete_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "loc_deleted_sum": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "metrics"
    }
  ]
}