# Subscription API guide

**Version 2.1.** If you are viewing the Subscription API guide as a PDF file, you can always check for the latest version here: [https://docs.safedns.com/books/subscription-api/page/subscription-api-guide](https://docs.safedns.com/books/subscription-api/page/subscription-api-guide)

---

### Introduction

SafeDNS Subscription API is designed to give you an easy and fast way to automatically create new user accounts in the SafeDNS cloud service from the internal systems of an ISP or a developer. Also, you can use this API to manage the base settings of a user like their email, password, and filtering policy.

<div dir="auto" id="bkmrk--0"><div dir="auto">---

</div></div>### Description

API developer (provider) is provided with a public key, that is used for authentication. All requests are made through HTTPS via GET requests. Each request must contain a public key with the name of a parameter **key**.

<p class="callout warning">The public key is provided with a separate email and should not be available in open access.</p>

<p class="callout warning">API address: **https://www.safedns.com/provider\_api/**</p>

<p class="callout success">API call example: **curl "https://www.safedns.com/provider\_api/METHOD\_NAME?key=PUBLIC\_KEY&amp;mandatory\_parameter=VALUE&amp;optional\_parameter=VALUE"**</p>

<div dir="auto" id="bkmrk--1"><div dir="auto">---

</div></div>#### Table of available methods

<div dir="auto" id="bkmrk-%23-value-description-"><div dir="auto"><table border="1" class="align-center" id="bkmrk-%23-value-description--0" style="width: 100%; height: 1037.08px;"><tbody><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">**\#**</td><td class="align-center" style="width: 19.9011%; height: 29.7969px;">**Value**</td><td class="align-center" style="width: 75.0309%; height: 29.7969px;">**Description**</td></tr><tr style="height: 46.5938px;"><td style="width: 5.06799%; height: 46.5938px;">1</td><td class="align-left" style="width: 19.9011%; height: 46.5938px;">**subscribe**</td><td class="align-left" style="width: 75.0309%; height: 46.5938px;">Registers a User in the system with the provided credentials and sets the expiration date of the account to +1 year from the current date.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">2</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**subscribe\_plans**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Lists Reseller’s available billing plans.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">3</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**activate**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Sets the status of a User to "Active".</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">4</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**deactivate**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Sets the status of a User to "Inactive".</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">5</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_email**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Updates User’s email.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">6</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_password**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Updates User’s password.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">7</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**prolongate**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Enables and changes a paid plan for an existing User.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">8</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**unsubscribe**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Switches a User to the FREE plan with the limited filtering functionality.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">9</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**subscription\_info**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets the expiration date of the account.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">10</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**profiles**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets a list of existing filtering policies.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">11</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**create\_profile**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Creates a filtering policy.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">12</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_profile**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Changes the settings of the User's filtering policy and its blockpage.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">13</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**delete\_profile**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Deletes one of the existing filtering policies.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">14</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**add\_ip**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Adds one or more IP addresses to a User.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">15</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**clear\_ip**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Deletes all IP addresses of a User that uses the selected filtering policy.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">16</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**list\_ip**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets a list of all User’s IP addresses.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">17</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**remove\_ip**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Removes specified IP address from User.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">18</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**add\_vpn**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Creates a VPN Configuration File for the policy and returns OpenVPN policy.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">19</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**clear\_vpn\_for\_profile**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Deletes all VPN Configuration Files that use specified filtering policy.</td></tr><tr style="height: 35.3906px;"><td style="width: 5.06799%; height: 35.3906px;">20</td><td style="width: 19.9011%; height: 35.3906px;">**clear\_vpn\_for\_user**

</td><td class="align-left" style="width: 75.0309%; height: 35.3906px;">Deletes all VPN Configuration Files of specified User.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">21</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_vpn\_list**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets a list of User’s VPN Configuration Files.</td></tr><tr style="height: 31.3906px;"><td style="width: 5.06799%; height: 31.3906px;">22</td><td class="align-left" style="width: 19.9011%; height: 31.3906px;">**remove\_vpn**

</td><td class="align-left" style="width: 75.0309%; height: 31.3906px;">Removes User’s VPN Configuration File.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">23</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_ip**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Creates a ddclient record and/or updates the IP address for it.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">24</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_nat**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Updates a filtering policy of the specified NAT DNS address.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">25</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_activity**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets User’s stats for a certain date.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">26</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_activity\_report**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets the User's activity report for a certain time range.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">27</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_popular\_report**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets the User's popular requests report for a certain time range.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">28</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_category\_report**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets User's categories report for a certain time range.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">29</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**send\_monthly\_stat**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Sends Monthly Stats report to User’s email.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">30</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_daily\_stat**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets a link to the User's Daily Stats report.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">31</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**update\_subscription**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Changes the billing plan and/or expiration date of Users.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">32</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**forgot\_password**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Sends a password reset email to a User.</td></tr><tr style="height: 29.7969px;"><td style="width: 5.06799%; height: 29.7969px;">33</td><td class="align-left" style="width: 19.9011%; height: 29.7969px;">**get\_blockpages**</td><td class="align-left" style="width: 75.0309%; height: 29.7969px;">Gets the list of existing BlockPages.</td></tr><tr><td style="width: 5.06799%;">34</td><td class="align-left" style="width: 19.9011%;">**create\_blockpage**</td><td class="align-left" style="width: 75.0309%;">Creates a new blockpage.</td></tr><tr><td style="width: 5.06799%;">35</td><td class="align-left" style="width: 19.9011%;">**update\_blockpage**</td><td class="align-left" style="width: 75.0309%;">Updates parameters of the blockpage.</td></tr><tr><td style="width: 5.06799%;">36</td><td class="align-left" style="width: 19.9011%;">**user\_list**</td><td class="align-left" style="width: 75.0309%;">Lists all created user accounts.</td></tr></tbody></table>

---

</div></div>#### Table of values for the <span style="color: #3598db;">**plan** </span>parameter

<div dir="auto" id="bkmrk-value-description-pr"><div dir="auto"><table border="1" class="align-center" id="bkmrk-value-description-pr-0" style="height: 536px; width: 51.2346%;"><tbody><tr><td class="align-center" style="width: 49.8795%;">**Value**</td><td class="align-center" style="width: 49.8795%;">**Description**</td></tr><tr><td class="align-left" style="width: 49.8795%;">**PREMIUM**</td><td class="align-left" style="width: 49.8795%;">Safe@Home</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-5**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 5</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-10**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 10</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-25**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 25</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-50**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 50</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-75**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 75</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BUSINESS-100**</td><td class="align-left" style="width: 49.8795%;">Safe@Office 100</td></tr><tr><td class="align-left" style="width: 49.8795%;">**NONPROFIT**</td><td class="align-left" style="width: 49.8795%;">Nonprofit</td></tr><tr><td class="align-left" style="width: 49.8795%;">**EDU** </td><td class="align-left" style="width: 49.8795%;">Education</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-1**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 1</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-2**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 2</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-3**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 3</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-4**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 4</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-5**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 5</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI-10**</td><td class="align-left" style="width: 49.8795%;">HotSpot Edition 10</td></tr><tr><td class="align-left" style="width: 49.8795%;">**WIFI**</td><td class="align-left" style="width: 49.8795%;">HotSpot Advanced Edition</td></tr><tr><td class="align-left" style="width: 49.8795%;">**ENTERPRISE**</td><td class="align-left" style="width: 49.8795%;">Enterprise</td></tr><tr><td class="align-left" style="width: 49.8795%;">**HOME**</td><td class="align-left" style="width: 49.8795%;">Safe Home</td></tr><tr><td class="align-left" style="width: 49.8795%;">**FAMILY**</td><td class="align-left" style="width: 49.8795%;">Safe Family</td></tr><tr><td class="align-left" style="width: 49.8795%;">**BASIC**</td><td class="align-left" style="width: 49.8795%;">Basic</td></tr><tr><td class="align-left" style="width: 49.8795%;">**PRO**</td><td class="align-left" style="width: 49.8795%;">Pro</td></tr><tr><td class="align-left" style="width: 49.8795%;">**PRO-PLUS**</td><td class="align-left" style="width: 49.8795%;">Pro Plus</td></tr><tr><td class="align-left" style="width: 49.8795%;">**CUSTOM-WIFI**</td><td class="align-left" style="width: 49.8795%;">Wi-Fi</td></tr><tr><td class="align-left" style="width: 49.8795%;">**CUSTOM-EDU%26NONPROFIT**</td><td class="align-left" style="width: 49.8795%;">Education &amp; Nonprofit</td></tr></tbody></table>

---

</div></div>### Methods &amp; parameters

<p class="callout warning">**<span style="color: #e03e2d;">Red</span>** parameters are mandatory.</p>

<p class="callout info"><span style="color: #3598db;">**Blue** </span>parameters are optional.</p>

<div dir="auto" id="bkmrk--2"><div dir="auto">---

</div></div>#### 1. subscribe

Registers a User in the system with the provided credentials, and sets the expiration date of the account to +1 year from the current date.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-password%C2%A0--password-"><div dir="auto">- <span style="color: #e03e2d;">**password** </span>- password of a newly created user.   
    The password must have:  
    \- Between 8 and 128 characters  
    \- At least one digit (0-9)  
    \- At least one lowercase letter (a-z)  
    \- At least one uppercase letter (A-Z)  
    \- At least one special character: ~ ! ? @ # $ % ^ &amp; \* \_ - + ( ) \[ \] { } &gt; &lt; / \\ | " ' . , : ;

</div></div>4 optional parameters can be used:

<div dir="auto" id="bkmrk-login%C2%A0--user%27s-accou"><div dir="auto">- <span style="color: #3598db;">**login** </span>- User's account login. If not specified, a default *prefix\_count* name will be used (e.g. ISPname\_00001).  
    To change the default prefix, please contact your manager or SafeDNS technical support.  
    **Login is the unique value in the system. We recommend using the default *prefix\_count* naming.**
- <span style="color: #3598db;">**email** </span>- User’s email. If not specified, the User will not be able to receive system notifications, or stats, and reset the password.  
    Users can change the password via Dashboard.
- <span style="color: #3598db;">**plan** </span>- User's billing plan. If not specified, PREMIUM (Safe@Home) will be used.
- <span style="color: #3598db;">**customer** </span>- User's information (e.g. name).  
    Please note that the latest curl update requires %20 to be used instead of spaces.

</div></div>Example: `curl "https://www.safedns.com/provider_api/subscribe?key=PUBLIC_KEY&password=StrongPassword123&login=ACCOUNT_NAME&email=email@example.com&plan=PREMIUM&customer=John%20Doe"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"username": "username",
          	"email": "email",
          	"plan": "tariff_name"
		}
	}
}
```

<div dir="auto" id="bkmrk--3"><div dir="auto">---

</div></div>#### 2. subscribe\_plans

Lists Reseller’s available billing plans.

Example: `curl "https://www.safedns.com/provider_api/subscribe_plans?key=PUBLIC_KEY"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"plan1": "tariff_name1",
			"plan2": "tariff_name2"
		}
	}
}
```

<div dir="auto" id="bkmrk--4"><div dir="auto">---

</div></div>#### 3. activate

Sets the status of a User to "Active".

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/activate?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--5"><div dir="auto">---

</div></div>#### 4. deactivate

Sets the status of a User to "Inactive".

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-0"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/deactivate?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--6"><div dir="auto">---

</div></div>#### 5. update\_email

Updates User’s email.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-1"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**email** </span>- new email for a User.

</div></div>An error will be returned if the user with the same email is found.

Example: `curl "https://www.safedns.com/provider_api/update_email?key=PUBLIC_KEY&ident=ACCOUNT_NAME&email=email@example.com"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--8"><div dir="auto">---

</div></div>#### 6. update\_password

Updates User’s password.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-2"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**password </span>- new password for a User.  
    The password must have:  
    \- Between 8 and 128 characters  
    \- At least one digit (0-9)  
    \- At least one lowercase letter (a-z)  
    \- At least one uppercase letter (A-Z)  
    \- At least one special character: ~ ! ? @ # $ % ^ &amp; \* \_ - + ( ) \[ \] { } &gt; &lt; / \\ | " ' . , : ;

</div></div>Example: `curl "https://www.safedns.com/provider_api/update_password?key=PUBLIC_KEY&ident=ACCOUNT_NAME&password=StrongPassword123"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--9"><div dir="auto">---

</div></div>#### 7. prolongate

Enables and changes a paid plan for an existing User.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-3"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>1 optional parameter can be used:

<div dir="auto" id="bkmrk-plan%C2%A0--billing-plan-"><div dir="auto">- <span style="color: #3598db;">**plan** </span>- billing plan code (see "Table of values for the plan parameter" above).  
    If not used, the paid plan PREMIUM will be set.  
    If you use a code that is not available for your account, an error will be returned.

</div></div>Example: `curl "https://www.safedns.com/provider_api/prolongate?key=PUBLIC_KEY&ident=ACCOUNT_NAME&plan=ENTERPRISE"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--10"><div dir="auto">---

</div></div>#### 8. unsubscribe

Switches a User to the FREE plan with the limited filtering functionality.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-4"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/unsubscribe?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--11"><div dir="auto">---

</div></div>#### 9. subscription\_info

Gets the expiration date of the account.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-5"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/subscription_info?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"date_end": 1390930655
		}
	}
}
```

<p class="callout info">The expiration date is in UNIX time format.</p>

<div dir="auto" id="bkmrk--12"><div dir="auto">---

</div></div>#### 10. profiles

Gets a list of existing filtering policies.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0%E2%80%93-user%27s-accou"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>– User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/profiles?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"policy ID 1": "policy name",
          	"policy ID 2": "policy name",
          	"policy ID N": "policy name"
		}
	}
}
```

<p class="callout info">“Policy name” is returned in UTF-8 encoding.</p>

<div dir="auto" id="bkmrk--13"><div dir="auto">---

</div></div>#### 11. create\_profile

Creates a filtering policy.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0%E2%80%93-user%27s-accou-0"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>– User's account login.
- <span style="color: #e03e2d;">**name** </span>– the name of the User's filtering policy.

</div></div>1 optional parameter can be used:

<div dir="auto" id="bkmrk-blockpage_id%C2%A0%E2%80%93-id-of"><div dir="auto">- <span style="color: #3598db;">**blockpage\_id** </span>– the id of the block page that will be set for the profile.  
    At the moment, <span style="color: #3598db;">**blockpage\_id** </span>can be viewed only in the SafeDNS Dashboard &gt; Settings &gt; Advanced.

</div></div>Example: `curl "https://www.safedns.com/provider_api/create_profile?key=PUBLIC_KEY&ident=ACCOUNT_NAME&name=POLICY_NAME&blockpage_id=ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"id": ID number
		"name": profile name
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--14"><div dir="auto">---

