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

# Get Unused User Bundles

> Returns all user bundles that aren't in use.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/bundles.yml get /bundle_pricing/user_bundles/unused
openapi: 3.1.0
info:
  title: Telnyx Bundles API
  version: 2.0.0
  description: API for Bundles.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /bundle_pricing/user_bundles/unused:
    get:
      tags:
        - User Bundles
      summary: Get Unused User Bundles
      description: Returns all user bundles that aren't in use.
      operationId: GetUnusedUserBundles
      parameters:
        - $ref: '#/components/parameters/bundle-pricing_FilterConsolidated'
        - $ref: '#/components/parameters/AuthorizationBearer'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnusedUserBundlesResponse'
        '400':
          $ref: '#/components/responses/bundle-pricing_BadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        default:
          $ref: '#/components/responses/bundle-pricing_GenericErrorResponse'
      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.bundlePricing.userBundles.listUnused();


            console.log(response.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
            )
            response = client.bundle_pricing.user_bundles.list_unused()
            print(response.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\tresponse, err := client.BundlePricing.UserBundles.ListUnused(context.TODO(), telnyx.BundlePricingUserBundleListUnusedParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.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.bundlepricing.userbundles.UserBundleListUnusedParams;

            import
            com.telnyx.sdk.models.bundlepricing.userbundles.UserBundleListUnusedResponse;


            public final class Main {
                private Main() {}

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

                    UserBundleListUnusedResponse response = client.bundlePricing().userBundles().listUnused();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.bundle_pricing.user_bundles.list_unused

            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->bundlePricing->userBundles->listUnused(
                filter: ['countryISO' => ['US'], 'resource' => ['+15617819942']],
                authorizationBearer: 'authorization_bearer',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx bundle-pricing:user-bundles list-unused \
              --api-key 'My API Key'
components:
  parameters:
    bundle-pricing_FilterConsolidated:
      name: filter
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated filter parameter (deepObject style). Supports filtering by
        country_iso and resource. Examples: filter[country_iso]=US or
        filter[resource]=+15617819942
      schema:
        type: object
        properties:
          country_iso:
            title: Filter[Country Iso]
            type: array
            items:
              type: string
              example: US
            description: Filter by country code.
          resource:
            title: Filter[Resource]
            type: array
            items:
              type: string
              description: Filter by resource.
              example: '+15617819942'
            description: Filter by resource.
    AuthorizationBearer:
      name: authorization_bearer
      in: header
      schema:
        type: string
        description: Authenticates the request with your Telnyx API V2 KEY
      description: 'Format: Bearer <TOKEN>'
  schemas:
    UnusedUserBundlesResponse:
      title: UnusedUserBundlesResponse
      required:
        - data
      type: object
      properties:
        data:
          title: Data
          type: array
          items:
            $ref: '#/components/schemas/UnusedUserBundlesSchema'
    UnusedUserBundlesSchema:
      title: UnusedUserBundlesSchema
      required:
        - billing_bundle
        - user_bundle_ids
      type: object
      properties:
        billing_bundle:
          $ref: '#/components/schemas/BillingBundleSummary'
        user_bundle_ids:
          title: User Bundle Ids
          type: array
          items:
            type: string
            format: uuid
          description: List of user bundle IDs for given bundle.
          example:
            - 1e650b96-4c6a-4d6f-b8ed-87c3fcacf595
            - 53beb701-1231-4548-8abf-c802f38b14aa
    BillingBundleSummary:
      title: BillingBundleSummary
      required:
        - id
        - name
        - cost_code
        - is_public
        - created_at
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          example: 7ecd040e-6bac-4139-9160-3c0427d98fea
          description: Bundle's ID, this is used to identify the bundle in the API.
        name:
          title: Name
          type: string
          example: Australia Basic
          description: Bundle's name, this is used to identify the bundle in the UI.
        slug:
          title: Slug
          type: string
          example: basic-au-e4f8
          description: Slugified version of the bundle's name.
        cost_code:
          title: Cost Code
          type: string
          example: BUNDLE-PRICING-BASIC-MRC
          description: >-
            Bundle's cost code, this is used to identify the bundle in the
            billing system.
        is_public:
          title: Is Public
          type: boolean
          description: Available to all customers or only to specific customers.
        created_at:
          title: Created At
          type: string
          format: date
          description: Date the bundle was created.
        mrc_price:
          title: Mrc Price
          type: number
          format: float
          example: 2
          description: Monthly recurring charge price.
        currency:
          title: Currency
          type: string
          example: USD
          description: Bundle's currency code.
        specs:
          title: Specs
          type: array
          items:
            type: string
          example:
            - 1 AU Number
            - Emergency Calling
            - All inbound and outbound calling billed pay-as-you-go
  responses:
    bundle-pricing_BadRequestErrorResponse:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
    UnauthorizedErrorResponse:
      description: Authentication required or invalid credentials
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
    bundle-pricing_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````