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

# List Opportunity Groups

> List the buckets the opportunity table groups into, with a count per bucket.

Each bucket's key round-trips into `/opportunity/list` as that column's
filter, which is how the grouped table paginates one group at a time.



## OpenAPI

````yaml get /opportunity/groups
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/groups:
    get:
      tags:
        - Opportunities
      summary: List Opportunity Groups
      description: >-
        List the buckets the opportunity table groups into, with a count per
        bucket.


        Each bucket's key round-trips into `/opportunity/list` as that column's

        filter, which is how the grouped table paginates one group at a time.
      operationId: list_opportunity_groups_opportunity_groups_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            title: Per Page
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_direction
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - asc
                  - desc
                type: string
              - type: 'null'
            title: Sort Direction
        - name: location_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Location Id
        - name: pipeline_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Filter by one or more pipelines; '__unassigned__' matches
              unenrolled opportunities
            title: Pipeline Id
          description: >-
            Filter by one or more pipelines; '__unassigned__' matches unenrolled
            opportunities
        - name: current_stage_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by one or more current stages
            title: Current Stage Id
          description: Filter by one or more current stages
        - name: campaign_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by one or more campaigns
            title: Campaign Id
          description: Filter by one or more campaigns
        - name: assigned_provider_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by one or more assigned providers
            title: Assigned Provider Id
          description: Filter by one or more assigned providers
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/OpportunityStatus'
              - type: 'null'
            description: Filter by one or more opportunity statuses
            title: Status
          description: Filter by one or more opportunity statuses
        - name: source_channel
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/TouchpointChannel'
              - type: 'null'
            description: Filter by one or more originating source channels
            title: Source Channel
          description: Filter by one or more originating source channels
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search in name, email, phone
            title: Search
          description: Search in name, email, phone
        - name: is_converted
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter converted/unconverted opportunities
            title: Is Converted
          description: Filter converted/unconverted opportunities
        - name: group_by
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/OpportunityGroupBy'
            description: Column to bucket opportunities by
          description: Column to bucket opportunities by
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OpportunityGroupItem'
                title: Response List Opportunity Groups Opportunity Groups Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OpportunityStatus:
      type: string
      enum:
        - OPEN
        - WON
        - LOST
        - DISQUALIFIED
      title: OpportunityStatus
      description: |-
        Terminal-capable status for a pursuit episode (separate from stage).

        Schema column lands with the opportunity rebuild; enum ships early so
        intake/services can type against it without a second enum PR.
    TouchpointChannel:
      type: string
      enum:
        - META_LEAD_FORM
        - GOOGLE_LEAD_FORM
        - PAID_CLICK
        - WEB_ORGANIC
        - WEB_FORM
        - WEB_CHAT
        - PHONE_CALL
        - SMS_INBOUND
        - EMAIL_INBOUND
        - DM_INSTAGRAM
        - DM_FACEBOOK
        - REFERRAL
        - WALK_IN
        - QR
        - IMPORT
        - OTHER
      title: TouchpointChannel
      description: |-
        How a marketing interaction was observed.

        Reporting dimension #1 on the touchpoint ledger. Add values only with
        a writer in the same PR (TypedEnum decodes unmapped strings to None).
    OpportunityGroupBy:
      type: string
      enum:
        - campaign
        - pipeline
        - stage
        - assigned_provider
        - status
      title: OpportunityGroupBy
      description: >-
        Column the opportunity table groups by when rendering one table per
        bucket.
    OpportunityGroupItem:
      properties:
        key:
          type: string
          title: Key
        label:
          type: string
          title: Label
        total:
          type: integer
          title: Total
      type: object
      required:
        - key
        - label
        - total
      title: OpportunityGroupItem
      description: >-
        One bucket of the grouped opportunity table: its key, label, and row
        count.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````