> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# list

> List voice call log entries.

List voice call log entries.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/voice/logs:
    get:
      operationId: subpackageVoiceLogs_list_voice_logs
      summary: List voice logs
      description: >-
        Lists historical voice activity in the project across supported call
        types. Use it for usage reporting, billing review, and troubleshooting,
        not live call control. Place or control calls through [Send call
        commands](/docs/apis/rest/calls/call-commands) or the Compatibility
        Calls API instead.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Voice_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_voiceLogs
      parameters:
        - name: include_deleted
          in: query
          description: Include logs for deleted activity.
          required: false
          schema:
            type: boolean
            default: false
        - name: created_before
          in: query
          description: Return logs for activity prior to this date.
          required: false
          schema:
            type: string
        - name: created_on
          in: query
          description: Return logs for activity on this date.
          required: false
          schema:
            type: string
        - name: created_after
          in: query
          description: Return logs for activity after this date.
          required: false
          schema:
            type: string
        - name: page_number
          in: query
          description: >-
            Page number to return. Requires `page_token` for values greater than
            0.
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: page_size
          in: query
          description: >-
            Specify the number of results to return on a single page. The
            default page size is `50` and the maximum is `1000`.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 50
        - name: page_token
          in: query
          description: >-
            Token for cursor-based pagination. Required when `page_number` is
            greater than 0.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice.LogListResponse'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode400'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice.VoiceLogsListStatusCode422'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
