# Network › IP addresses › Abuse API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Network product's sections: https://developers.eu.ovhcloud.com/reference/network/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 12 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/ip-addresses/abuse.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/ip-addresses/abuse.json?format=openapi3

## Operations

- `GET /ip/{ip}/antihack` — List hack blocks
- `GET /ip/{ip}/arp` — List ARP blocks
- `GET /ip/{ip}/spam` — List spam blocks
- `GET /ip/{ip}/spam/{ipSpamming}/stats` — List spam statistics
- `GET /ip/{ip}/phishing` — List phishing reports
- `GET /ip/{ip}/antihack/{ipBlocked}` — Get a hack block
- `GET /ip/{ip}/arp/{ipBlocked}` — Get an ARP block
- `GET /ip/{ip}/spam/{ipSpamming}` — Get a spam block
- `GET /ip/{ip}/phishing/{id}` — Get a phishing report
- `POST /ip/{ip}/antihack/{ipBlocked}/unblock` — Lift a hack block
- `POST /ip/{ip}/arp/{ipBlocked}/unblock` — Lift an ARP block
- `POST /ip/{ip}/spam/{ipSpamming}/unblock` — Lift a spam block

## List hack blocks

`GET /1.0/ip/{ip}/antihack`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-antihack

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:antihack/get`

List hack blocks. Returns the addresses of the block blocked for outgoing attacks, filterable by state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `state` | query | ip.BlockedIpStateEnum |  | Filter the value of state property (=) — one of `blocked`, `unblocking` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipv4[] | successful operation |

```json
[
  "192.0.2.0"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/antihack" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/antihack")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/antihack");

print_r($result);
?>
```

## List ARP blocks

`GET /1.0/ip/{ip}/arp`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-arp

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:arp/get`

List ARP blocks. Returns the addresses of the block blocked for ARP spoofing, filterable by state: blocked or unblocking.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `state` | query | ip.ArpStateEnum |  | Filter the value of state property (=) — one of `blocked`, `unblocking` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipv4[] | successful operation |

```json
[
  "192.0.2.0"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/arp" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/arp")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/arp");

print_r($result);
?>
```

## List spam blocks

`GET /1.0/ip/{ip}/spam`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-spam

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:spam/get`

List spam blocks. Returns the addresses of the block blocked for sending spam, filterable by state: blockedForSpam, unblocked or unblocking.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `state` | query | ip.SpamStateEnum |  | Filter the value of state property (=) — one of `blockedForSpam`, `unblocked`, `unblocking` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipv4[] | successful operation |

```json
[
  "192.0.2.0"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/spam" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/spam")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/spam");

print_r($result);
?>
```

## List spam statistics

`GET /1.0/ip/{ip}/spam/{ipSpamming}/stats`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-spam-ipspamming-stats

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:spam/stats/get`

