> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 按自定义日期范围 GET 活跃用户

> 获取自定义日期范围内的独立活跃用户数。

如果用户在指定时间范围内创建的会话数量至少为 min_sessions，或发起的搜索次数至少为 min_searches，则视为活跃用户。

返回在整个时间范围内去重后的活跃用户总数。

<div id="permissions">
  ## 权限
</div>

需要一个在 Enterprise 级别拥有 `ViewAccountMetrics` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/enterprise/metrics/active-users
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/metrics/active-users:
    get:
      tags:
        - metrics
      summary: 按自定义日期范围 GET 活跃用户
      description: |-
        获取自定义日期范围内的独立活跃用户数。

        如果用户在指定时间范围内创建的会话数量至少为 min_sessions，或发起的搜索次数至少为 min_searches，则视为活跃用户。

        返回在整个时间范围内去重后的活跃用户总数。
      operationId: handle_get_active_users_metrics_v3_enterprise_metrics_active_users_get
      parameters:
        - in: query
          name: time_before
          required: true
          schema:
            title: Time Before
            type: integer
        - in: query
          name: time_after
          required: true
          schema:
            title: Time After
            type: integer
        - in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Org Ids
        - in: query
          name: min_sessions
          required: false
          schema:
            default: 1
            minimum: 0
            title: Min Sessions
            type: integer
        - in: query
          name: min_searches
          required: false
          schema:
            default: 1
            minimum: 0
            title: Min Searches
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUserMetricsResponse'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    ActiveUserMetricsResponse:
      description: 活跃用户数量随时间变化的单条记录。
      properties:
        active_users:
          title: Active Users
          type: integer
        end_time:
          title: End Time
          type: integer
        start_time:
          title: Start Time
          type: integer
      required:
        - start_time
        - end_time
        - active_users
      title: ActiveUserMetricsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````