</div></div>#### 12. update\_profile

Changes the settings of the User's filtering policy and its blockpage.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-profile_id%C2%A0%E2%80%93-user%27s-"><div dir="auto">- <span style="color: #e03e2d;">**profile\_id** </span>– User's filtering policy ID.

</div></div>1 optional parameter can be used:

<div dir="auto" id="bkmrk-name%C2%A0%E2%80%93-new-name-of-t"><div dir="auto">- <span style="color: #3598db;">**name** </span>– new name of the User's filtering policy.
- **<span style="color: #3598db;">blockpage\_id</span>** – assigns blockpage to the filtering policy.

</div></div>Example: `curl "https://www.safedns.com/provider_api/update_profile?key=PUBLIC_KEY&profile_id=POLICY_ID&name=POLICY_NAME&blockpage_id=BLOCKPAGE_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
          	"name": "profile_name",
          	"tls": "True|False",
        	"id": "profile_id",
          	"blockpage_id": "blockpage_id"
		}
	}
}
```

<div dir="auto" id="bkmrk--15"><div dir="auto">---

</div></div>#### 13. delete\_profile

Deletes one of the existing filtering policies.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-key%C2%A0--public-api-key"><div dir="auto">- <span style="color: #e03e2d;">**profile\_id** </span>- filtering policy ID.

