Skip to content

Set auto-renew on several domains

POST /api/v2/domains/bulk/autorenew

Turn auto-renew on or off for several domains in one call. The call queues one job and returns 202. Follow it at operation.pollUrl (Jobs). The whole batch is rejected when any domain ID is invalid or not in your account.

Auto-renew cannot be turned on for a domain that is still pending. One pending domain rejects the batch with 409 auto_renew_unavailable.

When you turn auto-renew off, pendingOrderAction decides what happens to unpaid renewal invoices. With block (the default) nothing changes when a domain has one. The job then finishes with pendingOrdersFound: true and lists those orders in pendingOrders. Send the request again with keep to leave the invoices open. Send cancel to cancel the renewal orders before auto-renew is turned off. A renewal order whose invoice is already paid is not cancelled. Auto-renew is still turned off for that domain. The job result says which orders were cancelled.

Authentication: An API key with the scope write:domains. Also write:billing: only when enabled is false and pendingOrderAction is cancel. About keys and scopes

Request

Body

domainIdsarray of stringrequired
Domain IDs (dom_…) to change. At least one.
enabledbooleanrequired
true turns auto-renew on. false turns it off.
pendingOrderActionstring
What to do with unpaid renewal invoices when enabled is false. block (default) changes nothing and lists them in the job result. keep turns auto-renew off and leaves the invoices open. cancel cancels the renewal orders first. A contact (sub-account) also needs permission to place orders to use cancel. One of block, keep, cancel.
confirmCancelPendingboolean
Older form of pendingOrderAction: "cancel". Ignored when pendingOrderAction is set.

Example

POST /api/v2/domains/bulk/autorenew
curl -X POST "https://cloud.hostup.se/api/v2/domains/bulk/autorenew" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domainIds": [
"dom_01hxa3b4c5d6e7f8g9h0j1k2m3"
],
"enabled": true
}'

Responses

200 Not a response of this call. This is the job result at operation.pollUrl when a block request found unpaid renewal invoices. Nothing was changed. Send the request again with pendingOrderAction set to keep or cancel.

Response 200
{
"pendingOrdersFound": true,
"pendingOrders": [
{
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"domainName": "example.se",
"orderId": "ord_01hxa3b4c5d6e7f8g9h0j1k2m4",
"orderNumber": "123456",
"invoiceId": "inv_01hxa3b4c5d6e7f8g9h0j1k2m5",
"invoiceNumber": "202600001",
"invoiceStatus": "Unpaid",
"billing": {
"amount": 129,
"currencyCode": "SEK"
},
"createdAt": "2026-04-27T12:00:00.000Z"
}
]
}
Response fields
pendingOrdersFoundboolean
Always true in this result. One of true.
pendingOrdersarray of object
domainIdstring or null
Domain ID.
domainNamestring or null
Domain name.
orderIdstring or null
ID of the renewal order.
orderNumberstring or null
Order number shown in the client area.
invoiceIdstring or null
ID of the unpaid renewal invoice.
invoiceNumberstring or null
Invoice number shown in the client area.
invoiceStatusstring or null
Invoice status, for example Unpaid.
billingobject
amountnumber or null
Invoice total.
currencyCodestring
ISO 4217 currency code.
createdAtstring or null
When the renewal order was created.

202 Job queued. Follow it at operation.pollUrl.

Response 202
{
"operation": {
"status": "pending",
"jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3"
},
"enabled": false,
"domainsQueued": 2
}
Response fields
operationobject
statusstring
Where the job is. A 202 Accepted response only has pending, queued or in_progress. completed and failed appear when you poll pollUrl. They also appear in a 200 OK response when the action finished during the request. One of pending, queued, in_progress, completed, failed.
jobIdstring
pollUrlstring or null
Where to poll the job while it runs. null when status is already completed or failed.
enabledboolean
The auto-renew state you asked for.
domainsQueuedinteger
Number of domains in the job.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
409A selected domain is still pending. Auto-renew can be turned on once it is active.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.