WEDOS REST API is still in development. Access and features may change without notice.
This article partially covers the WEDOS.protection endpoint of WEDOS REST API. WEDOS.protection domains and members have their own articles. For WEDOS API (WAPI) see WAPI – WEDOS Protection.
For basic information anbout WEDOS REST API, consult the WEDOS REST API Manual.
In this article, you will find the following information:
- DNS Endpoint access
- DNS Endpoint details:
- Notes
WGP Endpoint Access
The WGP HTTP REST API v2 is used to manage domains, services and co-management invitations in WEDOS.protection (WGP).
Base URL and Authentication
The base URL for the WGP endpoints is: https://api.wedos.com/v2
Authentication uses only OAuth2: include a valid access token in the request header (Authorization: Bearer <TOKEN>) with the wgp scope. Without a valid token the API returns error 2000.
You can add the parameter example=1 to any endpoint as a GET parameter (?example=1 for endpoints without their own GET parameters, otherwise &example=1). The API then returns a sample curl command for that call without requiring real parameters. Valid authentication is required even in this mode.
Endpoint Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /services | List of your standalone WGP services |
| POST | /services/{service_id}/cache/purge | Purge the CDN cache |
| POST | /services/{service_id}/renew | Renew a service |
| POST | /services/{service_id}/template-replicate | Replicate settings from a template domain |
| PATCH | /services/{service_id} | Change the service’s subscription variant/period |
| DELETE | /services/{service_id} | Delete/terminate a service |
Response format
The API response is always a JSON object with the keys code (return code), msg (text description), request_id (request identifier) and, where applicable, data (returned data on success).
General return codes valid for all endpoints (REST layer, independent of the specific operation):
1000– success (OK)2000– authentication (OAuth2 Bearer token) missing or invalid2004– maximum request size exceeded (URL or request body)4000– unknown/unsupported API method (the called combination of HTTP method and path does not exist)4001– input validation failed4005– no example available for the current endpoint inexample=1mode6000– internal error initializing the underlying WAPI command
In addition, each endpoint returns its own business codes specific to the operation (corresponding to the underlying WAPI command). These are listed under Return codes for each endpoint.
GET /services
Returns a list of the logged-in OAuth2 user’s own standalone WEDOS Global Protection services (created directly as a WGP service, table hosting_wedos_protection).
Parameters:
status– optional, query – filter by a specific service status (the value is not validated against the status code list)
Return codes:
1000– OK
Response data: An array of services; each item contains ID, name, status, expiration.
Example:
curl -X GET -H 'Authorization: Bearer <TOKEN>' \
'https://api.wedos.com/v2/wgp/services?status=active'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": [
{
"ID": 435,
"name": "domain1.tld",
"status": "active",
"expiration": "2027-10-01 00:00:00"
}
]
}
POST /services/{service_id}/cache/purge
Purges the CDN cache for a domain connected to WGP. It can target either a standalone WGP service or a domain with WGP as an add-on (hosting_domain); the service type is set with the service_type parameter.
Parameters:
service_id– required, path – local service IDservice_type– optional – service type,hosting_wedos_protection(default) orhosting_domainlimiter_decay– optional, number – time in seconds during which repeated purging is limited; default 5limiter_reset– optional, bool – cancel the current limit; defaultfalse
Return codes:
1000– OK2100– required parameter missing2101– invalid parameter value2406– domain/service not found2415– the limiter is still running – purging cannot be repeated right now3223– the service belongs to another customer account2400– internal error – unregistered return code
Response data:
domain– domain namedomain_id– domain ID in WGPdomain_tld– domain TLDservice_id– service IDwedos_client_id– client ID in WGPlimiter_available_in– in how many seconds the function can be used again (documented only for error2415; however, the current implementation does not return the data part on error, see Notes)
Example:
curl -X POST -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' \
'https://api.wedos.com/v2/wgp/services/435/cache/purge' \
--data '{"limiter_decay":5,"limiter_reset":0}'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"domain": "domain1.tld",
"domain_id": 98765,
"domain_tld": "tld",
"service_id": 435,
"wedos_client_id": 10234
}
}
POST /services/{service_id}/renew
Renews the WGP service for another billing period.
Parameters:
service_id– required, path – service ID
Return codes:
1000– OK2100– required parameter missing2101– invalid parameter value2152– renewal is not allowed in the service’s current state2279– the prepaid account is locked2281– the prepaid account is not active2282– cannot pay from the prepaid account in the given currency2283– insufficient prepaid account balance2284– error in the prepaid account’s contact details2293– cannot get the prepaid account credit balance2297– cannot determine whether the prepaid account includes VAT2406– service not found2409– service renewal failed
Response data:
service_id– service IDname– domain namedate_from,date_to– validity dates of the new periodfakt_order_num– renewal order numbercurrency– prepaid account currencyprice– renewal amountcredit– prepaid account balance afterwards (nullfor FREE/TRIAL services)
Example:
curl -X POST -H 'Authorization: Bearer <TOKEN>' \
'https://api.wedos.com/v2/wgp/services/435/renew'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"service_id": 435,
"name": "domain1.tld",
"date_from": "2027-10-01",
"date_to": "2028-10-01",
"fakt_order_num": "2026123457",
"currency": "CZK",
"price": 499,
"credit": 502
}
}
POST /services/{service_id}/template-replicate
Replicates (applies) the settings of a template domain to an existing WGP domain/service.
Parameters:
service_id– required, path – ID of the service the settings are replicated totemplate_domain_id– required – template domain ID (see GET /domains/templates)service_type– optional – service type,hosting_wedos_protection(default) orhosting_domain
Return codes:
1000– OK2100– required parameter missing2101– invalid parameter value2401– invalid domain for replication2402– invalid template domain2403– user mismatch between the domain and the template domain2404– subscription plan mismatch between the domain and the template domain2405– daily replication limit reached2406– domain/service not found2407– template domain not found2400– internal error – unregistered return code
Response data:
domain– domain namedomain_id– domain IDservice_id– service IDservice_type– service typetemplate_domain_id– ID of the template domain usedreplications_count– number of replications performed so farreplications_limit– maximum number of replications allowed
Example:
curl -X POST -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' \
'https://api.wedos.com/v2/wgp/services/435/template-replicate' \
--data '{"template_domain_id":123}'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"domain": "domain1.tld",
"domain_id": 98765,
"service_id": 435,
"service_type": "hosting_wedos_protection",
"template_domain_id": 123,
"replications_count": 2,
"replications_limit": 5
}
}
PATCH /services/{service_id}
Changes the variant and/or subscription period of an existing WGP service.
Parameters:
service_id– required, path – service IDnew_variant_id– optional, number – new service variantnew_period_id– optional, number – new subscription period
At least one of new_variant_id/new_period_id must be given.
Return codes:
1000– OK2100– required parameter missing2101– invalid parameter value2203– invalid value ofnew_period_id2273– invalid value ofnew_variant_id2279– the prepaid account is locked2281– the prepaid account is not active2282– cannot pay from the prepaid account in the given currency2283– insufficient prepaid account balance2284– error in the prepaid account’s contact details2293– cannot get the prepaid account credit balance2294– cannot get the service price2406– domain/service not found2408– parameternew_variant_idornew_period_idmissing (neither was given)2400– internal error – unregistered return code
Response data:
domain– domain namedomain_id– domain IDwedos_client_id– client ID in WGPservice_id– service IDservice_type– service typevariant_id– current service variant ID after the changeperiod_id– current subscription period ID after the changedirty– flag showing whether a change actually happened (0= unchanged,1= changed)
Example:
curl -X PATCH -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' \
'https://api.wedos.com/v2/wgp/services/435' \
--data '{"new_variant_id":2,"new_period_id":1}'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"domain": "domain1.tld",
"domain_id": 98765,
"wedos_client_id": 10234,
"service_id": 435,
"service_type": "hosting_wedos_protection",
"variant_id": 2,
"period_id": 1,
"dirty": 1
}
}
DELETE /services/{service_id}
Deletes/terminates a WGP service at the customer’s request.
Parameters:
service_id– required, path – service IDforce– optional, query, 0/1 – forces deletion even when WGP has no token available for rewriting DNS (restoring A/AAAA records to their original values)
Return codes:
1000– OK2100– required parameter missing2292– the domain was not found in WGP for this customer account2400– internal error2410– service not found2411– no token available for rewriting DNS2412– the API request for rewriting DNS failed2413– the command cannot be executed, WGP lacks permission to manipulate the domain’s DNS (force=1required)2414– no token exists for WGP and theforceparameter was not given3223– the service belongs to another customer account
Response data:
domain– domain namedomain_id– domain IDwedos_client_id– client ID in WGPservice_id– service IDservice_type– service typewdns_data– array of DNS record changes made (IP addresses that stop resolving via WGP after it is cancelled)
Example:
curl -X DELETE -H 'Authorization: Bearer <TOKEN>' \
'https://api.wedos.com/v2/wgp/services/435?force=1'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"domain": "domain1.tld",
"domain_id": 98765,
"wedos_client_id": 10234,
"service_id": 435,
"service_type": "hosting_wedos_protection",
"wdns_data": []
}
}
Notes
- GET /services returns only standalone WGP services. Domains that have WGP connected as an add-on to another service are not in this list, and no similar list endpoint exists for them.
- POST /services/{service_id}/cache/purge and POST /services/{service_id}/template-replicate are addressed directly by service_id (not by domain) and support the service_type parameter to distinguish between a standalone WGP service and a domain with WGP as an add-on. The corresponding WAPI command looks up ownership by user_id itself.
- For POST /services/{service_id}/cache/purge, the documentation comment of cmd_purge_cache() also mentions the limiter_available_in field in the response data for error 2415, but the current implementation returns only the bare error code without a data part in this case – so the field does not actually appear in the response.
