> Toden documentation. For the full index fetch /llms.txt. Every page is available as Markdown by appending .md to its URL. Every endpoint is under /api/v1. Identity verification and Risk Intelligence are separate contracts there with different error shapes; /api/kyc and /api/identity are older prefixes that still answer the same. Never invent an endpoint, field or enum value: read the API reference page for the operation first.

# Check an IP address

POST https://sandbox-api.toden.co/api/v1/checks/ip
Content-Type: application/json

Checks one IP address on its own: the country it is in, the network that owns it, and whether it is a Tor exit, a commercial VPN provider's address, a hosting network or on a threat list.

Send `claimedCountry`, the country the person says they are in, to flag an address in another country. Send `userAgent`, the browser or app that made the request, to keep it with the result and have it summarised.

The checks run on Toden's own data, never sent to a lookup provider: MaxMind GeoLite2 for the country and network, the Tor Project's list of exit relays, X4BNet's list of commercial VPN ranges (built from IPLocate.io data) and FireHOL level 1. The lists are refreshed hourly. A list that has not loaded answers `null` for its part, never `false`.

Country is the only place an address answers reliably, so no city or coordinates are given: on a mobile network they would be the carrier's gateway, not the person.

Outside production it runs for real and is not charged, except on the test addresses, which answer with fixed facts and `testData: true`: `203.0.113.10` a mobile network in Nigeria (pass), `203.0.113.20` a VPN provider (review), `203.0.113.30` a Tor exit (fail), `203.0.113.40` on the threat list (review) and `203.0.113.50` a hosting network (review). They are in 203.0.113.0/24, which is reserved for documentation, so no real connection uses them.

Rules: send `rules` to set what each finding does (`decline` fails the check, `review` sends it to review, `approve` keeps it as a note and passes) and to change the check's settings. Anything left out takes your organisation's saved default rules (set in Spot Checks), else Toden's, which judge the check as it was judged before rules existed. `result.rules` says which rules the check ran under, where each came from and what each finding did.

Charged per check at your price (production only); a check that could not be completed is not charged. Send a `requestId`: a retry with the same value returns the same check with `replayed: true`, without running or charging again.

**Error codes**

| `error` | Status | Meaning |
|---|---|---|
| `invalid_input` | 400 | The body is missing something the check needs, or the requestId is malformed. |
| `insufficient_credits` | 402 | Your balance cannot cover the check. Nothing was run or charged. |
| `checks_unavailable` | 403 | These checks are not switched on for your organisation yet. |
| `spot_checks_disabled` | 403 | Spot checks are not enabled for your organisation. |
| `request_id_reused` | 409 | The requestId was used for a different check. |
| `check_in_progress` | 409 | A check with this requestId is still running. |
| `file_not_found` | 422 | The uploaded file was not found, is not yours, or has expired. |
| `check_unavailable` | 503 | The check cannot run on this deployment right now. Nothing was charged. |
| `secret_key_required` | 403 | A publishable key was used. This endpoint accepts secret keys only. |
| `environment_mismatch` | 403 | The key belongs to an environment this deployment does not serve. |
| `ip_not_allowed` | 403 | The key has an IP allowlist and the calling address is not on it. |
| `organization_suspended` | 403 | The organisation is suspended. The response carries `reason` and `suspendedAt`. |
| `business_not_approved` | 403 | A live key was used before the business was approved for production. |

A missing or unknown key answers `401`, where `error` is a short sentence rather than a code.

Requires a secret (`sk_`) key. A publishable key receives `403 secret_key_required`.

Reference: https://docs.toden.co/api-reference/verification/standalone-checks/create-ip-check

## Authentication

- `Authorization` header (bearer token, required) — Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set `flow.run`, `flow.config.read` and `verifications.status.read`; a scoped secret key reaches what its scopes allow.

## Servers

- `https://sandbox-api.toden.co` (Sandbox, default)
- `https://api.toden.co` (Production)

## Request

### Body (application/json)

This endpoint expects an IpCheckRequest.

