> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# Retrieve geographic permissions

GET https://%7BYour_Space_Name%7D.signalwire.com/api/space/geographic_permissions

Returns the countries the space has selected for international traffic, together with
the countries it may select. The selection is read from the billing service, so the
response is `502` when that service is unavailable.

#### Permissions

Authenticate with a [Personal access token](/docs/apis/authorization#personal-access-tokens) whose holder is an owner or admin of the space. A project API token is not accepted on this endpoint, and a Personal access token has no scopes: the holder's role in the space is the whole authorization decision.

Reference: https://signalwire.com/docs/apis/rest/space/get-geographic-permissions

## Authentication

- `Authorization` header (basic auth, required) — Personal access token authentication for space-wide administration. Send HTTP Basic auth with an empty username and the Personal access token as the password. A Personal access token carries your own authority rather than a project's: it is created from your user menu in the Dashboard, is prefixed `pat_`, and has no scopes. The holder must be an owner or admin of the space named by the subdomain, and the token acts only on that space. Example: ``` Authorization: Basic base64(:pat_...) ```

## Response

### 200

The request has succeeded.

- `type` (enum, required) — The object type. Always `geographic_permission`.
  - Allowed values: `geographic_permission`
- `countries` (list of string, required) — The selected ISO 3166-1 alpha-2 country codes.
- `supported_countries` (list of string, required) — The ISO 3166-1 alpha-2 country codes that may be selected.

## Errors

### 401 Unauthorized Error

The credential is missing, unknown, or revoked; its holder is not a member of the space in the subdomain; or the member is not an owner or admin. The body is the plain text `Unauthorized`. An unverified space instead receives the JSON body `{"message": "Please validate a phone number to access your account."}` on every endpoint under `/api/space`.

- `message` (string, required) — States that a phone number must be validated for the space before it can use the API.

### 500 Internal Server Error

An internal server error occurred.

- `error` (enum, required)
  - Allowed values: `Internal Server Error`

### 502 Bad Gateway Error

An upstream billing or usage reporting service was unavailable. The body is empty; retry later.

- `any`

## Examples

**Response**

```json
{
  "type": "geographic_permission",
  "countries": [
    "US",
    "CA"
  ],
  "supported_countries": [
    "US",
    "CA",
    "GB"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/space/geographic_permissions"

response = requests.get(url, auth=("<username>", "<personal_access_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/space/geographic_permissions';
const credentials = btoa("<username>:<personal_access_token>");

const options = {
  method: 'GET',
  headers: {Authorization: `Basic ${credentials}`}
};

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_name}.signalwire.com/api/space/geographic_permissions"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<personal_access_token>")

	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_name}.signalwire.com/api/space/geographic_permissions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<personal_access_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/space/geographic_permissions")
  .basicAuth("<username>", "<personal_access_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/space/geographic_permissions', [
  'headers' => [
  ],
    'auth' => ['<username>', '<personal_access_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/space/geographic_permissions");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<personal_access_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<personal_access_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/space/geographic_permissions")! 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()
```