</div></div><div dir="auto" id="bkmrk-profile_id%C2%A0%E2%80%93-filteri"></div>Example: `curl "https://www.safedns.com/provider_api/delete_profile?key=PUBLIC_KEY&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"result": 0
      	{
		"jsonrpc": "1.9"
		}
	}
}
```

<div dir="auto" id="bkmrk--16"><div dir="auto">---

</div></div>#### 14. add\_ip

Adds one or more IP addresses to a User.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-6"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**ip** </span>- one or multiple IP addresses. Each address must use its own <span style="color: #e03e2d;">**ip** </span>parameter.

</div></div>2 optional parameters can be used:

<div dir="auto" id="bkmrk-profile%C2%A0--filtering-"><div dir="auto">- <span style="color: #3598db;">**profile** </span>- filtering policy ID. If not used, a Default policy will be used for the IP address.
- <span style="color: #3598db;">**comment** </span>- any comment.  
    Please note that the latest curl update requires %20 to be used instead of spaces.

</div></div>Example: `curl "https://www.safedns.com/provider_api/add_ip?key=PUBLIC_KEY&ident=ACCOUNT_NAME&ip=IP_ADDRESS_1&ip=IP_ADDRESS_2&profile=POLICY_ID&comment=COMMENT%20EXAMPLE"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"added_addresses": ["1.1.1.1", "1.1.1.2"],
			"invalid_adresses": [
				{"1.invalid.ip.adress": "IP address is invalid"},
				{"0.0.0.0": "This address is not public"}
			]
        }
    }
}
```

