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

# Check hosted messaging eligibility



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging/hosted-numbers.yml post /messaging_hosted_number_orders/eligibility_numbers_check
openapi: 3.1.0
info:
  title: Telnyx Messaging Hosted Numbers API
  version: 2.0.0
  description: API for messaging hosted number orders.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /messaging_hosted_number_orders/eligibility_numbers_check:
    post:
      tags:
        - Hosted Numbers
      summary: Check hosted messaging eligibility
      operationId: CheckEligibilityNumbers
      requestBody:
        description: Phone numbers to check eligibility
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EligibilityNumbersRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EligibilityNumbersResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/messaging_Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/messaging_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.messagingHostedNumberOrders.checkEligibility({
              phone_numbers: ['string'],
            });


            console.log(response.phone_numbers);
        - 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.messaging_hosted_number_orders.check_eligibility(
                phone_numbers=["string"],
            )
            print(response.phone_numbers)
        - 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.MessagingHostedNumberOrders.CheckEligibility(context.TODO(), telnyx.MessagingHostedNumberOrderCheckEligibilityParams{\n\t\tPhoneNumbers: []string{\"string\"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.PhoneNumbers)\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.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityParams;

            import
            com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityResponse;


            public final class Main {
                private Main() {}

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

                    MessagingHostedNumberOrderCheckEligibilityParams params = MessagingHostedNumberOrderCheckEligibilityParams.builder()
                        .addPhoneNumber("string")
                        .build();
                    MessagingHostedNumberOrderCheckEligibilityResponse response = client.messagingHostedNumberOrders().checkEligibility(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response =
            telnyx.messaging_hosted_number_orders.check_eligibility(phone_numbers:
            ["string"])


            puts(response)
        - lang: CLI
          source: |-
            telnyx messaging-hosted-number-orders check-eligibility \
              --api-key 'My API Key' \
              --phone-number string
components:
  schemas:
    EligibilityNumbersRequest:
      type: object
      properties:
        phone_numbers:
          type: array
          items:
            type: string
            x-format: +E.164
            description: Phone number to check eligibility
          description: List of phone numbers to check eligibility
      required:
        - phone_numbers
    EligibilityNumbersResponse:
      type: object
      properties:
        phone_numbers:
          type: array
          items:
            $ref: '#/components/schemas/EligibilityNumberResponse'
          description: List of phone numbers with their eligibility status.
    messaging_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
    EligibilityNumberResponse:
      type: object
      properties:
        detail:
          type: string
          description: Detailed information about the eligibility status.
        phone_number:
          type: string
          description: The phone number in e164 format.
        eligible:
          type: boolean
          description: Whether the phone number is eligible for hosted messaging.
        eligible_status:
          type: string
          description: The eligibility status of the phone number.
          enum:
            - NUMBER_CAN_NOT_BE_REPEATED
            - NUMBER_CAN_NOT_BE_VALIDATED
            - NUMBER_CAN_NOT_BE_WIRELESS
            - NUMBER_CAN_NOT_BE_ACTIVE_IN_YOUR_ACCOUNT
            - NUMBER_CAN_NOT_HOSTED_WITH_A_TELNYX_SUBSCRIBER
            - NUMBER_CAN_NOT_BE_IN_TELNYX
            - NUMBER_IS_NOT_A_US_NUMBER
            - NUMBER_IS_NOT_A_VALID_ROUTING_NUMBER
            - NUMBER_IS_NOT_IN_E164_FORMAT
            - BILLING_ACCOUNT_CHECK_FAILED
            - BILLING_ACCOUNT_IS_ABOLISHED
            - ELIGIBLE
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````