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

# Get customer score streaks

> Get score streaks of a customer. By default, only returns ACTIVE streaks. Pass `include=history` to also get a flat, time-ordered list of all history events across all streaks.



## OpenAPI

````yaml GET /customers/{id}/score-streaks
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /customers/{id}/score-streaks:
    get:
      description: >-
        Get score streaks of a customer. By default, only returns ACTIVE
        streaks. Pass `include=history` to also get a flat, time-ordered list of
        all history events across all streaks.
      parameters:
        - in: path
          name: id
          description: The customer unique identifier in your system
          required: true
          schema:
            type: string
        - in: query
          name: score_streak_id
          description: Filter results to a single score streak by its UUID
          required: false
          schema:
            type: string
            format: uuid
        - in: query
          name: campaign_id
          description: Filter results to streaks belonging to a specific campaign
          required: false
          schema:
            type: string
            format: uuid
        - in: query
          name: status
          description: Filter streaks by status. Defaults to ACTIVE
          required: false
          schema:
            type: string
            enum:
              - ALL
              - ACTIVE
              - CLOSED
            default: ACTIVE
        - in: query
          name: include
          description: >-
            Pass `history` to include flattened, time-ordered history events in
            the response
          required: false
          schema:
            type: string
            enum:
              - history
        - in: query
          name: limit
          description: >-
            Maximum number of history events to return when `include=history`.
            Defaults to 100, max 200
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 100
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: Default response (no `include` param)
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ScoreStreak'
                  - type: object
                    description: Response when `include=history`
                    properties:
                      data:
                        type: object
                        properties:
                          streaks:
                            type: array
                            items:
                              $ref: '#/components/schemas/ScoreStreak'
                          history:
                            type: array
                            items:
                              $ref: '#/components/schemas/ScoreStreakHistoryEntry'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ScoreStreak:
      type: object
      properties:
        id:
          type: string
          description: The score streak unique identifier
          format: uuid
        account_id:
          type: string
          description: The account unique identifier
          format: uuid
        customer_id:
          type: string
          description: The customer unique identifier in your system
        campaign_id:
          type: string
          description: The campaign that owns this streak
          format: uuid
        current_cycle_id:
          type: string
          description: UUID of the current streak cycle. Changes on every LOSS or RESET
          format: uuid
        status:
          type: string
          description: Streak status
          enum:
            - ACTIVE
            - CLOSED
        current_score:
          type: number
          description: Cumulative score earned in the current cycle
          example: 7
        current_streak:
          type: number
          description: Number of qualifying events in the current cycle
          example: 7
        highest_milestone_score:
          type: number
          description: Highest milestone score reached in the current cycle
          example: 5
        period_started_at:
          type: string
          description: Start of the current loss-window period
          format: date-time
        period_ends_at:
          type: string
          description: >-
            Deadline for the next qualifying event. After this the streak is
            lost
          format: date-time
        period_score:
          type: number
          description: Score accumulated within the current period
          example: 1
        period_event_count:
          type: number
          description: Number of qualifying events in the current period
          example: 1
        next_reset_at:
          type: string
          nullable: true
          description: When the next scheduled reset will fire. Null if reset is disabled
          format: date-time
        last_activity_at:
          type: string
          nullable: true
          description: Timestamp of the last qualifying event
          format: date-time
        last_qualified_at:
          type: string
          nullable: true
          description: Timestamp of the last event that qualified for a score point
          format: date-time
        last_loss_at:
          type: string
          nullable: true
          description: Timestamp of the last streak loss. Null if never lost
          format: date-time
        last_reset_at:
          type: string
          nullable: true
          description: Timestamp of the last scheduled or manual reset. Null if never reset
          format: date-time
        deleted_at:
          type: string
          nullable: true
          description: Soft-delete timestamp
          format: date-time
        created_at:
          type: string
          description: When this streak record was created
          format: date-time
        updated_at:
          type: string
          description: When this streak record was last modified
          format: date-time
    ScoreStreakHistoryEntry:
      type: object
      description: >-
        A single event in the customer's streak history. Returned when
        `include=history`
      properties:
        id:
          type: string
          description: History event identifier
          format: uuid
        score_streak_id:
          type: string
          description: Parent score streak identifier
          format: uuid
        campaign_id:
          type: string
          description: Campaign that owns the parent streak
          format: uuid
        customer_id:
          type: string
          description: Customer identifier
        cycle_id:
          type: string
          description: The cycle this event belongs to
          format: uuid
        type:
          type: string
          description: Type of history event
          enum:
            - GAIN
            - MILESTONE
            - LOSS
            - RESET
            - MANUAL_RESET
            - EVENT_REVERSAL
        source_event_id:
          type: string
          nullable: true
          description: >-
            The behavior event that triggered this history entry (GAIN and
            MILESTONE only)
        score_delta:
          type: number
          nullable: true
          description: >-
            How much the score changed (+1 for GAIN, negative for
            EVENT_REVERSAL)
        score_before:
          type: number
          nullable: true
          description: Score before this event
        score_after:
          type: number
          nullable: true
          description: Score after this event
        period_started_at:
          type: string
          nullable: true
          description: Period start at the time of this event
          format: date-time
        period_ends_at:
          type: string
          nullable: true
          description: Period deadline at the time of this event
          format: date-time
        milestone_score:
          type: number
          nullable: true
          description: The milestone score that was reached (MILESTONE events only)
        reversed_at:
          type: string
          nullable: true
          description: If set, this event was subsequently reversed
          format: date-time
        reason:
          type: string
          nullable: true
          description: Human-readable reason (MANUAL_RESET and EVENT_REVERSAL events)
        actor_id:
          type: string
          nullable: true
          description: Identifier of the support agent who triggered a manual reset
        metadata:
          type: object
          description: Additional context (e.g. reversed_gain_id for EVENT_REVERSAL)
        created_at:
          type: string
          description: When this history event was recorded
          format: date-time
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````