> ## 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.

# Re-run a stored taxonomy analytics run

> Re-execute a previously persisted analytics run using its stored parameters and return the FRESH result. The stored run is updated in place with the new result (run_count is incremented).



## OpenAPI

````yaml post /v1/taxonomies/{taxonomy_id}/analytics/runs/{run_id}/rerun
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:
  - BearerAuth: []
paths:
  /v1/taxonomies/{taxonomy_id}/analytics/runs/{run_id}/rerun:
    post:
      tags:
        - Taxonomy Analytics
      summary: Re-run a stored taxonomy analytics run
      description: >-
        Re-execute a previously persisted analytics run using its stored
        parameters and return the FRESH result. The stored run is updated in
        place with the new result (run_count is incremented).
      operationId: >-
        rerun_analytics_run_v1_taxonomies__taxonomy_id__analytics_runs__run_id__rerun_post
      parameters:
        - name: taxonomy_id
          in: path
          required: true
          schema:
            type: string
            title: Taxonomy Id
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/StepTransitionResponse'
                  - $ref: '#/components/schemas/PathAnalysisResponse'
                title: >-
                  Response Rerun Analytics Run V1 Taxonomies  Taxonomy Id 
                  Analytics Runs  Run Id  Rerun Post
        '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'
      security:
        - BearerAuth: []
          NamespaceHeader: []
