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 stringrequireddom_…) to change. At least one.enabledbooleanrequiredtrue turns auto-renew on. false turns it off.pendingOrderActionstringenabled 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.confirmCancelPendingbooleanpendingOrderAction: "cancel". Ignored when pendingOrderAction is set.Example
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 }'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": false, "pendingOrderAction": "cancel" }'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": false, "pendingOrderAction": "keep" }'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.
{ "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
pendingOrdersFoundbooleantrue in this result. One of true.pendingOrdersarray of objectdomainIdstring or nulldomainNamestring or nullorderIdstring or nullorderNumberstring or nullinvoiceIdstring or nullinvoiceNumberstring or nullinvoiceStatusstring or nullUnpaid.billingobjectamountnumber or nullcurrencyCodestringcreatedAtstring or null202 Job queued. Follow it at operation.pollUrl.
{ "operation": { "status": "pending", "jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3" }, "enabled": false, "domainsQueued": 2}Response fields
operationobjectstatusstring202 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.jobIdstringpollUrlstring or nullnull when status is already completed or failed.enabledbooleandomainsQueuedintegerErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | A selected domain is still pending. Auto-renew can be turned on once it is active. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |