> ## 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.

# Preview the LOA configuration parameters

> Preview the LOA template that would be generated without need to create LOA configuration.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/porting-documents.yml post /porting/loa_configurations/preview
openapi: 3.1.0
info:
  title: Telnyx Porting Documents API
  version: 2.0.0
  description: API for LOA configurations, templates, and additional documents.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /porting/loa_configurations/preview:
    post:
      tags:
        - Porting Orders
      summary: Preview the LOA configuration parameters
      description: >-
        Preview the LOA template that would be generated without need to create
        LOA configuration.
      operationId: PreviewLoaConfigurationParams
      requestBody:
        $ref: '#/components/requestBodies/CreatePortingLOAConfiguration'
      responses:
        '200':
          $ref: '#/components/responses/DownloadLOATemplate'
        '422':
          description: Unprocessable entity. Check message field in response for details.
        '500':
          description: Internal server error
      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
            });

            const response = await client.porting.loaConfigurations.preview({
              address: {
                city: 'Austin',
                country_code: 'US',
                state: 'TX',
                street_address: '600 Congress Avenue',
                zip_code: '78701',
              },
              company_name: 'Telnyx',
              contact: { email: 'testing@telnyx.com', phone_number: '+12003270001' },
              logo: { document_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
              name: 'My LOA Configuration',
            });

            console.log(response);

            const content = await response.blob();
            console.log(content);
        - 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
            )
            response = client.porting.loa_configurations.preview(
                address={
                    "city": "Austin",
                    "country_code": "US",
                    "state": "TX",
                    "street_address": "600 Congress Avenue",
                    "zip_code": "78701",
                },
                company_name="Telnyx",
                contact={
                    "email": "testing@telnyx.com",
                    "phone_number": "+12003270001",
                },
                logo={
                    "document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
                },
                name="My LOA Configuration",
            )
            print(response)
            content = response.read()
            print(content)
        - 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\tresponse, err := client.Porting.LoaConfigurations.Preview(context.TODO(), telnyx.PortingLoaConfigurationPreviewParams{\n\t\tAddress: telnyx.PortingLoaConfigurationPreviewParamsAddress{\n\t\t\tCity:          \"Austin\",\n\t\t\tCountryCode:   \"US\",\n\t\t\tState:         \"TX\",\n\t\t\tStreetAddress: \"600 Congress Avenue\",\n\t\t\tZipCode:       \"78701\",\n\t\t},\n\t\tCompanyName: \"Telnyx\",\n\t\tContact: telnyx.PortingLoaConfigurationPreviewParamsContact{\n\t\t\tEmail:       \"testing@telnyx.com\",\n\t\t\tPhoneNumber: \"+12003270001\",\n\t\t},\n\t\tLogo: telnyx.PortingLoaConfigurationPreviewParamsLogo{\n\t\t\tDocumentID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\n\t\tName: \"My LOA Configuration\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\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.core.http.HttpResponse;

            import
            com.telnyx.sdk.models.porting.loaconfigurations.LoaConfigurationPreviewParams;


            public final class Main {
                private Main() {}

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

                    LoaConfigurationPreviewParams params = LoaConfigurationPreviewParams.builder()
                        .address(LoaConfigurationPreviewParams.Address.builder()
                            .city("Austin")
                            .countryCode("US")
                            .state("TX")
                            .streetAddress("600 Congress Avenue")
                            .zipCode("78701")
                            .build())
                        .companyName("Telnyx")
                        .contact(LoaConfigurationPreviewParams.Contact.builder()
                            .email("testing@telnyx.com")
                            .phoneNumber("+12003270001")
                            .build())
                        .logo(LoaConfigurationPreviewParams.Logo.builder()
                            .documentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                            .build())
                        .name("My LOA Configuration")
                        .build();
                    HttpResponse response = client.porting().loaConfigurations().preview(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.porting.loa_configurations.preview(
              address: {city: "Austin", country_code: "US", state: "TX", street_address: "600 Congress Avenue", zip_code: "78701"},
              company_name: "Telnyx",
              contact: {email: "testing@telnyx.com", phone_number: "+12003270001"},
              logo: {document_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"},
              name: "My LOA Configuration"
            )

            puts(response)
        - 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 {
              $response = $client->porting->loaConfigurations->preview(
                address: [
                  'city' => 'Austin',
                  'countryCode' => 'US',
                  'state' => 'TX',
                  'streetAddress' => '600 Congress Avenue',
                  'zipCode' => '78701',
                  'extendedAddress' => '14th Floor',
                ],
                companyName: 'Telnyx',
                contact: ['email' => 'testing@telnyx.com', 'phoneNumber' => '+12003270001'],
                logo: ['documentID' => '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],
                name: 'My LOA Configuration',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx porting:loa-configurations preview \
              --api-key 'My API Key' \
              --address "{city: Austin, country_code: US, state: TX, street_address: 600 Congress Avenue, zip_code: '78701'}" \
              --company-name Telnyx \
              --contact "{email: testing@telnyx.com, phone_number: '+12003270001'}" \
              --logo '{document_id: 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e}' \
              --name 'My LOA Configuration'
components:
  requestBodies:
    CreatePortingLOAConfiguration:
      required: true
      content:
        application/json:
          schema:
            type: object
            description: The parameters for creating a new LOA configuration.
            required:
              - name
              - logo
              - company_name
              - address
              - contact
            properties:
              name:
                type: string
                description: The name of the LOA configuration
                example: My LOA Configuration
              logo:
                type: object
                description: The logo of the LOA configuration
                required:
                  - document_id
                properties:
                  document_id:
                    type: string
                    description: The document identification
                    format: uuid
              company_name:
                type: string
                description: The name of the company
                example: Telnyx
              address:
                type: object
                description: The address of the company.
                required:
                  - street_address
                  - city
                  - state
                  - zip_code
                  - country_code
                properties:
                  street_address:
                    type: string
                    description: The street address of the company
                    example: 600 Congress Avenue
                  extended_address:
                    type: string
                    description: The extended address of the company
                    example: 14th Floor
                  city:
                    type: string
                    description: The locality of the company
                    example: Austin
                  state:
                    type: string
                    description: The administrative area of the company
                    example: TX
                    pattern: ^[A-Z]{2}$
                  zip_code:
                    type: string
                    description: The postal code of the company
                    example: '78701'
                    pattern: ^[0-9]{5}(?:-[0-9]{4})?$
                  country_code:
                    type: string
                    description: The country code of the company
                    example: US
                    pattern: ^[A-Z]{2}$
              contact:
                type: object
                description: The contact information of the company.
                required:
                  - email
                  - phone_number
                properties:
                  email:
                    type: string
                    description: The email address of the contact
                    example: testing@telnyx.com
                  phone_number:
                    type: string
                    description: The phone number of the contact
                    example: '+12003270001'
                    pattern: ^\+\d{11,15}$
  responses:
    DownloadLOATemplate:
      description: Successful response
      content:
        application/pdf:
          schema:
            type: string
            format: binary
            example: '%PDF-1.4...'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````