openapi: 3.0.0
info:
  title: Numbers
  description: >-
    API endpoints for managing dedicated numbers as sender IDs for messaging
    services.
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    pagination:
      type: object
      properties:
        total:
          type: integer
          description: The total number of items available for viewing.
          example: 2
        per_page:
          type: integer
          description: >-
            The number of items returned per page. This is specified in the
            limit parameter. You can have 100 items at maximum, and 15 at
            minimum.
          example: 15
        current_page:
          type: integer
          description: The current page number.
          example: 1
        last_page:
          type: integer
          description: The last page number.
          example: 1
        next_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the next page. It will return **null** if there’s no next
            page.
          example: null
        prev_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the previous page. It will return **null** if there’s no
            previous page.
          example: null
        from:
          type: integer
          description: The number of the first result in the current page.
          example: 1
        to:
          type: integer
          description: The number of the last result in the current page.
          example: 2
    view-your-numbers:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are you dedicated numbers.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      dedicated_number:
                        type: string
                        description: The dedicated number.
                        example: '+61411111111'
                      country:
                        type: string
                        description: The country.
                        example: AU
                      price:
                        type: string
                        description: The price.
                        example: '18.59'
                      _country_name:
                        type: string
                        description: The country name.
                        example: Australia
                      notes:
                        type: string
                        description: Optional notes about the number.
                        nullable: true
                        example: Business line
                      type:
                        type: string
                        description: The type of messages this number can send.
                        example: sms
                      number_type:
                        type: string
                        description: The classification of the number.
                        example: longcode
                      number_category:
                        type: string
                        nullable: true
                        description: The category of the number.
                        example: null
                      number_guid:
                        type: string
                        description: Unique identifier for the number.
                        example: 60744953-781E-463C-A7FF-F194228674BB
                      form_submission_id:
                        type: string
                        nullable: true
                        description: ID of any associated form submission.
                        example: null
                      status:
                        type: object
                        description: The registration status of the number.
                        properties:
                          value:
                            type: integer
                            description: >
                              Numeric status code (0-5):

                              - 0: Your number is ready to go.

                              - 1: Your number is unregistered. You will not be
                              able to send messages to certain countries.

                              - 2: Your number registration is in progress.
                              Email updates will follow.

                              - 3: Action required on your number registration.
                              Please resolve to start using it.

                              - 4: You can send to all countries but may get
                              restricted to some before full registration.

                              - 5: Your number is registered and you can start
                              using it immediately.
                            enum:
                              - 0
                              - 1
                              - 2
                              - 3
                              - 4
                              - 5
                            example: 0
                          label:
                            type: string
                            description: >-
                              Status label identifier corresponding to the
                              numeric value above, following the same order.
                            enum:
                              - REGISTRATION_NOT_REQUIRED
                              - REGISTRATION_NOT_INITIATED
                              - REGISTRATION_INITIATED
                              - CUST_ACTION_REQUIRED
                              - REGISTRATION_SUBMITTED
                              - REGISTERED
                            example: REGISTRATION_NOT_REQUIRED
                          description:
                            type: string
                            description: Human readable description of the status.
                            example: Your number is ready to go.
                          name:
                            type: string
                            description: >-
                              Display name for the status corresponding to the
                              numeric value above, following the same order.
                            enum:
                              - Ready to use
                              - Unregistered
                              - Decision Pending
                              - Action Required
                              - Limited Availability
                              - Registered
                            example: Ready to use
                  example:
                    - dedicated_number: '+61411111111'
                      country: AU
                      price: '18.59'
                      _country_name: Australia
                      notes: null
                      type: sms
                      number_type: longcode
                      number_category: null
                      number_guid: 60744953-781E-463C-A7FF-F194228674BB
                      form_submission_id: null
                      status:
                        value: 0
                        label: REGISTRATION_NOT_REQUIRED
                        description: Your number is ready to go.
                        name: Ready to use
                    - dedicated_number: '+61422222222'
                      country: AU
                      price: '20.99'
                      _country_name: Australia
                      notes: Business line
                      type: mms
                      number_type: longcode
                      number_category: null
                      number_guid: 83955064-892F-574D-B8GG-G2053339785CC
                      form_submission_id: null
                      status:
                        value: 1
                        label: REGISTRATION_NOT_INITIATED
                        description: >-
                          Your number is unregistered. You will not be able to
                          send messages to certain countries.
                        name: Unregistered
    currency:
      type: object
      description: The parameters related to currency.
      properties:
        currency_name_short:
          type: string
          description: >-
            The currency used for the sender in three-letter format (e.g. USD,
            EUR, AUD, NZD, etc).
          example: AUD
        currency_prefix_d:
          type: string
          description: >-
            The symbol used to indicate the currency of the sender (e.g. $ , €,
            etc).
          example: $
        currency_prefix_c:
          type: string
          description: The currency basic unit (e.g. cents).
          example: c
        currency_name_long:
          type: string
          description: The full name of the currency.
          example: Australian Dollars
    purchase-dedicated-number:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your new number.
        data:
          type: object
          properties:
            dedicated_number:
              type: string
              description: The new dedicated number.
              example: '+12282060576'
            country:
              type: string
              description: The country code of the new dedicated number.
              example: US
            price_total:
              type: string
              description: The total price of the new dedicated number.
              example: '8.98'
            _price_setup:
              type: string
              description: The setup price of the new dedicated number.
              example: '22.22'
            _price_monthly:
              type: string
              description: The monthly price of the new dedicated number.
              example: '11.11'
            _currency:
              $ref: '#/components/schemas/currency'
          example:
            dedicated_number: '+12282060576'
            country: US
            price_total: '8.98'
            _price_setup: '22.22'
            _price_monthly: '11.11'
            _currency:
              currency_name_short: USD
              currency_prefix_d: $
              currency_prefix_c: ¢
              currency_name_long: US Dollar
    view-available-numbers:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are some numbers.
        data:
          type: array
          items:
            type: object
            properties:
              country:
                type: string
                description: The country code of the number.
              country_name:
                type: string
                description: The country name of the number.
              dedicated_number:
                type: string
                description: The dedicated number.
              price_setup:
                type: string
                description: The setup price of the number.
              price_monthly:
                type: string
                description: The monthly price of the number.
              price_total:
                type: string
                description: The total price of the number.
              address_requirement:
                type: string
                description: >-
                  The address requirement for the number.  <br> `local`:
                  requires an address that corresponds  to the phone number's
                  prefix.
                nullable: true
          example:
            - country: AU
              country_name: Australia
              dedicated_number: '+61280662298'
              price_setup: '0.0000'
              price_monthly: '20.7100'
              price_total: '20.7100'
              address_requirement: local
            - country: AU
              country_name: Australia
              dedicated_number: '+61280662299'
              price_setup: '0.0000'
              price_monthly: '20.7100'
              price_total: '20.7100'
              address_requirement: local
        _currency:
          $ref: '#/components/schemas/currency'
          example:
            currency_name_short: USD
            currency_prefix_d: $
            currency_prefix_c: ¢
            currency_name_long: US Dollar
    register_numbers:
      type: object
      properties:
        http_code:
          type: integer
          description: HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: Code indicating the result of the response.
          example: SUCCESS
        response_msg:
          type: string
          description: Message providing additional information.
          example: 10DLC number registration notification sent successfully.
        data:
          type: object
          nullable: true
          example: null
      required:
        - http_code
        - response_code
        - response_msg
    400_error:
      type: object
      properties:
        http_code:
          type: integer
          description: HTTP status code of the response.
          example: 400
        response_code:
          type: string
          description: Code indicating the result of the response.
          example: BAD_REQUEST
        response_msg:
          type: string
          description: Message providing additional information.
          example: Invalid input.
        data:
          type: object
          nullable: true
          example:
            name: Name field is required.
            email: Email field is required.
      required:
        - http_code
        - response_code
        - response_msg
