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

# Calls By Region

> Worldwide call distribution — calls aggregated by caller country.

Powers the dashboard's "calls by region" map (choropleth keyed on ISO-2
country codes). Country is derived from the caller's E.164 number at
call-creation time via libphonenumber.

**Response shape:**
```json
{
  "tenant_id": "...",
  "period": {"start": "2026-03-18T00:00:00Z", "end": "2026-04-17T23:59:59Z"},
  "regions": [
    {"country_code": "US", "country_name": "United States",
     "call_count": 1423, "total_minutes": 8921.5,
     "avg_duration_sec": 376, "inbound": 1200, "outbound": 223}
  ],
  "total_calls": 1735,
  "countries_count": 47,
  "calls_without_country": 12
}
```

Sorted by `call_count` DESC. `country_code` uses ISO 3166-1 alpha-2.
Calls with no parseable phone number (web sessions, anonymous calls)
are reported as `calls_without_country`.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json get /analytics/tenants/{tenant_id}/calls/by-region
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /analytics/tenants/{tenant_id}/calls/by-region:
    get:
      tags:
        - analytics
      summary: Calls By Region
      description: |-
        Worldwide call distribution — calls aggregated by caller country.

        Powers the dashboard's "calls by region" map (choropleth keyed on ISO-2
        country codes). Country is derived from the caller's E.164 number at
        call-creation time via libphonenumber.

        **Response shape:**
        ```json
        {
          "tenant_id": "...",
          "period": {"start": "2026-03-18T00:00:00Z", "end": "2026-04-17T23:59:59Z"},
          "regions": [
            {"country_code": "US", "country_name": "United States",
             "call_count": 1423, "total_minutes": 8921.5,
             "avg_duration_sec": 376, "inbound": 1200, "outbound": 223}
          ],
          "total_calls": 1735,
          "countries_count": 47,
          "calls_without_country": 12
        }
        ```

        Sorted by `call_count` DESC. `country_code` uses ISO 3166-1 alpha-2.
        Calls with no parseable phone number (web sessions, anonymous calls)
        are reported as `calls_without_country`.
      operationId: calls_by_region_analytics_tenants__tenant_id__calls_by_region_get
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Tenant Id
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: ISO start date (defaults to 30 days ago)
            title: Start Date
          description: ISO start date (defaults to 30 days ago)
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: ISO end date (defaults to now)
            title: End Date
          description: ISO end date (defaults to now)
        - name: direction
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^(inbound|outbound)$
              - type: 'null'
            description: Filter by call direction
            title: Direction
          description: Filter by call direction
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````