<p class="callout warning">If one or multiple IP addresses are invalid, the list of these IP addresses will be returned.</p>

<div dir="auto" id="bkmrk--17"><div dir="auto">---

</div></div>#### 15. clear\_ip

Deletes all IP addresses of a User that uses the selected filtering policy.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-7"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**profile** </span>- filtering policy ID.

</div></div>Example: `curl "https://www.safedns.com/provider_api/clear_ip?key=PUBLIC_KEY&ident=ACCOUNT_NAME&profile=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--18"><div dir="auto">---

</div></div>#### 16. list\_ip

Gets a list of all User’s IP addresses.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-8"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>1 optional parameter can be used:

<div dir="auto" id="bkmrk-profile%C2%A0--filtering--0"><div dir="auto">- <span style="color: #3598db;">**profile** </span>- filtering policy ID. If not specified, all IP addresses of the account will be listed.

</div></div>Example: `curl "https://www.safedns.com/provider_api/list_ip?key=PUBLIC_KEY&ident=ACCOUNT_NAME&profile=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"ip": [
				{"address": "1.2.3.4", "comment": "example.com"},
				{"address": "1.2.3.5", "comment": "example.com"}
			],
		}
	}
}
```

<div dir="auto" id="bkmrk--19"><div dir="auto">---

</div></div>
#### 17. remove\_ip

Removes specified IP address from User.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-9"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**ip** </span>- IP address of a User.

</div></div>Example: `curl "https://www.safedns.com/provider_api/remove_ip?key=PUBLIC_KEY&ident=ACCOUNT_NAME&ip=IP_ADDRESS"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--20"><div dir="auto">---

