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

# Create a porting related report

> Generate reports about porting operations.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/porting-events.yml post /porting/reports
openapi: 3.1.0
info:
  title: Telnyx Porting Events API
  version: 2.0.0
  description: API for porting events and reports.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /porting/reports:
    post:
      tags:
        - Porting Orders
      summary: Create a porting related report
      description: Generate reports about porting operations.
      operationId: CreatePortingReport
      requestBody:
        $ref: '#/components/requestBodies/CreatePortingReport'
      responses:
        '201':
          $ref: '#/components/responses/CreatePortingReport'
        '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 report = await client.porting.reports.create({
              params: { filters: {} },
              report_type: 'export_porting_orders_csv',
            });

            console.log(report.data);
        - 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
            )
            report = client.porting.reports.create(
                params={
                    "filters": {}
                },
                report_type="export_porting_orders_csv",
            )
            print(report.data)
        - 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\treport, err := client.Porting.Reports.New(context.TODO(), telnyx.PortingReportNewParams{\n\t\tParams: telnyx.ExportPortingOrdersCsvReportParam{\n\t\t\tFilters: telnyx.ExportPortingOrdersCsvReportFiltersParam{},\n\t\t},\n\t\tReportType: telnyx.PortingReportNewParamsReportTypeExportPortingOrdersCsv,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", report.Data)\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.porting.reports.ExportPortingOrdersCsvReport;

            import com.telnyx.sdk.models.porting.reports.ReportCreateParams;

            import com.telnyx.sdk.models.porting.reports.ReportCreateResponse;


            public final class Main {
                private Main() {}

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

                    ReportCreateParams params = ReportCreateParams.builder()
                        .params(ExportPortingOrdersCsvReport.builder()
                            .filters(ExportPortingOrdersCsvReport.Filters.builder().build())
                            .build())
                        .reportType(ReportCreateParams.ReportType.EXPORT_PORTING_ORDERS_CSV)
                        .build();
                    ReportCreateResponse report = client.porting().reports().create(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            report = telnyx.porting.reports.create(params: {filters: {}},
            report_type: :export_porting_orders_csv)


            puts(report)
        - lang: CLI
          source: |-
            telnyx porting:reports create \
              --api-key 'My API Key' \
              --params '{filters: {}}' \
              --report-type export_porting_orders_csv
components:
  requestBodies:
    CreatePortingReport:
      required: true
      content:
        application/json:
          schema:
            type: object
            description: The parameters for generating a new porting related report.
            required:
              - report_type
              - params
            properties:
              report_type:
                type: string
                description: Identifies the type of report
                enum:
                  - export_porting_orders_csv
                example: export_porting_orders_csv
              params:
                oneOf:
                  - $ref: '#/components/schemas/ExportPortingOrdersCSVReport'
  responses:
    CreatePortingReport:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/PortingReport'
  schemas:
    ExportPortingOrdersCSVReport:
      description: The parameters for generating a porting orders CSV report.
      type: object
      required:
        - filters
      properties:
        filters:
          type: object
          description: The filters to apply to the export porting order CSV report.
          properties:
            status__in:
              type: array
              description: The status of the porting orders to include in the report.
              items:
                type: string
                enum:
                  - draft
                  - in-process
                  - submitted
                  - exception
                  - foc-date-confirmed
                  - cancel-pending
                  - ported
                  - cancelled
            customer_reference__in:
              type: array
              description: >-
                The customer reference of the porting orders to include in the
                report.
              items:
                type: string
                example: my-customer-reference
            created_at__lt:
              type: string
              description: The date and time the porting order was created before.
              format: date-time
            created_at__gt:
              type: string
              description: The date and time the porting order was created after.
              format: date-time
    PortingReport:
      type: object
      properties:
        id:
          type: string
          description: Uniquely identifies the report.
          format: uuid
          example: eef3340b-8903-4466-b445-89b697315a3a
        report_type:
          type: string
          description: Identifies the type of report
          enum:
            - export_porting_orders_csv
          example: export_porting_orders_csv
        status:
          type: string
          description: The current status of the report generation.
          enum:
            - pending
            - completed
          example: completed
        params:
          oneOf:
            - $ref: '#/components/schemas/ExportPortingOrdersCSVReport'
        document_id:
          type: string
          format: uuid
          description: >-
            Identifies the document that was uploaded when report was generated.
            This field is only populated when the report is under completed
            status.
          example: f1486bae-f067-460c-ad43-73a92848f902
        record_type:
          type: string
          example: porting_report
          description: Identifies the type of the resource.
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2021-03-19T10:07:15.527000Z'
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2021-03-19T10:07:15.527000Z'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````