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 stringrequireddom_…) to update. At least one.contactsobjectrequiredcontacts. First name, last name, e-mail, phone number, street, city, postal code and country code are required.firstNamestringrequiredlastNamestringrequiredcompanyNamestringemailstringrequiredphoneNumberstringrequiredstreetstringrequiredaddress2stringcitystringrequiredpostalCodestringrequiredstatestringcountryCodestringrequiredExample
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.
{ "operation": { "status": "pending", "jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3" }, "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.domainsQueuedinteger or nullErrors
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. |
| 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. |