</div></div>#### 18. add\_vpn

Creates a VPN Configuration File for the policy and returns OpenVPN policy.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-10"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**name** </span>- Configuration File name, unique for a current User.
- <span style="color: #e03e2d;">**profile\_id** </span>- filtering policy ID.

</div></div>Example: `curl "https://www.safedns.com/provider_api/add_vpn?key=PUBLIC_KEY&ident=ACCOUNT_NAME&name=CONNECTION_NAME&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
          "ovpn": "client\nremote vpn.safedns.com 1194 udp\nnobind\ndevtun\npersist-tun\npersist-key\nverify-x509-name vpn.safedns.com name\nremote-cert-tls server\ncipher AES-128-CBC\n\n<ca>\n-----BEGIN CERTIFICATE-----\n ----- ENDCERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n</ca>\n<cert>\n----- BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n</cert>\n<key>\n-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY ---- \n</key>\n"
		}
	}
}
```

<p class="callout info">If the limit of VPN connections for an account is exceeded, a "Limit is reached" message will be shown.</p>

<div dir="auto" id="bkmrk--21"><div dir="auto">---

</div></div>#### 19. clear\_vpn\_for\_profile

Deletes all VPN Configuration Files that use specified filtering policy.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--numeric"><div dir="auto">- <span style="color: #e03e2d;">**profile\_id** </span>- numeric profile ID you need to delete VPN connections for.

</div></div>Example: `curl "https://www.safedns.com/provider_api/clear_vpn_for_profile?key=PUBLIC_KEY&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--22"><div dir="auto">---

</div></div>#### 20. clear\_vpn\_for\_user

Deletes all VPN Configuration Files of specified User.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-11"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/clear_vpn_for_user?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--23"><div dir="auto">---

</div></div>#### 21. get\_vpn\_list

Gets a list of User’s VPN Configuration Files.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-12"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/get_vpn_list?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": [
			{"id": "vpn_id1", "profile": "profile_name", "ip": "vpn_hostname1", "name": "vpn_name1"},
			{"id": "vpn_id2", "profile": "profile_name", "ip": "vpn_hostname2", "name": "vpn_name2"}
		]
	}
}
```

<div dir="auto" id="bkmrk--24"><div dir="auto">---

</div></div>#### 22. remove\_vpn

Removes User’s VPN Configuration File.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-id%C2%A0--id-of-the-vpn-c"><div dir="auto">- <span style="color: #e03e2d;">**id** </span>- id of the VPN Configuration File.

</div></div>Example: `curl "https://www.safedns.com/provider_api/remove_vpn?key=PUBLIC_KEY&id=VPN_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--25"><div dir="auto">---

</div></div>#### 23. update\_ip

Creates a ddclient record and/or updates the IP address for it.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-13"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**ip** </span>- new dynamic IP address of a User.  
    If the IP address is already in use by another ddclient record, it will be removed and assigned to this User.

</div></div>2 optional parameters can be used:

<div dir="auto" id="bkmrk-hostname%C2%A0--custom-na"><div dir="auto">- <span style="color: #3598db;">**hostname** </span>- the custom name of the ddclient record (e.g. John Doe).  
    Must be specified in order to update the IP address of a certain ddclient record.   
    If not used, the hostname will be empty. You can have only one hostname with an empty name.
- <span style="color: #3598db;">**profile** </span>- filtering policy ID.  
    If not used, the Default filtering policy will be assigned.

</div></div>Example: `curl "https://www.safedns.com/provider_api/update_ip?key=PUBLIC_KEY&ident=ACCOUNT_NAME&ip=IP_ADDRESS&hostname=John Doe&profile=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--26"><div dir="auto">---

