# Find toll-free numbers GET https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{IsoCountry}/TollFree Search for toll-free AvailablePhoneNumbers. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Numbers_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space). Reference: https://signalwire.com/docs/compatibility-api/rest/available-phone-numbers/search-toll-free-available-phone-numbers ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: compatibility version: 1.0.0 paths: /Accounts/{AccountSid}/AvailablePhoneNumbers/{IsoCountry}/TollFree: get: operationId: search-toll-free-available-phone-numbers summary: Find toll-free numbers description: >- Search for toll-free AvailablePhoneNumbers. #### Permissions The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Numbers_. [Learn more about API scopes](/docs/platform/your-signalwire-api-space). tags: - subpackage_availablePhoneNumbers parameters: - name: AccountSid in: path description: The Project ID that uniquely identifies the Account to retrieve. required: true schema: type: string format: uuid - name: IsoCountry in: path description: The ISO country code of the number. required: true schema: type: string - name: AreaCode in: query description: >- Find numbers in the provided area code. Only available for numbers in US and Canada. required: false schema: type: string - name: Beta in: query description: New numbers on SignalWire are marked as `beta`. required: false schema: type: boolean - name: Contains in: query description: >- Find numbers based off of a pattern. Valid characters are `[0-9a-zA-Z]`. required: false schema: type: string - name: ExcludeAllAddressRequired in: query description: Accepted for Twilio compatibility but has no effect on the response. required: false schema: type: boolean - name: ExcludeForeignAddressRequired in: query description: Accepted for Twilio compatibility but has no effect on the response. required: false schema: type: boolean - name: ExcludeLocalAddressRequired in: query description: Accepted for Twilio compatibility but has no effect on the response. required: false schema: type: boolean - name: FaxEnabled in: query description: Not supported. Accepted for Twilio API compatibility. required: false schema: type: boolean - name: InLocality in: query description: Limits search to a city/locality. Requires InRegion to also be set. required: false schema: type: string - name: InRegion in: query description: >- Limits search to same region as number. Must be a two-letter state/province code. required: false schema: type: string - name: MmsEnabled in: query description: Not supported. Accepted for Twilio API compatibility. required: false schema: type: boolean - name: SmsEnabled in: query description: Not supported. Accepted for Twilio API compatibility. required: false schema: type: boolean - name: VoiceEnabled in: query description: Not supported. Accepted for Twilio API compatibility. required: false schema: type: boolean - name: Authorization in: header description: >- SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` required: true schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/AvailablePhoneNumberListResponse' '400': description: >- The request was invalid or cannot be processed. Check the error details for more information. content: application/json: schema: $ref: '#/components/schemas/CompatibilityErrorResponse' '401': description: Authentication failed. Please verify your credentials and try again. content: application/json: schema: $ref: '#/components/schemas/CompatibilityErrorResponse' '422': description: >- The request could not be processed due to validation errors. Check the error details for more information. content: application/json: schema: $ref: '#/components/schemas/CompatibilityErrorResponse' servers: - url: https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01 components: schemas: PhoneNumberCapabilities: type: object properties: voice: type: boolean description: Whether or not voice is enabled on the number. SMS: type: boolean description: Whether or not SMS is enabled on the number. MMS: type: boolean description: Whether or not MMS is enabled on the number. required: - voice - SMS - MMS description: Phone number capabilities. title: PhoneNumberCapabilities AvailablePhoneNumber: type: object properties: friendly_name: type: string description: A formatted version of the number. phone_number: type: string description: The number in E.164 format. lata: type: - string - 'null' description: The LATA of the number. Always null. locality: type: - string - 'null' description: The locality/city of the number. Always null. rate_center: type: - string - 'null' description: >- The rate center of the number. Only available for numbers in US and Canada. latitude: type: - string - 'null' description: The latitude of the number. Always null. longitude: type: - string - 'null' description: The longitude of the number. Always null. region: type: - string - 'null' description: >- The state or province abbreviation of the number. Only available for numbers in US and Canada. postal_code: type: - string - 'null' description: The postal/zip code of the number. Always null. iso_country: type: string description: The ISO country code of the number. capabilities: $ref: '#/components/schemas/PhoneNumberCapabilities' description: Whether or not a number can receive calls and messages. beta: type: boolean description: Always `false`. Included for Twilio API compatibility. required: - friendly_name - phone_number - lata - locality - rate_center - latitude - longitude - region - postal_code - iso_country - capabilities - beta description: Available phone number model. title: AvailablePhoneNumber AvailablePhoneNumberListResponse: type: object properties: uri: type: string description: The URI for the API call. available_phone_numbers: type: array items: $ref: '#/components/schemas/AvailablePhoneNumber' description: List of available phone numbers. required: - uri - available_phone_numbers description: Response containing a list of available phone numbers. title: AvailablePhoneNumberListResponse CompatibilityErrorResponse: type: object properties: code: type: integer description: Error code. message: type: string description: Error message. more_info: type: string description: URL for more information about the error. status: type: integer description: HTTP status code. required: - code - message - more_info - status description: Error response model. title: CompatibilityErrorResponse securitySchemes: SignalWireBasicAuth: type: http scheme: basic description: >- SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` ``` ## SDK Code Examples ```python import requests url = "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree" headers = {"Authorization": "Basic :"} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree'; const options = {method: 'GET', headers: {Authorization: 'Basic :'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Basic :") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Basic :' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree") .header("Authorization", "Basic :") .asString(); ``` ```php request('GET', 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree', [ 'headers' => [ 'Authorization' => 'Basic :', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Basic :"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Basic :"] let request = NSMutableURLRequest(url: NSURL(string: "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/AvailablePhoneNumbers/IsoCountry/TollFree")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```