Skip to content

Renew several domains

POST /api/v2/domains/bulk/renew

Order a renewal for several domains in one call. The call checks each domain, queues a job and returns 202. Follow it at operation.pollUrl (Jobs). The job puts the domains that can be renewed on one renewal order with one invoice. They are renewed when the invoice is paid.

A domain that cannot be renewed does not stop the batch. It is listed in skipped with a reason. Examples are a domain that is not in your account, a domain that already has an unpaid renewal invoice and a renewal that would put the expiry date more than 10 years ahead. When every domain is skipped, nothing is ordered. The call then returns 200 with operation: null and allSkipped: true. The job result can list more skipped domains, for example when a renewal invoice was created in the meantime.

A contact (sub-account) also needs permission to place orders.

Authentication: An API key with the scopes write:domains and write:billing. About keys and scopes

Request

Body

domainIdsarray of stringrequired
Domain IDs (dom_…) to renew. At least one.

Example

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

Responses

200 Every domain was skipped. Nothing was ordered and no job was queued.

Response 200
{
"operation": null,
"domainsQueued": 0,
"domainsSkipped": 1,
"skipped": [
{
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m4",
"domainName": null,
"reason": "This domain is not available for renewal from this account.",
"orderNumber": null,
"invoiceId": null
}
],
"allSkipped": true
}
Response fields
operationnull
Always null here.
domainsQueuedinteger
Always 0 here.
domainsSkippedinteger
Number of domains in skipped.
skippedarray of object
Domains that were not renewed, with the reason.
domainIdstring or null
Domain ID. null when the ID you sent could not be read.
domainNamestring or null
Domain name, when known.
reasonstring
Why the domain was not renewed.
orderNumberstring or null
Number of the existing renewal order, when that is the reason.
invoiceIdstring or null
ID of the existing unpaid renewal invoice, when that is the reason.
allSkippedboolean
Always true here.

202 Renewal job queued for the domains that can be renewed. skipped lists the rest.

Response 202
{
"operation": {
"status": "pending",
"jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3"
},
"domainsQueued": 1,
"domainsSkipped": 1,
"skipped": [
{
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m4",
"domainName": "example.nu",
"reason": "Already has pending renewal invoice (Order #123456)",
"orderNumber": "123456",
"invoiceId": "inv_01hxa3b4c5d6e7f8g9h0j1k2m5"
}
],
"allSkipped": false
}
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.
domainsQueuedinteger or null
Number of domains in the job.
domainsSkippedinteger
Number of domains in skipped.
skippedarray of object
Domains that were not put on the order.
domainIdstring or null
Domain ID. null when the ID you sent could not be read.
domainNamestring or null
Domain name, when known.
reasonstring
Why the domain was not renewed.
orderNumberstring or null
Number of the existing renewal order, when that is the reason.
invoiceIdstring or null
ID of the existing unpaid renewal invoice, when that is the reason.
allSkippedboolean
false when a job was queued.

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.
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.