Skip to navigation
EndpointSet data quota

Set data quota

Required permissions Beta Learn more

Endpoint.Quota.Data + Create

Roles: Administrator User

Sets the data quota of an endpoint and replaces any existing data quota. When apply_data_quota is enabled in the service profile, the device needs an ACTIVE quota with volume left to use data services. A new ACTIVE quota takes effect as soon as the request succeeds.

To top up a quota, retrieve the remaining volume, add the top-up volume, and send the sum as the new volume. Send threshold_percentage again, or the earlier threshold volume stays in place.

If you set threshold_percentage, the system generates a “Quota threshold reached” event when the remaining volume drops below it. When the volume runs out, the system generates a “Quota used up” event and blocks the device from using data services. Both events include the quota in their details.

Since December 9, 2024, throttling isn’t available as an action on quota exhaustion, and the API ignores the peak throughput parameter. A request with action_on_exhaustion.id set to 2 fails with a 422 error.

Authentication

AuthorizationBearer

An auth_token should be provided to authenticate a session.

To obtain an auth_token, see the /api/v1/authenticate POST request.

Path parameters

endpoint_idintegerRequired
Numeric ID of an endpoint

Request

This endpoint expects an object.
statusobjectRequired

Status to set for the quota. To let the device use the quota, set id to 1.

volumefloatRequired

Volume of the quota in MB. To top up a quota, send the remaining volume plus the top-up volume.

expiry_datestringRequired

When the quota expires, in UTC. After this time, the device can’t use data services, even if volume remains. Use any future time to create a package of any length, such as 1 hour, 24 hours, or 7 days. Accepts YYYY-MM-DD HH:MM:SS or ISO 8601. The API ignores any time zone offset and always reads the time as UTC.

action_on_exhaustionobjectRequired
What happens when the quota volume runs out.
auto_refillenumOptional

Whether the quota refills daily with the last added volume. 0 disables auto-refill and 1 enables it. You can also send false or true. If you leave it out, a new quota has auto-refill disabled and an existing quota keeps its setting. A top-up also changes the refill volume, because the quota refills to the last volume you sent.

Allowed values:
threshold_percentageintegerOptional

Percentage of volume below which the system generates a “Quota threshold reached” event. For example, 15 with a volume of 100 generates the event when less than 15 MB remain. If you leave it out, a new quota has no threshold and an existing quota keeps its earlier threshold volume, so include it in every top-up.

Response

The data quota is set.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error