components:
  schemas:
    StepTransitionResponse:
      properties:
        from_step:
          type: string
          title: From Step
          description: Starting step
        to_step:
          type: string
          title: To Step
          description: Ending step
        count:
          type: integer
          minimum: 0
          title: Count
          description: Total number of sequences starting at from_step
        converted:
          type: integer
          minimum: 0
          title: Converted
          description: Number of sequences that reached to_step
        conversion_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Conversion Rate
          description: Percentage that converted (converted / count)
        durations_sec:
          anyOf:
            - $ref: '#/components/schemas/DurationStats'
            - type: 'null'
          description: Duration statistics (None if no conversions)
        top_predictors:
          items:
            $ref: '#/components/schemas/PredictorLift'
          type: array
          maxItems: 50
          title: Top Predictors
          description: Covariates with highest lift (sorted by absolute lift)
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Additional metadata (collection_id, event counts, etc.)
      type: object
      required:
        - from_step
        - to_step
        - count
        - converted
        - conversion_rate
      title: StepTransitionResponse
      description: |-
        API response model for step transition analytics.

        Contains comprehensive statistics about the A→B transition including
        conversion metrics, duration analysis, and predictor insights.

        Example Response:
            ```json
            {
                "from_step": "inquiry",
                "to_step": "closed_won",
                "count": 1000,
                "converted": 350,
                "conversion_rate": 0.35,
                "durations_sec": {
                    "mean": 432000.0,
                    "median": 345600.0,
                    "p50": 345600.0,
                    "p90": 691200.0,
                    "p95": 864000.0,
                    "std_dev": 172800.0,
                    "min": 86400.0,
                    "max": 1209600.0
                },
                "top_predictors": [
                    {
                        "field": "Sender Domain",
                        "value": "enterprise.com",
                        "count": 150,
                        "conversion_rate": 0.75,
                        "lift": 2.14
                    }
                ],
                "metadata": {
                    "collection_id": "col_emails",
                    "taxonomy_id": "tax_sales_stages",
                    "total_events_analyzed": 5432
                }
            }
            ```
    PathAnalysisResponse:
      properties:
        from_step:
          type: string
          title: From Step
        to_step:
          type: string
          title: To Step
        total_sequences:
          type: integer
          title: Total Sequences
          description: Total sequences that started at from_step
        completed_sequences:
          type: integer
          title: Completed Sequences
          description: Number of sequences that reached to_step
        completion_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Completion Rate
          description: Percentage that completed the path
        paths:
          items:
            $ref: '#/components/schemas/TransitionPath'
          type: array
          maxItems: 100
          title: Paths
          description: List of paths sorted by frequency (most common first)
      type: object
      required:
        - from_step
        - to_step
        - total_sequences
        - completed_sequences
        - completion_rate
        - paths
      title: PathAnalysisResponse
      description: >-
        API response model for multi-step path analysis.


        Contains discovered transition paths with frequency and duration
        statistics.


        Example Response:
            ```json
            {
                "from_step": "inquiry",
                "to_step": "closed_won",
                "total_sequences": 1000,
                "completed_sequences": 350,
                "completion_rate": 0.35,
                "paths": [
                    {
                        "path": ["inquiry", "followup", "proposal", "closed_won"],
                        "count": 120,
                        "percentage": 34.3,
                        "avg_duration_sec": 604800.0
                    },
                    {
                        "path": ["inquiry", "proposal", "closed_won"],
                        "count": 90,
                        "percentage": 25.7,
                        "avg_duration_sec": 432000.0
                    },
                    {
                        "path": ["inquiry", "closed_won"],
                        "count": 70,
                        "percentage": 20.0,
                        "avg_duration_sec": 172800.0
                    }
                ]
            }
            ```
    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
    DurationStats:
      properties:
        mean:
          type: number
          title: Mean
          description: Average duration in seconds
        median:
          type: number
          title: Median
          description: Median duration in seconds
        p50:
          type: number
          title: P50
          description: 50th percentile (same as median)
        p90:
          type: number
          title: P90
          description: 90th percentile duration in seconds
        p95:
          type: number
          title: P95
          description: 95th percentile duration in seconds
        std_dev:
          type: number
          title: Std Dev
          description: Standard deviation in seconds
        min:
          type: number
          title: Min
          description: Minimum duration observed in seconds
        max:
          type: number
          title: Max
          description: Maximum duration observed in seconds
      type: object
      required:
        - mean
        - median
        - p50
        - p90
        - p95
        - std_dev
        - min
        - max
      title: DurationStats
      description: >-
        Statistical distribution of durations for successful step transitions.


        Provides comprehensive percentile analysis to understand timing
        patterns.


        Attributes:
            mean: Average duration (seconds)
            median: Middle value (50th percentile)
            p50: 50th percentile (same as median, included for consistency)
            p90: 90th percentile (90% complete faster)
            p95: 95th percentile (95% complete faster)
            std_dev: Standard deviation (measure of spread)
            min: Fastest observed duration
            max: Slowest observed duration

        Example:
            ```python
            DurationStats(
                mean=432000.0,     # 5 days average
                median=345600.0,   # 4 days median
                p50=345600.0,
                p90=691200.0,      # 8 days (90th percentile)
                p95=864000.0,      # 10 days (95th percentile)
                std_dev=172800.0,  # 2 days std dev
                min=86400.0,       # 1 day minimum
                max=1209600.0      # 14 days maximum
            )
            ```
    PredictorLift:
      properties:
        field:
          type: string
          title: Field
          description: Covariate field name
        value:
          type: string
          title: Value
          description: Specific value or bin label
        count:
          type: integer
          minimum: 0
          title: Count
          description: Number of sequences with this value
        conversion_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Conversion Rate
          description: Conversion rate for this value
        lift:
          type: number
          title: Lift
          description: Lift relative to baseline (>1.0 = positive, <1.0 = negative)
      type: object
      required:
        - field
        - value
        - count
        - conversion_rate
        - lift
      title: PredictorLift
      description: >-
        Lift calculation for a specific covariate value.


        Lift measures how much a specific value increases/decreases conversion
        likelihood

        compared to the baseline. Lift > 1.0 means the value helps conversion.


        Attributes:
            field: Name of the covariate (e.g., "Sender Domain", "Word Count Q3")
            value: Specific value or bin (e.g., "gmail.com", "Q3")
            count: Number of sequences with this value
            conversion_rate: Conversion rate for this value (0.0 to 1.0)
            lift: Conversion rate / baseline rate (1.0 = no effect, >1.0 = positive, <1.0 = negative)

        Example:
            ```python
            # Sender domain "enterprise.com" has 2.5x baseline conversion
            PredictorLift(
                field="Sender Domain",
                value="enterprise.com",
                count=150,
                conversion_rate=0.75,  # 75% conversion
                lift=2.5  # 2.5x the baseline rate
            )
            ```

        Interpretation:
            - lift = 1.5: This value increases conversion by 50%
            - lift = 1.0: No effect on conversion
            - lift = 0.5: This value decreases conversion by 50%
    TransitionPath:
      properties:
        path:
          items:
            type: string
          type: array
          minItems: 2
          title: Path
          description: Ordered sequence of steps
          examples:
            - - inquiry
              - followup
              - closed_won
            - - draft
              - review
              - published
        count:
          type: integer
          minimum: 0
          title: Count
          description: Number of sequences following this path
        percentage:
          type: number
          maximum: 100
          minimum: 0
          title: Percentage
          description: Percentage of total completing sequences
        avg_duration_sec:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Duration Sec
          description: Average time to complete this path (seconds)
      type: object
      required:
        - path
        - count
        - percentage
      title: TransitionPath
      description: |-
        Represents a multi-step path between two steps.

        Tracks the intermediate steps documents take when transitioning from
        from_step to to_step.

        Attributes:
            path: Ordered sequence of steps (e.g., ["inquiry", "followup", "proposal", "closed_won"])
            count: Number of sequences that followed this exact path
            percentage: Percentage of all completing sequences that used this path
            avg_duration_sec: Average time to complete this path

        Example:
            ```python
            # 30% of successful conversions took this 4-step path
            TransitionPath(
                path=["inquiry", "followup", "proposal", "closed_won"],
                count=120,
                percentage=34.3,
                avg_duration_sec=604800.0  # 7 days average
            )
            ```
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Mixpeek API key, sent as `Authorization: Bearer mxp_sk_...`. Create one
        in Studio under Settings → API Keys, or with an admin key via `POST
        /v1/organizations/users/{user_email}/api-keys`. A missing header returns
        403; an invalid or revoked key returns 401.
    NamespaceHeader:
      type: apiKey
      in: header
      name: X-Namespace
      description: >-
        Namespace id (`ns_...`), not the namespace name. This scopes the request
        rather than authenticating it, and it is required on every operation
        marked `x-mixpeek-namespace-scoped`.

````