</div></div>#### 24. update\_nat

Updates a filtering policy of the specified NAT DNS address.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--filteri"><div dir="auto">- <span style="color: #e03e2d;">**profile\_id** </span>- filtering policy ID.
- <span style="color: #e03e2d;">**address </span>- NAT DNS IP address.

</div></div>Example: `curl "https://www.safedns.com/provider_api/update_nat?key=PUBLIC_KEY&profile_id=POLICY_ID&address=NAT_DNS_IP"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--27"><div dir="auto">---

</div></div>#### 25. get\_activity

Gets User’s stats for a certain date.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-14"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>2 optional parameters are used:

<div dir="auto" id="bkmrk-date%C2%A0--date%2C-for-whi"><div dir="auto">- <span style="color: #3598db;">**date** </span>- date, for which a User’s activity report is required, in YYYY-MM-DD format.  
    If not used, the report will be formed for the current date.
- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be formed of all policies.

</div></div><p class="callout info">If no optional parameter is used, a report will be formed for the current date and of all policies.</p>

Example: `curl "https://www.safedns.com/provider_api/get_activity?key=PUBLIC_KEY&ident=ACCOUNT_NAME&date=YYYY-MM-DD&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"requests": "2600",
			"blocks": "581"
		}
	}
}
```

<p class="callout info">Where **requests** is the total number of requests for a given date, and **blocks** is the number of blocks out of total requests.</p>

<div dir="auto" id="bkmrk--28"><div dir="auto">---

</div></div>#### 26. get\_activity\_report

Gets User's activity report for a certain time range.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-15"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**start** </span>- start date (inclusive), in YYYY-MM-DD format.
- <span style="color: #e03e2d;">**end** </span>- end date (inclusive), in YYYY-MM-DD format.

</div></div>1 optional parameter is used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--filteri-0"><div dir="auto">- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be formed of all policies.

</div></div><p class="callout info">If the range **start** - **end** is more than 30 days, then only the last 30 days will be included in the report.</p>

Example: `curl "https://www.safedns.com/provider_api/get_activity_report?key=PUBLIC_KEY&ident=ACCOUNT_NAME&start=YYYY-MM-DD&end=YYYY-MM-DD&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"labels": [
				"2016-06-29 14:00:00",
				"2016-06-29 15:00:00"
			],
			"datasets": [
				{
					"label": "Requests",
					"data": [375, 275]
				},
				{
					"label": "Blocks",
					"data": [13, 0]
              }
			]
		}
	}
}
```

<p class="callout info">**labels** - a list of values for the timestamp.  
**datasets** - a list of dictionaries containing datasets of specific report parameters:  
*label* - the name of a report parameter,  
*data* - a list of parameters corresponding to dates from the **labels** list.</p>

<div dir="auto" id="bkmrk--29"><div dir="auto">---

</div></div>#### 27. get\_popular\_report

Gets the User's popular requests report for a certain time range.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-16"><div dir="auto">- **<span style="color: #e03e2d;">ident</span>** - User's account login.
- <span style="color: #e03e2d;">**start** </span>- start date (inclusive), in YYYY-MM-DD format.
- <span style="color: #e03e2d;">**end** </span>- end date (inclusive), in YYYY-MM-DD format.

</div></div>1 optional parameter is used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--filteri-1"><div dir="auto">- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be formed of all policies.

</div></div><p class="callout info">If the range **start** - **end** is more than 30 days, then only the last 30 days will be included in the report.</p>

Example: `curl "https://www.safedns.com/provider_api/get_popular_report?key=PUBLIC_KEY&ident=ACCOUNT_NAME&start=YYYY-MM-DD&end=YYYY-MM-DD&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"labels": [
				"example.com",
            	"google.com",
            	"asdfg.com"
			],
			"datasets": [
				{
					"label": "Requests",
					"data": [630, 474, 290]
				},
				{
					"label": "NXdomain",
					"data": [0, 0, 290]
				},
				{
					"label":"Blocks",
					"data":[630, 0, 0]
				}
			]
		}
	}
}
```

<p class="callout info">**labels** - a list of values for the timestamp.  
**datasets** - a list of dictionaries containing datasets of specific report parameters:  
*label* - the name of a report parameter,  
*data* - a list of parameters corresponding to dates from the **labels** list.</p>

<div dir="auto" id="bkmrk--30"><div dir="auto">---

</div></div>#### 28. get\_category\_report

Gets User's categories report for a certain time range.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-17"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**start** </span>- start date (inclusive), in YYYY-MM-DD format.
- <span style="color: #e03e2d;">**end** </span>- end date (inclusive), in YYYY-MM-DD format.

</div></div>1 optional parameter is used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--filteri-2"><div dir="auto">- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be formed of all policies.

</div></div><p class="callout info">If the range **start** - **end** is more than 30 days, then only the last 30 days will be included in the report.</p>

Example: `curl "https://www.safedns.com/provider_api/get_category_report?key=PUBLIC_KEY&ident=ACCOUNT_NAME&start=YYYY-MM-DD&end=YYYY-MM-DD&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"Movies & Video": "5",
			"File Storage": "2",
			"Home & Family": "3"
		}
	}
}
```

<p class="callout info">**data** is a dictionary:  
*key* - category name.  
*value* - number of visits.</p>

<div dir="auto" id="bkmrk--31"><div dir="auto">---

</div></div>#### 29. send\_monthly\_stat

Sends Monthly Stats report to User’s email.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-18"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- <span style="color: #e03e2d;">**year** </span>- year, in YYYY format.
- <span style="color: #e03e2d;">**month** </span>- month, in MM format.

</div></div><p class="callout warning">The user must have an email address attached to the account.</p>

1 optional parameter can be used:

<div dir="auto" id="bkmrk-profile_id%C2%A0--filteri-3"><div dir="auto">- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be formed of all policies.

</div></div>User will receive a report in CSV format with stats for the specified month on their email.  
The report has the following columns: “Timestamp”, “Domain name”, “Visits”, “Blocks”, “Profile”, and “Categories”.

Example: `curl "https://www.safedns.com/provider_api/send_monthly_stat?key=PUBLIC_KEY&ident=ACCOUNT_NAME&year=YYYY&month=MM&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok"
	}
}
```

<div dir="auto" id="bkmrk--32"><div dir="auto">---

</div></div>#### 30. get\_daily\_stat

Gets a link to the User's Daily Stats report.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-date%C2%A0--date%2C-in-yyyy"><div dir="auto">- <span style="color: #e03e2d;">**date** </span>- date, in YYYY-MM-DD format.
- <span style="color: #e03e2d;">**ident** </span>- User's account login.

</div></div>2 optional parameters can be used:

<div dir="auto" id="bkmrk-email_to%C2%A0--email-gen"><div dir="auto">- <span style="color: #3598db;">**email\_to** </span>- email generated report to a specified email address.  
    If not used, a download link will be returned.
- <span style="color: #3598db;">**profile\_id** </span>- filtering policy ID.  
    If not used, the report will be generated for all policies.

</div></div>Example: `curl "https://www.safedns.com/provider_api/get_daily_stat?key=PUBLIC_KEY&date=YYYY-MM-DD&ident=ACCOUNT_NAME&email_to=EMAIL&profile_id=POLICY_ID"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"result": "link for download"
		}
	}
}
```

<div dir="auto" id="bkmrk--33"><div dir="auto">---

</div></div>#### 31. update\_subscription

Changes the billing plan and/or expiration date of Users.

3 optional parameters can be used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-19"><div dir="auto">- <span style="color: #3598db;">**ident** </span>- User's account login.  
    **If not used, all users of the Reseller account will be updated.**
- <span style="color: #3598db;">**plan** </span>- billing plan code (see Table of values for the plan parameter).  
    If not used, the billing plan will not be updated.
- <span style="color: #3598db;">**date** </span>- expiration date, in YYYY-MM-DD format. Must be greater than the current date.  
    If not used, the expiration date will not be updated.

</div></div><p class="callout info">If no parameters are used, users will not be updated.  
</p>

Examples:

**A specified User is updated with a billing plan and gets the expiration date.**  
`curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&ident=ACCOUNT_NAME&plan=BILLING_PLAN&date=YYYY-MM-DD"`

