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

# List all log messages

> Retrieve a list of log messages for all external connections associated with your account.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/external-connects.yml get /external_connections/log_messages
openapi: 3.1.0
info:
  title: Telnyx External Connects API
  version: 2.0.0
  description: API for External connects.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /external_connections/log_messages:
    get:
      tags:
        - External Connections
      summary: List all log messages
      description: >-
        Retrieve a list of log messages for all external connections associated
        with your account.
      operationId: ListExternalConnectionLogMessages
      parameters:
        - $ref: '#/components/parameters/FilterLogMessagesConsolidated'
        - $ref: '#/components/parameters/external-voice-integrations_PageConsolidated'
      responses:
        '200':
          $ref: '#/components/responses/ListLogMessagesResponse'
        '401':
          description: Unauthorized
        '422':
          description: Bad request
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const logMessageListResponse of
            client.externalConnections.logMessages.list()) {
              console.log(logMessageListResponse.code);
            }
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            page = client.external_connections.log_messages.list()
            page = page.log_messages[0]
            print(page.code)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.ExternalConnections.LogMessages.List(context.TODO(), telnyx.ExternalConnectionLogMessageListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.externalconnections.logmessages.LogMessageListPage;

            import
            com.telnyx.sdk.models.externalconnections.logmessages.LogMessageListParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    LogMessageListPage page = client.externalConnections().logMessages().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            page = telnyx.external_connections.log_messages.list

            puts(page)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $page = $client->externalConnections->logMessages->list(
                filter: [
                  'externalConnectionID' => '67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2',
                  'telephoneNumber' => ['contains' => '+123', 'eq' => '+1234567890'],
                ],
                pageNumber: 0,
                pageSize: 0,
              );

              var_dump($page);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx external-connections:log-messages list \
              --api-key 'My API Key'
components:
  parameters:
    FilterLogMessagesConsolidated:
      name: filter
      in: query
      style: deepObject
      explode: true
      description: >-
        Filter parameter for log messages (deepObject style). Supports filtering
        by external_connection_id and telephone_number with eq/contains
        operations.
      schema:
        type: object
        properties:
          external_connection_id:
            type: string
            example: 67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2
            description: >-
              The external connection ID to filter by or "null" to filter for
              logs without an external connection ID
          telephone_number:
            type: object
            properties:
              eq:
                type: string
                example: '+1234567890'
                description: >-
                  The phone number to filter log messages for or "null" to
                  filter for logs without a phone number
                x-format: E164
              contains:
                type: string
                example: '+123'
                description: >-
                  The partial phone number to filter log messages for. Requires
                  3-15 digits.
            description: >-
              Telephone number filter operations for log messages. Use 'eq' for
              exact matches or 'contains' for partial matches.
    external-voice-integrations_PageConsolidated:
      name: page
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated page parameter (deepObject style). Originally: page[size],
        page[number]
      schema:
        type: object
        properties:
          size:
            type: integer
            minimum: 1
            maximum: 250
            default: 250
            description: The size of the page
          number:
            type: integer
            minimum: 1
            default: 1
            description: The page number to load
  responses:
    ListLogMessagesResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            title: List Log Messages Response
            properties:
              log_messages:
                type: array
                items:
                  $ref: '#/components/schemas/LogMessage'
              meta:
                $ref: >-
                  #/components/schemas/external-voice-integrations_PaginationMeta
  schemas:
    LogMessage:
      required:
        - code
        - title
      type: object
      properties:
        code:
          type: string
          example: '10015'
          x-format: int64
        title:
          type: string
          example: Invalid attribute
        detail:
          type: string
          example: >-
            The value provided for the attribute is not valid. Check the value
            used and try again.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
              example: /attribute
        meta:
          type: object
          properties:
            telephone_number:
              type: string
              description: The telephone number the log message is associated with, if any.
              example: '+12345678'
            external_connection_id:
              type: string
              example: '1293384261075731499'
              description: >-
                The external connection the log message is associated with, if
                any.
              x-format: int64
            ticket_id:
              type: string
              format: uuid
              example: 542c3bca-d247-42bc-8fe7-e01d16ecd761
              description: >-
                The ticket ID for an operation that generated the log message,
                if any.
    external-voice-integrations_PaginationMeta:
      title: Pagination Meta
      type: object
      properties:
        total_pages:
          type: integer
          example: 3
        total_results:
          type: integer
          example: 55
        page_number:
          type: integer
          example: 2
        page_size:
          type: integer
          example: 25
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````