---
title: "Check the current IP"
component: "savanna"
version: "main"
module: "rest-api"
html_url: "/savanna/main/rest-api/endpoints/check-the-current-ip"
---

[View as HTML](/savanna/main/rest-api/endpoints/check-the-current-ip)

# Check the current IP

Returns your current public IP address and whether the workgroup allow list permits it.

GET `/controller/v4/v2/workgroups/{workgroupID}/allow_list/current` 

## Authorizations

`x-api-key` string header required 

Authorization for TigerGraph Savanna. Send the key in the `x-api-key` request header.

[Create an API key](../create-api-key.md) 

## Path parameters

[#](#parameter-workgroup-id) `workgroupID` string path required 

Workgroup ID

## Response

200 

200 500 

application/json 

[#](#response-200-error) `Error` boolean 

Indicates whether the request returned an error.

[#](#response-200-error-details) `ErrorDetails` object\[\] 

Details about each error returned by the request.

Show child attributes Hide child attributes 

`FieldName`string

Field associated with the error.

`Reason`string

Explanation of why the error occurred.

`Type`string

Category of the error.

Available options: `Internal-Error`, `Bad-Request`, `Not-Found`, `Forbidden`, `Unauthorized`, `API-Disabled`, `Quota-Exceed`, `Unknown`

[#](#response-200-message) `Message` string 

Human-readable summary of the request result.

[#](#response-200-request-id) `RequestID` string 

Unique identifier for tracing the request.

[#](#response-200-result) `Result` object 

Payload returned by the request.

Show child attributes Hide child attributes 

` IsAllowed`boolean

`CurrentIP`string

[#](#response-500-error) `Error` boolean 

Indicates whether the request returned an error.

[#](#response-500-error-details) `ErrorDetails` object\[\] 

Details about each error returned by the request.

Show child attributes Hide child attributes 

`FieldName`string

Field associated with the error.

`Reason`string

Explanation of why the error occurred.

`Type`string

Category of the error.

Available options: `Internal-Error`, `Bad-Request`, `Not-Found`, `Forbidden`, `Unauthorized`, `API-Disabled`, `Quota-Exceed`, `Unknown`

[#](#response-500-message) `Message` string 

Human-readable summary of the request result.

[#](#response-500-request-id) `RequestID` string 

Unique identifier for tracing the request.

[#](#response-500-result) `Result` string 

Payload returned by the request.

Check the current IP 

cURL 

cURL Python JavaScript PHP Go Java Ruby 

```bash
curl --request GET \
  --url 'https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current' \
  --header 'x-api-key: <your-api-key>'
```

```python
import requests

url = "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current"
headers = {"x-api-key": "<your-api-key>"}
response = requests.get(url, headers=headers)
print(response.json())
```

```javascript
const response = await fetch(
  "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current",
  {
    method: "GET",
    headers: { "x-api-key": "<your-api-key>" },
  }
)
console.log(await response.json())
```

```php
<?php
$request = curl_init(
  "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current"
);
curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($request, CURLOPT_HTTPHEADER, [
  "x-api-key: <your-api-key>"
]);
curl_exec($request);
```

```go
request, _ := http.NewRequest(
  "GET",
  "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current",
  nil,
)
request.Header.Add("x-api-key", "<your-api-key>")
response, _ := http.DefaultClient.Do(request)
```

```java
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create(
    "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current"
  ))
  .header("x-api-key", "<your-api-key>")
  .GET()
  .build();
```

```ruby
uri = URI(
  "https://api.tgcloud.io/controller/v4/v2/workgroups/{workgroupID}/allow_list/current"
)
request = Net::HTTP::Get.new(uri)
request["x-api-key"] = "<your-api-key>"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) {
  |http| http.request(request)
}
```

200 500 

```json
{
  "Error": false,
  "ErrorDetails": [],
  "Message": "<string>",
  "RequestID": "<string>",
  "Result": {
    " IsAllowed": false,
    "CurrentIP": "<string>"
  }
}
```

```json
{
  "Error": true,
  "ErrorDetails": [
    {
      "FieldName": "<string>",
      "Reason": "<string>",
      "Type": "Internal-Error"
    }
  ],
  "Message": "<string>",
  "RequestID": "<string>"
}
```