paths:
  /v3/numbers:
    get:
      summary: View Your Numbers
      operationId: view-your-numbers
      description: >-
        _Get all available dedicated numbers_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |

        | q | query | string | false | Filter numbers based on multiple
        criteria. The query string should be formatted as key-value pairs
        separated by commas. Available filter keys: `type`, `number_type`,
        `country` |

        | q2 | query | string | false | Filter numbers based on multiple
        criteria. The query string should be formatted as key-value pairs
        separated by commas. Available filter keys: `type` |

        | excluding_number_type | query | string | false | Exclude specific
        number types from the results. Available number types: `shortcode`,
        `tollfree`, `10DLC` |

        | exclude_10dlc_campaign | query | boolean | false | When set to true,
        excludes all numbers that are associated with 10DLC campaigns |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number
          example: '1'
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 15
            default: 15
          description: Number of records per page
          example: '100'
        - name: q
          in: query
          schema:
            type: string
          description: >
            Filter numbers based on multiple criteria. The query string should
            be formatted as key-value pairs separated by commas.

            Available filter keys:

            - `type`: Message type (e.g., `SMS`, `MMS`)

            - `number_type`: Number classification (e.g., `longcode`,
            `shortcode`, `tollfree`, `10DLC`)

            - `country`: Two-letter country code (e.g., `AU`, `US`)
          example: type:sms,number_type:longcode,country:AU
        - name: q2
          in: query
          schema:
            type: string
          example: type:mms
        - name: excluding_number_type
          in: query
          schema:
            type: string
          description: |
            Exclude specific number types from the results.
            Available number types:
            - `shortcode`
            - `tollfree`
            - `10DLC`
          example: 10DLC
        - name: exclude_10dlc_campaign
          in: query
          schema:
            type: boolean
            default: false
          description: >-
            When set to true, excludes all numbers that are associated with
            10DLC campaigns
          example: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-your-numbers'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/numbers'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\NumberApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->numbersGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling NumberApi->numbersGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var numberApi = new NumberApi(configuration);
            var response = numberApi.NumbersGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.NumberApi;

            public class view_numbers {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                NumberApi apiInstance = new NumberApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.numbersGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling NumberApi#numbersGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var numberApi = new api.NumberApi("USERNAME", "API_KEY");

            var page = 1;
            var limit = 10;

            numberApi.numbersGet(page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::NumberApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all available dedicated numbers
              result = api_instance.numbers_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling NumberApi->numbers_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all available dedicated numbers_get
                api_response = api_instance.numbers_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling NumberApi->numbers_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::NumberApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::NumberApi->new(username =>
            $username, password => $password);


            my $json_output = $api->numbers_get('page' => '1', 'limit' => '10');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSNumberApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];

            [numberApiInstance numbersGetWithPage:page limit:limit
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            NumberAPI.numbersGet(page: nil, limit: nil) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/numbers/buy/{dedicated_number}:
    post:
      summary: Purchase Dedicated Number
      operationId: purchase-dedicated-number
      description: >-
        _Buy dedicated number_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | dedicated_number | path | string | true | Phone number to purchase |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: type
          in: query
          schema:
            type: string
          example: sms
        - name: dedicated_number
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/purchase-dedicated-number'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

            'https://rest.clicksend.com/v3/numbers/buy/{dedicated_number}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\NumberApi(new
            GuzzleHttp\Client(),$config);

            $dedicated_number = "phone_number"; // string | Phone number to
            purchase


            try {
                $result = $apiInstance->numbersBuyByDedicatedNumberPost($dedicated_number);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling NumberApi->numbersBuyByDedicatedNumberPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var numberApi = new NumberApi(configuration);

            var response =
            numberApi.NumbersBuyByDedicatedNumberPost("+11231231234");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.NumberApi;

            public class buy_dedicated_number {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                NumberApi apiInstance = new NumberApi(defaultClient);
                String dedicatedNumber = "xxx-xxx-xxxx"; // String | Phone number to purchase
                try {
                    String result = apiInstance.numbersBuyByDedicatedNumberPost(dedicatedNumber);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling NumberApi#numbersBuyByDedicatedNumberPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var numberApi = new api.NumberApi("USERNAME", "API_KEY");


            var dedicatedNumber = "dedicated_number";


            numberApi.numbersBuyByDedicatedNumberPost(dedicatedNumber).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::NumberApi.new


            dedicated_number = "dedicated_number" # String | Phone number to
            purchase


            begin
              # Buy dedicated number
              result = api_instance.numbers_buy_by_dedicated_number_post(dedicated_number)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling NumberApi->numbers_buy_by_dedicated_number_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))

            dedicated_number = 'xxx-xxx-xxxx' # str | Phone number to purchase


            try:
                # Buy dedicated number
                api_response = api_instance.numbers_buy_by_dedicated_number_post(dedicated_number)
                print(api_response)
            except ApiException as e:
                print("Exception when calling NumberApi->numbers_buy_by_dedicated_number_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::NumberApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::NumberApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->numbers_buy_by_dedicated_number_post('dedicated_number'=>
            '+8615555555555');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSNumberApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];

            [numberApiInstance
            numbersBuyByDedicatedNumberPostWithDedicatedNumber:@"dedicated_number"
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            NumberAPI.numbersBuyByDedicatedNumberPost(dedicatedNumber:
            "dedicated_number") { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/numbers/search/{country}:
    get:
      summary: View Available Numbers
      operationId: view-available-numbers
      description: >-
        _Get all dedicated numbers by country_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | country | path | string | true | Country code to search |

        | search | query | string | false | Your search pattern or query. |

        | search_type | query | integer(int32) | false | Your strategy for
        searching, 0 = starts with, 1 = anywhere, 2 = ends with. |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: country
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-available-numbers'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/numbers/search/{country}'
        - lang: PHP
          source: >-
            <?php

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


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\NumberApi(new
            GuzzleHttp\Client(),$config);

            $country = "US"; // string | Country code to search

            $search = ""; // string | Your search pattern or query.

            $search_type = 56; // int | Your strategy for searching, 0 = starts
            with, 1 = anywhere, 2 = ends with.

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->numbersSearchByCountryGet($country, $search, $search_type, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling NumberApi->numbersSearchByCountryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var numberApi = new NumberApi(configuration);
            var response = numberApi.NumbersSearchByCountryGet("CA");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.NumberApi;

            public class view_available_numbers {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                NumberApi apiInstance = new NumberApi(defaultClient);
                String country = "US"; // String | Country code to search
                String search = ""; // String | Your search pattern or query.
                Integer searchType = 1; // Integer | Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with.
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.numbersSearchByCountryGet(country, search, searchType, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling NumberApi#numbersSearchByCountryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var numberApi = new api.NumberApi("USERNAME", "API_KEY");


            var country = "US";

            var search = "";

            var searchType = 1;

            var page = 1;

            var limit = 10;


            numberApi.numbersSearchByCountryGet(country, search, searchType,
            page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::NumberApi.new

            country = "US"    # String | Country code to search

            opts = {
              "search": "88",   # String | Your search pattern or query.
              "search_type": 1, # Integer | Your strategy for searching,
                              # 0 = starts with, 1 = anywhere, 2 = ends with.
              "page": 1,        # Integer | Page number
              "limit": 10       # Integer | Number of records per page
            }

            begin
              # Get all dedicated numbers by country
              result = api_instance.numbers_search_by_country_get(country, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling NumberApi->numbers_search_by_country_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))

            country = 'country_example' # str | Country code to search

            search = 'search_example' # str | Your search pattern or query.
            (optional)

            search_type = 56 # int | Your strategy for searching, 0 = starts
            with, 1 = anywhere, 2 = ends with. (optional)

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all dedicated numbers by country
                api_response = api_instance.numbers_search_by_country_get(country, search=search, search_type=search_type, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling NumberApi->numbers_search_by_country_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::NumberApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::NumberApi->new(username =>
            $username, password => $password);


            my $json_output = $api->numbers_search_by_country_get('country' =>
            'AU' ,'search' => '' ,'search_type'  => '', 'page' => '','limit' =>
            '' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSNumberApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *searchType = [[NSNumber alloc] initWithInt:1];

            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];

            [numberApiInstance numbersSearchByCountryGetWithCountry: @"country"
            search:@"search" searchType:searchType page:page limit:limit
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            NumberAPI.numbersSearchByCountryGet(country: "country", search:
            "search", searchType: nil, page: 1, limit: 15) { (dataString, error)
            in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/numbers/registrations/number-types/{number_type}/country/{country_code}:
    post:
      summary: Register Numbers
      operationId: register-numbers
      description: >-
        <div style="background-color: #e8f4ff; padding: 15px; border-radius:
        4px; border-left: 4px solid #0066cc;">

        This endpoint is currently only available for <b>Canada 10DLC</b> number
        registration.

        </div>


        Registers a number that requires additional verification information.
        This endpoint facilitates the registration process for numbers requiring
        special compliance documentation.


        After submission, ClickSend's compliance team will review the
        registration and notify you of the approval status.


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.

        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                full_name:
                  type: string
                  description: >-
                    Legal full name of the individual registering the number.
                    Must be a personal name, not a business name.
                  example: John Doe
                company_name:
                  type: string
                  description: >-
                    Legal business name of the organization requesting
                    registration
                  example: ClickSend
                email:
                  type: string
                  description: >-
                    Contact email address for registration communications and
                    notifications
                  example: john.doe@clicksend.com
                website_url:
                  type: string
                  description: Official business website URL
                  example: https://clicksend.com
                sample_message:
                  type: string
                  description: >-
                    Representative example of messages that will be sent using
                    this number
                  example: >-
                    Get 20% off on your next purchase! Visit our website for
                    details.
                primary_use_case:
                  type: string
                  description: >-
                    Primary intended purpose for the registered number (e.g.,
                    Marketing, Notifications, Authentication)
                  example: Marketing
                company_number:
                  type: string
                  description: >-
                    Official support phone number of the organization requesting
                    registration
                  example: +1-800-555-0199
                area_code:
                  type: string
                  description: >-
                    Your area codes, please provide your top 3 area codes in
                    case your 1st choice is not available
                  example: 416, 647, 905
              required:
                - full_name
                - company_name
                - email
                - website_url
                - sample_message
                - primary_use_case
                - company_number
                - area_code
              example:
                full_name: John Doe
                company_name: ClickSend
                email: john.doe@clicksend.com
                website_url: https://clicksend.com
                sample_message: >-
                  Get 20% off on your next purchase! Visit our website for
                  details.
                primary_use_case: Marketing
                company_number: +1-800-555-0199
                area_code: 416, 647, 905
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: number_type
          in: path
          required: true
          schema:
            type: string
          description: The type of number being registered
          example: 10dlc
        - name: country_code
          in: path
          required: true
          schema:
            type: string
            minLength: 2
            maxLength: 2
            pattern: ^[A-Z]{2}$
          description: Two-character ISO country code
          example: US, CA
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/register_numbers'
              example:
                http_code: 200
                response_code: SUCCESS
                response_msg: Number registration notification sent successfully.
                data: null
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400_error'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "    {
                    \"full_name\": \"John Doe\",
                    \"company_name\": \"Clicksend\",
                    \"email\": \"john.doe@clicksend.com\",
                    \"website_url\": \"https://clicksend.com\",
                    \"sample_message\": \"Get 20% off on your next purchase! Visit our website for details.\",
                    \"primary_use_case\": \"Marketing\"
                }" \
            'https://rest.clicksend.com/v3/numbers/registrations/number-types/{number_type}/country/{country_code}'
