# Proxy limit

## Proxy limit

<mark style="color:blue;">`GET`</mark> `https://mobile.proxy-seller.com/api/v1/proxyLimits/{id}`

This request returns the limits of the specified authorization (user) by id

**Example**

```
https://mobile.proxy-seller.com/api/v1/proxyLimits/652319f04cb7965413432168
```

**Path parameters**

| Name                                 | Type   | Description       |
| ------------------------------------ | ------ | ----------------- |
| id<mark style="color:red;">\*</mark> | String | Id of proxy limit |

**Headers**

<table><thead><tr><th width="371">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization<mark style="color:red;">*</mark></td><td><code>&#x3C;YOUR_API_TOKEN></code></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": "652319f04cb7965413432168",
  "ownerId": "62326bcaf3904578675f9ef7",
  "speedLimit": 10000,
  "trafficLimit": 10000
}
```

{% endtab %}

{% tab title="401" %}

```
AUTHORIZATION_FAILED,
IP_AUTHORIZATION_FAILED,
HOST_USER_ID_AND_AUTH_DOES_NOT_MATCH
```

{% endtab %}

{% tab title="404" %}

```
PROXY_LIMIT_NOT_FOUND,
MODEM_AUTH_NOT_FOUND_FOR_PROXY_LIMIT,
INVALID_MODEM
```

{% endtab %}
{% endtabs %}

## Create limit

<mark style="color:green;">`POST`</mark> `https://mobile.proxy-seller.com/api/v1/proxyLimits`

This request ecnfyfdkbdftn the limits of the specified authorization (user) on the specified modem.&#x20;

{% hint style="danger" %}
Attention: setting at least one limit on the modem authorization will reset the modem limit setting, if it is set.
{% endhint %}

**Example**

```
https://mobile.proxy-seller.com/api/v1/proxyLimits
```

**Headers**

<table><thead><tr><th width="371">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization<mark style="color:red;">*</mark></td><td><code>&#x3C;YOUR_API_TOKEN></code></td></tr></tbody></table>

**Request body**

| Name                                           | Type            | Description                                                         |
| ---------------------------------------------- | --------------- | ------------------------------------------------------------------- |
| modemAuthIds<mark style="color:red;">\*</mark> | Array of String | Array of modem authorization IDs on which the limit will be written |
| modemId<mark style="color:red;">\*</mark>      | String          | id of modem                                                         |
| speedLimit<mark style="color:red;">\*</mark>   | Number          | modem speed limit in bits                                           |
| trafficLimit<mark style="color:red;">\*</mark> | Number          | traffic speed limit in bits                                         |

**Example request body**

```json
{
    "modemId": "63c234098746e15666325bf9f",
    "modemAuthIds": ["62326bcaf3904578675f9ef7"],
    "speedLimit": "100000",
    "trafficLimit": "200000"
    
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "failedModemAuths": []
}
```

{% endtab %}

{% tab title="401" %}

```
AUTHORIZATION_FAILED,
IP_AUTHORIZATION_FAILED,
HOST_USER_ID_AND_AUTH_DOES_NOT_MATCH,
MODEM_HAVE_INSUFFICIENT_PRIVILEGES
```

{% endtab %}

{% tab title="400" %}

```
INVALID_MODEM_AUTH_IDS
```

{% endtab %}

{% tab title="404" %}

```
MODEM_NOT_FOUND,
RATE_NOT_FOUND,
MODEM_AUTH_NOT_FOUND,
```

{% endtab %}
{% endtabs %}
