# Using our REST/HTTPS API

## Authentication

All requests utilize a ***key*** parameter, which will contain your API Key.

{% hint style="info" %}

#### Gain unrestricted access - Absolutely free.

Get in touch with your account-manager in order to get your network authorized to access our REST API, without being restricted by our Firewall Rules etc.
{% endhint %}

## Get all Forwarding Rules for specific IPv4

You must be using the API Key assigned to the relevant business managing said IPv4 address on our system.

***Endpoint:*** `vpnaas.org/api/ip/rules`

***Request Method:*** `GET`

| Parameter | Value        | Required |
| --------- | ------------ | -------- |
| key       | API Key      | Yes      |
| ip        | IPv4 Address | Yes      |

Example Request & Response:

<pre class="language-bash"><code class="lang-bash">>curl "https://vpnaas.org/api/ip/rules?key=<a data-footnote-ref href="#user-content-fn-1">test</a>&#x26;ip=<a data-footnote-ref href="#user-content-fn-2">202.181.177.177</a>"
[
  {
    "id": 4579,      # this is the Rule ID!      
    "businessId": 1,         
    "ipId": 9999,            
    "ruleId": 2,     # don't worry about the ruleId parameter.        
    "label": "Test Rule",    
    "arguments": "targetHost=1.1.1.1",
    "enabled": true,
    "date": "2024-07-08 08:47:53.862"
  }
]
</code></pre>

## Delete specific Forwarding Rule for IPv4

You must be using the API Key assigned to the relevant business managing said IPv4 address on our system.

***Endpoint:*** `vpnaas.org/api/ip/rules`

***Request Method:*** `DELETE`

| Parameter | Value                                     | Required |
| --------- | ----------------------------------------- | -------- |
| key       | API Key                                   | Yes      |
| ip        | IPv4 Address                              | Yes      |
| id        | the ID parameter for your specified rule. | Yes      |

Example Request & Response:

```bash
>curl -XDELETE "https://vpnaas.org/api/ip/rules?key=test&ip=202.181.177.177&id=4581"
1
```

All of our REST APIs will return relevant HTTP Error Codes if any errors are present with your request, otherwise you will be given a JSON or `1` response.

## Create new Forwarding Rule for Specific IPv4

[^1]: API Key

[^2]: Target IPv4
