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

# Get service-area distribution

> Distribution of service-area lookups. Same query parameters as funnel. Requires the `read:scheduler_analytics` permission.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/teams/{teamId}/analytics/service-areas
openapi: 3.1.0
info:
  title: Avoca Enterprise API
  description: >-
    Read-only programmatic access to Avoca data: calls, transcripts, leads,
    coach evaluations, Simple Scheduler sessions and analytics, and outbound
    texting activity.
  version: 1.3.0
servers:
  - url: https://enterprise-api.avoca.ai
security:
  - bearerAuth: []
tags:
  - name: Calls
    description: Call records, transcripts, and pre-call transfers
  - name: Leads
    description: Unified leads (v0) and the canonical leads feed (v1)
  - name: Teams
    description: Teams accessible to the API key
  - name: Coach
    description: Coach (QA) call evaluations and rubrics
  - name: Scheduler Analytics (v0)
    description: Simple Scheduler analytics — legacy flat endpoints
  - name: Sessions & Bookings
    description: v1 scheduling-widget sessions and completed bookings
  - name: Analytics (v1)
    description: v1 funnel, UTM, service-area, and issue-type analytics
  - name: Outbound Texting
    description: Campaign text and subscription-event feeds for BI ingestion
paths:
  /api/v1/teams/{teamId}/analytics/service-areas:
    get:
      tags:
        - Analytics (v1)
      summary: Get service-area distribution
      description: >-
        Distribution of service-area lookups. Same query parameters as funnel.
        Requires the `read:scheduler_analytics` permission.
      operationId: getTeamServiceAreas
      parameters:
        - $ref: '#/components/parameters/teamIdPath'
        - $ref: '#/components/parameters/startDate7d'
        - $ref: '#/components/parameters/endDateNow'
        - $ref: '#/components/parameters/timezone'
        - name: scheduler_id
          in: query
          description: Filter to a specific scheduler
          schema:
            type: integer
      responses:
        '200':
          description: Service-area distribution
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        serviceArea:
                          type: string
                        count:
                          type: integer
                  meta:
                    $ref: '#/components/schemas/AnalyticsMeta'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    teamIdPath:
      name: teamId
      in: path
      required: true
      description: The team ID
      schema:
        type: integer
    startDate7d:
      name: start_date
      in: query
      description: Start of date range (ISO 8601; default 7 days ago)
      schema:
        type: string
        format: date-time
    endDateNow:
      name: end_date
      in: query
      description: End of date range (ISO 8601; default now)
      schema:
        type: string
        format: date-time
    timezone:
      name: timezone
      in: query
      description: IANA timezone for date calculations (default America/New_York)
      schema:
        type: string
        default: America/New_York
  schemas:
    AnalyticsMeta:
      type: object
      properties:
        team_id:
          type: integer
        start_date:
          type: string
        end_date:
          type: string
        timezone:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Human-readable description (newer endpoints)
      required:
        - error
  responses:
    Forbidden:
      description: API key lacks the required permission or team access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key in the format `avoca_<64 hex characters>`

````