**A specified User is updated with a billing plan.**  
`curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&ident=ACCOUNT_NAME&plan=BILLING_PLAN"`

**A specified User gets the expiration date.**  
`curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&ident=ACCOUNT_NAME&date=YYYY-MM-DD"`

**All Users are updated with a billing plan and get the expiration date.**  
`curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&plan=BILLING_PLAN&date=YYYY-MM-DD"`

**All Users are updated with a billing plan.**  
`​curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&plan=BILLING_PLAN"`

**All Users get the expiration date.**  
`curl "https://www.safedns.com/provider_api/update_subscription?key=PUBLIC_KEY&date=YYYY-MM-DD"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"result": 0
      	{
		"jsonrpc": "1.9"
		}
	}
}
```

<div dir="auto" id="bkmrk--34"><div dir="auto">---

</div></div>
#### 32. forgot\_password

Sends a password reset email to a User.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0%E2%80%93-user%27s-accou-1"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>– User's account login.

</div></div>Example: `curl "https://www.safedns.com/provider_api/forgot_password?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"result": 0
      	{
		"jsonrpc": "1.9"
		}
	}
}
```

<p class="callout warning">If the User does not have an email attached to the account, the error message "Email not set" will be shown.</p>

<p class="callout warning">The User must have a unique email.</p>