tags:
  - name: subpackage_voiceLogs
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    Voice.LogPaginationResponse:
      type: object
      properties:
        self:
          type: string
          description: URL of the current page.
        first:
          type: string
          description: URL of the first page.
        next:
          type: string
          description: URL of the next page. Absent on the last page.
        prev:
          type: string
          description: URL of the previous page. Absent on the first page.
      required:
        - self
        - first
      description: Pagination links for voice log list responses
      title: Voice.LogPaginationResponse
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    Voice.VoiceSources:
      type: string
      enum:
        - dialogflow
        - laml
        - realtime_api
      title: Voice.VoiceSources
    Voice.ChargeDetail:
      type: object
      properties:
        description:
          type: string
          description: Description for this charge.
        charge:
          type: number
          format: double
          description: Charged amount.
      required:
        - description
        - charge
      description: Details on charges associated with this log.
      title: Voice.ChargeDetail
    Voice.RelayVoiceType:
      type: string
      enum:
        - laml_call
        - relay_pstn_call
        - relay_sip_call
        - relay_webrtc_call
      title: Voice.RelayVoiceType
    Voice.VoiceDirection:
      type: string
      enum:
        - inbound
        - outbound
        - outbound-api
        - outbound-dial
      title: Voice.VoiceDirection
    Voice.VoiceLogStatus:
      type: string
      enum:
        - queued
        - initiated
        - ringing
        - in-progress
        - busy
        - failed
        - no-answer
        - canceled
        - completed
        - ended
        - answered
        - created
        - ending
        - joined
      title: Voice.VoiceLogStatus
    Voice.RelayVoiceLog:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the log.
        from:
          type: string
          description: The origin phone number.
        to:
          type: string
          description: The destination phone number.
        source:
          $ref: '#/components/schemas/Voice.VoiceSources'
          description: Source of this log entry.
        charge:
          type: number
          format: double
          description: The charge in dollars.
        charge_details:
          type: array
          items:
            $ref: '#/components/schemas/Voice.ChargeDetail'
          description: Details on charges associated with this log.
        created_at:
          type: string
          format: date-time
          description: Date and time when the call entry was created.
        type:
          $ref: '#/components/schemas/Voice.RelayVoiceType'
          description: Type of this log entry.
        url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            URL for the resource associated with this log entry. Present for
            LAML calls, null for Relay calls.
        direction:
          $ref: '#/components/schemas/Voice.VoiceDirection'
          description: The direction of the voice activity.
        status:
          $ref: '#/components/schemas/Voice.VoiceLogStatus'
          description: The status of the voice activity.
        duration:
          type:
            - integer
            - 'null'
          description: The duration of the voice activity in seconds.
        duration_ms:
          type:
            - integer
            - 'null'
          description: The duration of the voice activity in milliseconds.
        billing_ms:
          type:
            - integer
            - 'null'
          description: The billable duration of the voice activity in milliseconds.
        parent_id:
          type:
            - string
            - 'null'
          description: Parent log identifier for related call entries.
      required:
        - id
        - from
        - to
        - source
        - charge
        - charge_details
        - created_at
        - type
        - url
        - direction
        - status
        - duration
        - duration_ms
        - billing_ms
        - parent_id
      description: >-
        Voice log for Compatibility and Relay call types. Returned when `type`
        is `laml_call`, `relay_pstn_call`, `relay_sip_call`, or
        `relay_webrtc_call`.
      title: Voice.RelayVoiceLog
    Voice.VideoRoomVoiceType:
      type: string
      enum:
        - video_room_pstn_leg
        - video_room_sip_leg
      title: Voice.VideoRoomVoiceType
    Voice.VideoRoomVoiceLog:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the log.
        from:
          type: string
          description: The origin phone number.
        to:
          type: string
          description: The destination phone number.
        source:
          $ref: '#/components/schemas/Voice.VoiceSources'
          description: Source of this log entry.
        charge:
          type: number
          format: double
          description: The charge in dollars.
        charge_details:
          type: array
          items:
            $ref: '#/components/schemas/Voice.ChargeDetail'
          description: Details on charges associated with this log.
        created_at:
          type: string
          format: date-time
          description: Date and time when the call entry was created.
        type:
          $ref: '#/components/schemas/Voice.VideoRoomVoiceType'
          description: Type of this log entry.
        url:
          description: Always null for this call type.
        direction:
          $ref: '#/components/schemas/Voice.VoiceDirection'
          description: The direction of the voice activity.
        status:
          $ref: '#/components/schemas/Voice.VoiceLogStatus'
          description: The status of the voice activity.
        duration:
          type:
            - integer
            - 'null'
          description: The duration of the voice activity in seconds.
        duration_ms:
          type:
            - integer
            - 'null'
          description: The duration of the voice activity in milliseconds.
      required:
        - id
        - from
        - to
        - source
        - charge
        - charge_details
        - created_at
        - type
        - url
        - direction
        - status
        - duration
        - duration_ms
      description: >-
        Voice log for audio legs in a Video Room. Returned when `type` is
        `video_room_pstn_leg` or `video_room_sip_leg`.
      title: Voice.VideoRoomVoiceLog
    VoiceDialogflowVoiceLogType:
      type: string
      enum:
        - dialogflow_call
      description: Type of this log entry.
      title: VoiceDialogflowVoiceLogType
    Voice.DialogflowVoiceLog:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the log.
        from:
          type: string
          description: The origin phone number.
        to:
          type: string
          description: The destination phone number.
        source:
          $ref: '#/components/schemas/Voice.VoiceSources'
          description: Source of this log entry.
        charge:
          type: number
          format: double
          description: The charge in dollars.
        charge_details:
          type: array
          items:
            $ref: '#/components/schemas/Voice.ChargeDetail'
          description: Details on charges associated with this log.
        created_at:
          type: string
          format: date-time
          description: Date and time when the call entry was created.
        type:
          $ref: '#/components/schemas/VoiceDialogflowVoiceLogType'
          description: Type of this log entry.
        url:
          description: Always null for this call type.
        status:
          $ref: '#/components/schemas/Voice.VoiceLogStatus'
          description: The status of the voice activity.
        duration:
          type:
            - integer
            - 'null'
          description: The duration of the voice activity in seconds.
      required:
        - id
        - from
        - to
        - source
        - charge
        - charge_details
        - created_at
        - type
        - url
        - status
        - duration
      description: >-
        Voice log for Dialogflow call types. Returned when `type` is
        `dialogflow_call`.
      title: Voice.DialogflowVoiceLog
    VoiceFabricVoiceLogType:
      type: string
      enum:
        - fabric_subscriber_device_leg
      description: Type of this log entry.
      title: VoiceFabricVoiceLogType
    Voice.FabricVoiceLog:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the log.
        from:
          type: string
          description: The origin phone number.
        to:
          type: string
          description: The destination phone number.
        source:
          $ref: '#/components/schemas/Voice.VoiceSources'
          description: Source of this log entry.
        charge:
          type: number
          format: double
          description: The charge in dollars.
        charge_details:
          type: array
          items:
            $ref: '#/components/schemas/Voice.ChargeDetail'
          description: Details on charges associated with this log.
        created_at:
          type: string
          format: date-time
          description: Date and time when the call entry was created.
        type:
          $ref: '#/components/schemas/VoiceFabricVoiceLogType'
          description: Type of this log entry.
        url:
          description: Always null for this call type.
        direction:
          $ref: '#/components/schemas/Voice.VoiceDirection'
          description: The direction of the voice activity.
        status:
          oneOf:
            - $ref: '#/components/schemas/Voice.VoiceLogStatus'
            - type: 'null'
          description: The status of the voice activity. Always null for this call type.
      required:
        - id
        - from
        - to
        - source
        - charge
        - charge_details
        - created_at
        - type
        - url
        - direction
        - status
      description: >-
        Voice log for Fabric Subscriber Device call types. Returned when `type`
        is `fabric_subscriber_device_leg`.
      title: Voice.FabricVoiceLog
    Voice.DiscardedVoiceLog:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: A unique identifier for the log.
        discarded_at:
          type: string
          format: date-time
          description: Date and time when the log was discarded.
        created_at:
          type: string
          format: date-time
          description: Date and time when the log was originally created.
      required:
        - id
        - discarded_at
        - created_at
      description: >-
        A discarded/deleted voice log entry. Returned when the log has been
        deleted. Only present when `include_deleted` is `true`.
      title: Voice.DiscardedVoiceLog
    Voice.VoiceLog:
      oneOf:
        - $ref: '#/components/schemas/Voice.RelayVoiceLog'
        - $ref: '#/components/schemas/Voice.VideoRoomVoiceLog'
        - $ref: '#/components/schemas/Voice.DialogflowVoiceLog'
        - $ref: '#/components/schemas/Voice.FabricVoiceLog'
        - $ref: '#/components/schemas/Voice.DiscardedVoiceLog'
      description: >-
        A voice log entry. The specific fields present depend on the `type`
        value. Discarded logs return only `id`, `discarded_at`, and
        `created_at`.
      title: Voice.VoiceLog
    Voice.LogListResponse:
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Voice.LogPaginationResponse'
          description: Pagination links
        data:
          type: array
          items:
            $ref: '#/components/schemas/Voice.VoiceLog'
          description: Array of voice log entries
      required:
        - links
        - data
      description: Response model for voice log list endpoint
      title: Voice.LogListResponse
    TypesStatusCodesStatusCode400Error:
      type: string
      enum:
        - Bad Request
      title: TypesStatusCodesStatusCode400Error
    Types.StatusCodes.StatusCode400:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode400Error'
      required:
        - error
      description: The request is invalid.
      title: Types.StatusCodes.StatusCode400
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    Types.StatusCodes.RestApiErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The category of error.
        code:
          type: string
          description: A specific error code.
        message:
          type: string
          description: A description of what caused the error.
        attribute:
          type:
            - string
            - 'null'
          description: The request parameter that caused the error, if applicable.
        url:
          type: string
          description: A link to documentation about this error.
      required:
        - type
        - code
        - message
        - url
      description: Details about a specific error.
      title: Types.StatusCodes.RestApiErrorItem
    Voice.VoiceLogsListStatusCode422:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      required:
        - errors
      description: The request contains invalid parameters. See errors for details.
      title: Voice.VoiceLogsListStatusCode422
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "links": {
    "self": "https://example.signalwire.com/api/voice/logs?page_number=0&page_size=50",
    "first": "https://example.signalwire.com/api/voice/logs?page_size=50"
  },
  "data": [
    {
      "billing_ms": 60000,
      "charge": 0.01,
      "charge_details": [],
      "created_at": "2024-05-06T12:20:00Z",
      "direction": "inbound",
      "duration": 9,
      "duration_ms": 9638,
      "from": "+12065551212",
      "id": "b7182dc2-00f3-40e4-a5ce-20f164b329df",
      "parent_id": null,
      "source": "realtime_api",
      "status": "completed",
      "to": "+12065553434",
      "type": "relay_pstn_call",
      "url": null
    }
  ]
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

calls = client.logs.voice.list(page_size=20)
for call in calls.get("data", []):
    print(call.get("from"), "->", call.get("to"), call.get("duration"))
```