List spam statistics. Returns emails sent, spams detected and average spam score over the given period.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string (date-time) | yes | Start date |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipSpamming` | path | ipv4 | yes | IP address which is sending spam |
| `to` | query | string (date-time) | yes | End date |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.SpamStats[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `averageSpamscore` | integer |  | Average spam score. |
| `detectedSpams` | ip.SpamTarget[] |  | Detailed list of the spams |
| `detectedSpams[].date` | integer |  | Timestamp when the email was sent |
| `detectedSpams[].destinationIp` | ipv4 |  | IP address of the target |
| `detectedSpams[].messageId` | string |  | The message-id of the email |
| `detectedSpams[].spamscore` | integer |  | Spam score for the email |
| `numberOfSpams` | integer |  | Number of spams sent |
| `timestamp` | integer |  | Time when the IP address was blocked |
| `total` | integer |  | Number of emails sent |

```json
[
  {
    "averageSpamscore": 0,
    "detectedSpams": [
      {
        "date": 0,
        "destinationIp": "192.0.2.0",
        "messageId": "string",
        "spamscore": 0
      }
    ],
    "numberOfSpams": 0,
    "timestamp": 0,
    "total": 0
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/spam/{ipSpamming}/stats" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/spam/{ipSpamming}/stats")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/spam/{ipSpamming}/stats");

print_r($result);
?>
```

## List phishing reports

`GET /1.0/ip/{ip}/phishing`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-phishing

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:phishing/get`

List phishing reports. Returns the IDs of phishing URLs found on the block, filterable by address or state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipOnAntiphishing` | query | ipv4 |  | Filter the value of ipOnAntiphishing property (within or equals) |
| `state` | query | ip.AntiphishingStateEnum |  | Filter the value of state property (=) — one of `blocked`, `blocking`, `unblocked`, `unblocking` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/phishing" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/phishing")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/phishing");

print_r($result);
?>
```

## Get a hack block

`GET /1.0/ip/{ip}/antihack/{ipBlocked}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-antihack-ipblocked

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:antihack/get`

Get a hack block. Returns the block date, logs, state, and the seconds left before you can ask to unblock.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipBlocked` | path | ipv4 | yes | your IP |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.BlockedIp | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `blockedSince` | string (date-time) | read-only | The last blocking date |
| `ipBlocked` | ipv4 | read-only | your IP |
| `logs` | string | read-only | Logs |
| `state` | ip.BlockedIpStateEnum | read-only | this IP address state — one of `blocked`, `unblocking` |
| `time` | integer | read-only | Time (in seconds) remaining before you can request your IP to be unblocked |

```json
{
  "blockedSince": "2024-01-01T12:00:00Z",
  "ipBlocked": "192.0.2.0",
  "logs": "string",
  "state": "blocked",
  "time": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/antihack/{ipBlocked}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/antihack/{ipBlocked}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/antihack/{ipBlocked}");

print_r($result);
?>
```

## Get an ARP block

`GET /1.0/ip/{ip}/arp/{ipBlocked}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-arp-ipblocked

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:arp/get`

Get an ARP block. Returns the block date, ARP logs, and the seconds left before you can ask to unblock.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipBlocked` | path | ipv4 | yes | your IP |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.ArpBlockedIp | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `blockedSince` | string (date-time) | read-only | The last blocking date |
| `ipBlocked` | ipv4 | read-only | your IP |
| `logs` | string | read-only | ARP logs |
| `state` | ip.ArpStateEnum | read-only | this IP address state — one of `blocked`, `unblocking` |
| `time` | integer | read-only | Time (in seconds) remaining before you can request your IP to be unblocked |

```json
{
  "blockedSince": "2024-01-01T12:00:00Z",
  "ipBlocked": "192.0.2.0",
  "logs": "string",
  "state": "blocked",
  "time": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/arp/{ipBlocked}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/arp/{ipBlocked}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/arp/{ipBlocked}");

print_r($result);
?>
```

## Get a spam block

`GET /1.0/ip/{ip}/spam/{ipSpamming}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-spam-ipspamming

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:spam/get`

Get a spam block. Returns the last block date, the state, and how long, in seconds, the address stays blocked.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipSpamming` | path | ipv4 | yes | IP address which is sending spam |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.SpamIp | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | Last date the ip was blocked |
| `ipSpamming` | ipv4 | read-only | IP address which is sending spam |
| `state` | ip.SpamStateEnum | read-only | Current state of the ip — one of `blockedForSpam`, `unblocked`, `unblocking` |
| `time` | integer | read-only | Time (in seconds) while the IP will be blocked |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "ipSpamming": "192.0.2.0",
  "state": "blockedForSpam",
  "time": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/spam/{ipSpamming}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/spam/{ipSpamming}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/spam/{ipSpamming}");

print_r($result);
?>
```

## Get a phishing report

`GET /1.0/ip/{ip}/phishing/{id}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#get-ip-ip-phishing-id

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:phishing/get`

Get a phishing report. Returns the phishing URL, the address hosting it, the date of the event and its state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Internal ID of the phishing entry |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.Antiphishing | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Date of the event |
| `id` | integer | read-only | Internal ID of the phishing entry |
| `ipOnAntiphishing` | ipv4 | read-only | IP address hosting the phishing URL |
| `state` | ip.AntiphishingStateEnum | read-only | Current state of the phishing — one of `blocked`, `blocking`, `unblocked`, `unblocking` |
| `urlPhishing` | string | read-only | Phishing URL |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "id": 0,
  "ipOnAntiphishing": "192.0.2.0",
  "state": "blocked",
  "urlPhishing": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/phishing/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ip/{ip}/phishing/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ip/{ip}/phishing/{id}");

print_r($result);
?>
```

## Lift a hack block

`POST /1.0/ip/{ip}/antihack/{ipBlocked}/unblock`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#post-ip-ip-antihack-ipblocked-unblock

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:antihack/unblock`

Lift a hack block. Unblocks the address once the waiting time is over. Get the hack block to see the seconds left.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipBlocked` | path | ipv4 | yes | your IP |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/antihack/{ipBlocked}/unblock" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/ip/{ip}/antihack/{ipBlocked}/unblock")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/ip/{ip}/antihack/{ipBlocked}/unblock");

print_r($result);
?>
```

## Lift an ARP block

`POST /1.0/ip/{ip}/arp/{ipBlocked}/unblock`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#post-ip-ip-arp-ipblocked-unblock

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:arp/unblock`

Lift an ARP block. Unblocks the address once the waiting time is over. Get the ARP block to see the seconds left.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipBlocked` | path | ipv4 | yes | your IP |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/arp/{ipBlocked}/unblock" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/ip/{ip}/arp/{ipBlocked}/unblock")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/ip/{ip}/arp/{ipBlocked}/unblock");

print_r($result);
?>
```

## Lift a spam block

`POST /1.0/ip/{ip}/spam/{ipSpamming}/unblock`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/abuse/#post-ip-ip-spam-ipspamming-unblock

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:spam/unblock`

Lift a spam block. Releases the address from the anti-spam system, and returns the spam block of the address.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `ipSpamming` | path | ipv4 | yes | IP address which is sending spam |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.SpamIp | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | Last date the ip was blocked |
| `ipSpamming` | ipv4 | read-only | IP address which is sending spam |
| `state` | ip.SpamStateEnum | read-only | Current state of the ip — one of `blockedForSpam`, `unblocked`, `unblocking` |
| `time` | integer | read-only | Time (in seconds) while the IP will be blocked |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "ipSpamming": "192.0.2.0",
  "state": "blockedForSpam",
  "time": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/spam/{ipSpamming}/unblock" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/ip/{ip}/spam/{ipSpamming}/unblock")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/ip/{ip}/spam/{ipSpamming}/unblock");

print_r($result);
?>
```
