Skip to main content

saveIpRestrictions

IpRestrictionsWrapper saveIpRestrictions(IpRestrictionsDto)

PUT /api/2.0/settings/iprestrictions

Save IP restrictions

Replaces the whole IP restriction list of the current portal with the addresses from the request and stores the enforcement flag in the same call. The caller needs the portal-settings right of a DocSpace administrator, otherwise the call is refused. Every entry must be a single IPv4 or IPv6 address: from-to ranges and CIDR blocks are matched by the portal but cannot be stored here and are rejected as an invalid request, as is enable: true with an empty list. An omitted enable follows the list - on when addresses are sent, off when the list is empty. The replacement is written in one transaction, applies to new requests without a restart and is recorded in the audit trail; entries not repeated in the body are deleted, and sending the same body twice leaves the portal as it is. Enforcement spares the portal owner and the installation's own networks only, so a list without the caller's own address locks the remaining administrators out. The answer echoes the request rather than the stored rows - no entry IDs, and enable exactly as sent, empty when it was omitted - so read the result with GET api/2.0/settings/iprestrictions.

Parameters​

NameInTypeDescriptionNotes
IpRestrictionsDtobodyIpRestrictionsDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The saved addresses and enforcement flag echoed back exactly as sent, without the IDs of the stored entriesIpRestrictionsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no ipRestrictions, an entry is not a single IPv4 or IPv6 address, or enable is true with an empty list--
403The caller has no portal-settings right--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

IpRestrictionsWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json