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

# Get Namespace Summary

> Get comprehensive namespace optimization summary.

Provides a complete overview of namespace performance including:
- Top index recommendations
- Most queried fields
- Slowest fields
- Compound index opportunities
- Summary statistics

**Use Cases:**
- Get full optimization picture
- Regular performance reviews
- Database health checks
- Planning optimization work

**Response Includes:**
- Summary statistics (field counts, priority levels)
- Top 10 index recommendations
- Top 10 most queried fields
- Top 10 slowest fields
- Top 10 compound index opportunities

**Recommended Workflow:**
1. Call this endpoint for overview
2. Use specific endpoints for details
3. Implement high-priority recommendations
4. Monitor improvement over time

**Example:**
```bash
curl -X GET "https://api.mixpeek.com/v1/analytics/namespaces/summary?days=30" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Namespace: your-namespace"
```



## OpenAPI

````yaml get /v1/analytics/namespaces/summary
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/analytics/namespaces/summary:
    get:
      tags:
        - Analytics
        - Analytics - Namespaces
      summary: Get Namespace Summary
      description: >-
        Get comprehensive namespace optimization summary.


        Provides a complete overview of namespace performance including:

        - Top index recommendations

        - Most queried fields

        - Slowest fields

        - Compound index opportunities

        - Summary statistics


        **Use Cases:**

        - Get full optimization picture

        - Regular performance reviews

        - Database health checks

        - Planning optimization work


        **Response Includes:**

        - Summary statistics (field counts, priority levels)

        - Top 10 index recommendations

        - Top 10 most queried fields

        - Top 10 slowest fields

        - Top 10 compound index opportunities


        **Recommended Workflow:**

        1. Call this endpoint for overview

        2. Use specific endpoints for details

        3. Implement high-priority recommendations

        4. Monitor improvement over time


        **Example:**

        ```bash

        curl -X GET
        "https://api.mixpeek.com/v1/analytics/namespaces/summary?days=30" \
          -H "Authorization: Bearer YOUR_API_KEY" \
          -H "X-Namespace: your-namespace"
        ```
      operationId: get_namespace_summary_v1_analytics_namespaces_summary_get
      parameters:
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 90
            minimum: 1
            description: Days of history to analyze
            default: 30
            title: Days
          description: Days of history to analyze
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespaceSummaryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    NamespaceSummaryResponse:
      properties:
        namespace_id:
          type: string
          title: Namespace Id
          description: Namespace ID analyzed
        time_range_days:
          type: integer
          title: Time Range Days
          description: Number of days analyzed
        summary:
          additionalProperties: true
          type: object
          title: Summary
          description: >-
            Summary statistics (total_fields_analyzed, high_priority_indexes,
            etc.)
        recommendations:
          items:
            $ref: '#/components/schemas/IndexRecommendation'
          type: array
          title: Recommendations
          description: Top index recommendations
        most_queried_fields:
          items:
            $ref: '#/components/schemas/FieldQueryMetrics'
          type: array
          title: Most Queried Fields
          description: Most frequently queried fields
        slowest_fields:
          items:
            $ref: '#/components/schemas/FieldPerformanceMetrics'
          type: array
          title: Slowest Fields
          description: Fields with highest latency
        compound_indexes:
          items:
            $ref: '#/components/schemas/CompoundIndexPattern'
          type: array
          title: Compound Indexes
          description: Compound index opportunities
      type: object
      required:
        - namespace_id
        - time_range_days
        - summary
        - recommendations
        - most_queried_fields
        - slowest_fields
        - compound_indexes
      title: NamespaceSummaryResponse
      description: Comprehensive namespace analytics summary.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    IndexRecommendation:
      properties:
        field_name:
          type: string
          title: Field Name
          description: Field to index
        query_count:
          type: integer
          title: Query Count
          description: Number of queries using this field
        avg_latency_ms:
          type: number
          title: Avg Latency Ms
          description: Average latency
        p95_latency_ms:
          type: number
          title: P95 Latency Ms
          description: 95th percentile latency
        slow_query_count:
          type: integer
          title: Slow Query Count
          description: Queries slower than 500ms
        very_slow_query_count:
          type: integer
          title: Very Slow Query Count
          description: Queries slower than 1000ms
        priority_score:
          type: number
          title: Priority Score
          description: Priority score for indexing
        recommendation:
          type: string
          title: Recommendation
          description: Human-readable recommendation level
        mongodb_index_command:
          type: string
          title: Mongodb Index Command
          description: Ready-to-use MongoDB index command
      type: object
      required:
        - field_name
        - query_count
        - avg_latency_ms
        - p95_latency_ms
        - slow_query_count
        - very_slow_query_count
        - priority_score
        - recommendation
        - mongodb_index_command
      title: IndexRecommendation
      description: MongoDB index recommendation.
    FieldQueryMetrics:
      properties:
        field_name:
          type: string
          title: Field Name
          description: Metadata field name
        query_count:
          type: integer
          title: Query Count
          description: Number of queries using this field
        avg_latency_ms:
          type: number
          title: Avg Latency Ms
          description: Average query latency in milliseconds
        p95_latency_ms:
          type: number
          title: P95 Latency Ms
          description: 95th percentile latency in milliseconds
      type: object
      required:
        - field_name
        - query_count
        - avg_latency_ms
        - p95_latency_ms
      title: FieldQueryMetrics
      description: Metrics for a metadata field's query usage.
    FieldPerformanceMetrics:
      properties:
        field_name:
          type: string
          title: Field Name
          description: Metadata field name
        usage_count:
          type: integer
          title: Usage Count
          description: Number of times field was queried
        avg_latency_ms:
          type: number
          title: Avg Latency Ms
          description: Average latency when field is used
        p50_latency_ms:
          type: number
          title: P50 Latency Ms
          description: 50th percentile latency
        p95_latency_ms:
          type: number
          title: P95 Latency Ms
          description: 95th percentile latency
        p99_latency_ms:
          type: number
          title: P99 Latency Ms
          description: 99th percentile latency
        max_latency_ms:
          type: number
          title: Max Latency Ms
          description: Maximum latency observed
        index_priority_score:
          type: number
          title: Index Priority Score
          description: Priority score for indexing (usage_count * avg_latency)
      type: object
      required:
        - field_name
        - usage_count
        - avg_latency_ms
        - p50_latency_ms
        - p95_latency_ms
        - p99_latency_ms
        - max_latency_ms
        - index_priority_score
      title: FieldPerformanceMetrics
      description: Performance correlation metrics for a field.
    CompoundIndexPattern:
      properties:
        field_combination:
          items:
            type: string
          type: array
          title: Field Combination
          description: Fields used together
        combination_count:
          type: integer
          title: Combination Count
          description: Number of times this combination was used
        avg_latency_ms:
          type: number
          title: Avg Latency Ms
          description: Average latency for this combination
        p95_latency_ms:
          type: number
          title: P95 Latency Ms
          description: 95th percentile latency
      type: object
      required:
        - field_combination
        - combination_count
        - avg_latency_ms
        - p95_latency_ms
      title: CompoundIndexPattern
      description: Pattern of fields commonly queried together.
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````