Skip to content

Update contacts on several domains

POST /api/v2/domains/bulk/contacts

Write one contact to several domains. Send the domain IDs in domainIds and the contact in contacts as a flat contact patch object, with fields such as contacts.email. Do not nest fields under contact roles such as contacts.registrant. The same ordinary contact fields are written to the registrant, admin, tech and billing contacts of every domain. Use POST /api/v2/domains/{id}/contacts when the roles need different contacts.

Send every required field, even the ones that stay the same. To change one field, read the current contact with POST /api/v2/domains/bulk/contacts/read first. The registrant’s personal or organisation number stays as it is. registrationIdentifier is not part of this bulk operation. Change it per domain with POST /api/v2/domains/{id}/contacts.

The whole batch is rejected when any domain ID is invalid or not in your account. Domains that are not active or suspended are skipped. When none is left, the call returns 400. Otherwise it queues one job and returns 202. Follow it at operation.pollUrl (Jobs).

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

Request

Body

domainIdsarray of stringrequired
Domain IDs (dom_…) to update. At least one.
contactsobjectrequired
The contact, with camelCase fields directly under contacts. First name, last name, e-mail, phone number, street, city, postal code and country code are required.
firstNamestringrequired
First name.
lastNamestringrequired
Last name.
companyNamestring
Company name. Leave out for a private person.
emailstringrequired
E-mail address.
phoneNumberstringrequired
Phone number with country code.
streetstringrequired
Street address.
address2string
Second address line.
citystringrequired
City.
postalCodestringrequired
Postal code.
statestring
State or region.
countryCodestringrequired
Country as an ISO 3166-1 alpha-2 code.

Example

POST /api/v2/domains/bulk/contacts
curl -X POST "https://cloud.hostup.se/api/v2/domains/bulk/contacts" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domainIds": [
"dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"dom_01hxa3b4c5d6e7f8g9h0j1k2m4"
],
"contacts": {
"firstName": "Alex",
"lastName": "Example",
"email": "alex@example.se",
"phoneNumber": "+46700000000",
"street": "Examplegatan 1",
"city": "Stockholm",
"postalCode": "11122",
"countryCode": "SE"
}
}'

Responses

202 Job queued. Follow it at operation.pollUrl.

Response 202
{
"operation": {
"status": "pending",
"jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3"
},
"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.
domainsQueuedinteger or null
Number of domains in the job. Domains that are not active or suspended are not counted.

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.