---

#### 33. get\_blockpages

Gets the list of existing BlockPages.

1 mandatory parameter is used:

<div dir="auto" id="bkmrk-ident%C2%A0%E2%80%93-user%27s-accou-2"><div dir="auto"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>– User's account login.

</div></div></div>Example: `curl "https://www.safedns.com/provider_api/get_blockpages?key=PUBLIC_KEY&ident=ACCOUNT_NAME"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
			"name": "blockpage 1 name",
          	"id": "blockpage 1 id",
          	"profiles": ["filtering policy id 1 that uses blockpage 1", "policy id 2 that uses blockpage 1"],
          	"type": "blockpage 1 type"
		}
	}
}
```

---

#### 34. create\_blockpage

Creates a new blockpage.

3 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident---user%27s-accou"><div dir="auto">- <span style="color: #e03e2d;">**ident**</span> - User's account login.
- <span style="color: #e03e2d;">**name** </span>- blockpage name.
- <span style="color: #e03e2d;">**type** </span>- blockpage type (standard, personal, HTML, error, empty).

</div></div>1 optional parameter can be used:

<div dir="auto" id="bkmrk-description---descri"><div dir="auto">- <span style="color: #3598db;">**description** </span>- description for the personal or HTML blockpages.  
    Please note that the latest curl update requires %20 to be used instead of spaces.

</div></div>Example: `curl "https://www.safedns.com/provider_api/create_blockpage?key=PUBLIC_KEY&ident=ACCOUNT_NAME&name=BLOCKPAGE_NAME&type=BLOCKPAGE_TYPE&description=BLOCKPAGE_DESCRIPTION"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
          	"user_id": "user id",
          	"name": "blockpage name",
          	"username": "user account name",
          	"id": "blockpage id",
          	"type": "blockpage type"
		}
	}
}
```

---

#### 35. update\_blockpage

Updates parameters of the blockpage.

2 mandatory parameters are used:

<div dir="auto" id="bkmrk-ident%C2%A0--user%27s-accou-20"><div dir="auto">- <span style="color: #e03e2d;">**ident** </span>- User's account login.
- **<span style="color: #e03e2d;">blockpage\_id</span>** - blockpage ID.

</div></div>3 optional parameters can be used:

<div dir="auto" id="bkmrk-name---blockpage-nam"><div dir="auto">- <span style="color: #3598db;">**name** </span>- blockpage name.
- <span style="color: #3598db;">**type**</span> - blockpage type (standard, personal, HTML, error, empty).
- <span style="color: #3598db;">**description** </span>- blockpage description.  
    Please note that the latest curl update requires %20 to be used instead of spaces.

</div></div>Example: `curl "https://www.safedns.com/provider_api/update_blockpage?key=PUBLIC_KEY&ident=ACCOUNT_NAME&blockpage_id=BLOCKPAGE_ID&name=BLOCKPAGE_NAME&type=BLOCKPAGE_TYPE&description=BLOCKPAGE_DESCRIPTION"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": {
          	"type": "blockpage type",
          	"username": "user account name",
          	"name": "blockpage name",
          	"description": "blockpage description",
          	"id": "blockpage id",
          	"user_id": "user id"
		}
	}
}
```

#### 36. user\_list

Lists all created user accounts.

1 optional parameter can be used:

<div dir="auto" id="bkmrk-activity_status---ad"><div dir="auto">- <span style="color: #3598db;">**activity\_status** </span>- additional filter.  
    **<span style="color: #000000;">True</span>** displays all user accounts except inactive and with the "Paid period ended" plan.  
    <span style="color: #000000;">**False** </span>displays all inactive and "Paid period ended" plan accounts.  
    If not used, all created user accounts will be displayed.

</div></div>Example: `curl "https://www.safedns.com/provider_api/user_list?key=PUBLIC_KEY&activity_status=TRUE/FALSE"`

The response is returned in JSON format:

```JSON
{
	"response": {
		"status": "ok",
		"data": [{
          	"is_active": "activity status of the account",
          	"plan": "billing plan",
          	"username": "account username"
        }]
	}
}
```

<p class="callout info">see the Table of values at the beginning of the article for the billing plan codes</p>