- `ip` (string, required) — The IP address, IPv4 (`8.8.8.8`) or IPv6 (`2001:4860:4860::8888`).
- `claimedCountry` (string, optional) — Optional. The ISO 3166-1 alpha-2 code of the country the person says they are in, e.g. `NG`.
- `userAgent` (string, optional) — Optional. The browser or app that made the request, kept with the result.
- `externalUserId` (string, optional) — Your own reference for the check (a customer or case id), kept with it and searchable in your history.
- `rules` (IpCheckRequestRules, optional) — What each finding does. Defaults: `tor` decline; `threat`, `vpn`, `privacy_network`, `country_mismatch` and `unknown_ip` review.
- `requestId` (string, optional) — Your idempotency key, 8 to 120 characters: a retry with the same value returns the same check.

## Response

### 200

A retry: the check already run under this requestId.

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `ip`
- `outcome` (enum, required) — `pass`: nothing of concern. `review`: something a person should look at. `fail`: a clear problem. `unavailable`: the check could not be completed, was not charged, and is never a pass.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `subject` (string, required) — What was checked, as your history lists it.
- `channel` (enum, required) — Whether the check was run through the API or from the dashboard.
  - Allowed values: `api`, `dashboard`
- `createdAt` (datetime, required) — When the check was run.
- `input` (IpCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (IpCheckResult, optional, nullable) — What was found. Null when the check could not be completed.
- `failureCode` (string, optional, nullable) — Why the check could not be completed, when `outcome` is `unavailable`.
- `charged` (string, optional, nullable) — What the check cost in USD, as a decimal string. Null when nothing was charged.
- `entityId` (string, optional, nullable) — The customer record this check was saved to.
- `completedAt` (datetime, optional, nullable) — When it finished.
- `replayed` (boolean, optional) — On a run only: true when this is a check already run under the same `requestId`.

### 201

The check was run.

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `ip`
- `outcome` (enum, required) — `pass`: nothing of concern. `review`: something a person should look at. `fail`: a clear problem. `unavailable`: the check could not be completed, was not charged, and is never a pass.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `subject` (string, required) — What was checked, as your history lists it.
- `channel` (enum, required) — Whether the check was run through the API or from the dashboard.
  - Allowed values: `api`, `dashboard`
- `createdAt` (datetime, required) — When the check was run.
- `input` (IpCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (IpCheckResult, optional, nullable) — What was found. Null when the check could not be completed.
- `failureCode` (string, optional, nullable) — Why the check could not be completed, when `outcome` is `unavailable`.
- `charged` (string, optional, nullable) — What the check cost in USD, as a decimal string. Null when nothing was charged.
- `entityId` (string, optional, nullable) — The customer record this check was saved to.
- `completedAt` (datetime, optional, nullable) — When it finished.
- `replayed` (boolean, optional) — On a run only: true when this is a check already run under the same `requestId`.

## Errors

### 400 Bad Request Error

The request body, query or path was invalid.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 401 Unauthorized Error

The Authorization header is missing, or the API key is unknown or revoked.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 402 Payment Required Error

The organisation does not have enough credit for this request.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 403 Forbidden Error

The key may not call this endpoint, or the organisation may not use this feature.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 422 Unprocessable Entity Error

The request was understood but cannot be processed as sent.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 503 Service Unavailable Error

The service is temporarily unavailable.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

## Types

### IpCheckRequestRules

What each finding does. Defaults: `tor` decline; `threat`, `vpn`, `privacy_network`, `country_mismatch` and `unknown_ip` review.

- `tor` (enum, optional) — The address is a Tor exit relay.
  - Allowed values: `decline`, `review`, `approve`
- `threat` (enum, optional) — The address is on FireHOL level 1, a public list of addresses abused or attacking now.
  - Allowed values: `decline`, `review`, `approve`
- `vpn` (enum, optional) — The address is in a commercial VPN's address range.
  - Allowed values: `decline`, `review`, `approve`
- `privacy_network` (enum, optional) — The address belongs to a hosting or data centre network, where most VPNs and proxies run.
  - Allowed values: `decline`, `review`, `approve`
- `country_mismatch` (enum, optional) — The address is in another country than `claimedCountry`. Never found without one.
  - Allowed values: `decline`, `review`, `approve`
- `unknown_ip` (enum, optional) — Nothing is known of the address: a private address, or one the location data cannot place.
  - Allowed values: `decline`, `review`, `approve`

### IpCheckInput

What was sent, minimised: never image bytes, only media ids.

### IpCheckResult

What was found. Null when the check could not be completed.

- `ip` (string, required) — The address as checked: IPv4 dotted, IPv6 in lower case. An IPv4-mapped IPv6 address is checked as its IPv4.
- `version` (enum, required) — The IP version.
  - Allowed values: `4`, `6`
- `public` (boolean, required) — False for private, loopback and other reserved space, which no list speaks for.
- `network` (IpCheckResultNetwork, required) — The network that owns the address.
- `privacyNetwork` (boolean, required) — A hosting or data centre network.
- `reasons` (list of enum, required) — The findings that kept the check from passing, strongest first.
  - Allowed values: `tor`, `threat`, `vpn`, `privacy_network`, `country_mismatch`, `unknown_ip`
- `notes` (list of enum, required) — The findings your rules approved: shown, never a reason it did not pass.
  - Allowed values: `tor`, `threat`, `vpn`, `privacy_network`, `country_mismatch`, `unknown_ip`
- `country` (string, optional, nullable) — The ISO 3166-1 alpha-2 code of the country the address is in.
- `countryName` (string, optional, nullable) — That country's name in English.
- `tor` (boolean, optional, nullable) — A Tor exit relay. Null when the list could not be read.
- `vpn` (boolean, optional, nullable) — In a commercial VPN provider's range. Null when the list could not be read or the address is not public.
- `threat` (boolean, optional, nullable) — On FireHOL level 1. Null when the list could not be read or the address is not public.
- `claimedCountry` (string, optional, nullable) — The country you sent.
- `countryMatch` (boolean, optional, nullable) — True when the address is in the claimed country. Null when none was claimed or the address has no country.
- `userAgent` (IpCheckResultUserAgent, optional, nullable) — The User-Agent you sent, summarised.
- `testData` (boolean, optional) — True when the address is one of Toden's test addresses outside production, with fixed answers.
- `rules` (IpCheckResultRules, optional) — The rules this check was judged by.

### IpCheckResultNetwork

The network that owns the address.

- `asn` (integer, optional, nullable) — The autonomous system number.
- `owner` (string, optional, nullable) — The network's owner, as registered.
- `type` (enum, optional) — `residential`, `mobile_carrier`, `datacenter` (hosting) or `unknown`.
  - Allowed values: `residential`, `mobile_carrier`, `datacenter`, `unknown`

### IpCheckResultUserAgent

The User-Agent you sent, summarised.

- `raw` (string, optional) — As sent.
- `browser` (string, optional, nullable) — The browser, e.g. `Chrome`.
- `os` (string, optional, nullable) — The operating system, e.g. `macOS`.
- `deviceClass` (enum, optional) — `mobile`, `desktop` or `unknown`.
  - Allowed values: `mobile`, `desktop`, `unknown`
- `label` (string, optional) — Both in a few words, e.g. `macOS · Chrome`.

### IpCheckResultRules

The rules this check was judged by.

- `actions` (map from string to enum, optional) — Each finding's action.
  - Allowed values: `decline`, `review`, `approve`
- `settings` (IpCheckResultRulesSettings, optional) — Each setting's value.
- `source` (map from string to enum, optional) — Where each finding's action and each setting came from.
  - Allowed values: `default`, `organisation`, `request`
- `triggered` (list of IpCheckResultRulesTriggeredItems, optional) — The findings this check found, each with the action it took.

### IpCheckResultRulesSettings

Each setting's value.

### IpCheckResultRulesTriggeredItems

- `finding` (string, optional) — The finding.
- `action` (enum, optional) — What it did.
  - Allowed values: `decline`, `review`, `approve`

## Examples

### Example 1

**Request**

```json
{
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
}
```

**Response**

```json
{
  "id": "string",
  "kind": "ip",
  "outcome": "pass",
  "subject": "string",
  "channel": "api",
  "createdAt": "2024-01-15T09:30:00Z",
  "input": {},
  "externalUserId": "string",
  "result": {
    "ip": "string",
    "version": 4,
    "public": true,
    "network": {
      "asn": 1,
      "owner": "string",
      "type": "residential"
    },
    "privacyNetwork": true,
    "reasons": [
      "tor"
    ],
    "notes": [
      "tor"
    ],
    "country": "string",
    "countryName": "string",
    "tor": true,
    "vpn": true,
    "threat": true,
    "claimedCountry": "string",
    "countryMatch": true,
    "userAgent": {
      "raw": "string",
      "browser": "string",
      "os": "string",
      "deviceClass": "mobile",
      "label": "string"
    },
    "testData": true,
    "rules": {
      "actions": {},
      "settings": {},
      "source": {},
      "triggered": [
        {
          "finding": "string",
          "action": "decline"
        }
      ]
    }
  },
  "failureCode": "string",
  "charged": "string",
  "entityId": "string",
  "completedAt": "2024-01-15T09:30:00Z",
  "replayed": true
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/checks/ip"

payload = {
    "ip": "41.58.1.2",
    "claimedCountry": "NG",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
    "requestId": "ip-check-4c1e8a0b"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/ip';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"ip":"41.58.1.2","claimedCountry":"NG","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)","requestId":"ip-check-4c1e8a0b"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/checks/ip"

	payload := strings.NewReader("{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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://sandbox-api.toden.co/api/v1/checks/ip")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}"

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.post("https://sandbox-api.toden.co/api/v1/checks/ip")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/ip', [
  'body' => '{
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/ip");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/checks/ip")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Example 2

**Request**

```json
{
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
}
```

**Response**

```json
{
  "id": "string",
  "kind": "ip",
  "outcome": "pass",
  "subject": "string",
  "channel": "api",
  "createdAt": "2024-01-15T09:30:00Z",
  "input": {},
  "externalUserId": "string",
  "result": {
    "ip": "string",
    "version": 4,
    "public": true,
    "network": {
      "asn": 1,
      "owner": "string",
      "type": "residential"
    },
    "privacyNetwork": true,
    "reasons": [
      "tor"
    ],
    "notes": [
      "tor"
    ],
    "country": "string",
    "countryName": "string",
    "tor": true,
    "vpn": true,
    "threat": true,
    "claimedCountry": "string",
    "countryMatch": true,
    "userAgent": {
      "raw": "string",
      "browser": "string",
      "os": "string",
      "deviceClass": "mobile",
      "label": "string"
    },
    "testData": true,
    "rules": {
      "actions": {},
      "settings": {},
      "source": {},
      "triggered": [
        {
          "finding": "string",
          "action": "decline"
        }
      ]
    }
  },
  "failureCode": "string",
  "charged": "string",
  "entityId": "string",
  "completedAt": "2024-01-15T09:30:00Z",
  "replayed": true
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/checks/ip"

payload = {
    "ip": "41.58.1.2",
    "claimedCountry": "NG",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
    "requestId": "ip-check-4c1e8a0b"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/ip';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"ip":"41.58.1.2","claimedCountry":"NG","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)","requestId":"ip-check-4c1e8a0b"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/checks/ip"

	payload := strings.NewReader("{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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://sandbox-api.toden.co/api/v1/checks/ip")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}"

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.post("https://sandbox-api.toden.co/api/v1/checks/ip")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/ip', [
  'body' => '{
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/ip");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ip\": \"41.58.1.2\",\n  \"claimedCountry\": \"NG\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)\",\n  \"requestId\": \"ip-check-4c1e8a0b\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ip": "41.58.1.2",
  "claimedCountry": "NG",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
  "requestId": "ip-check-4c1e8a0b"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/checks/ip")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```