Update a domain's contacts
POST /api/v2/domains/{id}/contacts
Change the contacts of a domain: the holder (registrant) and the admin, tech and billing contacts. Send at least one role with only the fields you change. Unknown fields are rejected. Check actions.canEditContacts on GET /api/v2/domains/{id}/contacts first. On .se, .nu and .test domains postal address fields are ignored. A body with only address fields returns 400 invalid_request there.
On .se, .nu and .test domains, changing the holder’s personal or organisation number needs BankID. Without it the other fields are saved and the number is kept. updateOutcome.registrantRegistrationIdentifierApplied is then false with the reason identity_verification_required.
A different Swedish personal or organisation number on a .se or .nu domain changes the registered holder. The domain stays in your account. Only the account owner can make this change, logged in to the client area. With an API key the call returns 409 holder_change_session_required. The change needs the current holder’s consent. It also needs acceptedRegistryTerms once the new holder has accepted the registry terms. Until both are in place the call returns 400 holder_change_verification_required. holderChange in the body lists what is missing.
The response is the updated contacts with updateOutcome.
Authentication: An API key with the scope write:domains. About keys and scopes
Request
Path parameters
idstringrequireddom_…).Body
registrantnulladminnulltechnullbillingnullacceptedRegistryTermsarray of string["se_registration_terms"]. Send the key from holderChange.terms.key in the holder_change_verification_required problem after the holder has ticked the terms box. Ignored for ordinary contact changes.Example
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/contacts" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "registrant": { "firstName": "Alex", "lastName": "Example", "companyName": "Example AB", "email": "alex@example.se", "phoneNumber": "+46700000000", "street": "Examplegatan 1", "city": "Stockholm", "postalCode": "12345", "countryCode": "SE" } }'curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/contacts" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "registrant": { "email": "owner@example.se", "phoneNumber": "+46700000000" }, "tech": { "email": "tech@example.se", "phoneNumber": "+46700000001", "countryCode": "SE" } }'curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/contacts" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "registrant": { "firstName": "Alex", "lastName": "Example", "companyName": "Example AB", "email": "alex@example.se", "phoneNumber": "+46700000000", "registrationIdentifier": { "value": "559000-1234", "countryCode": "SE", "type": "organization_number" } }, "acceptedRegistryTerms": [ "se_registration_terms" ] }'Responses
200 The updated contacts with updateOutcome.
{ "registrant": { "firstName": "Alex", "lastName": "Example", "companyName": "Example AB", "email": "alex@example.se", "phoneNumber": "+46700000000", "street": "Examplegatan 1", "address2": null, "city": "Stockholm", "postalCode": "123 45", "state": null, "countryCode": "SE", "registrationIdentifier": { "value": "559000-1234", "countryCode": "SE", "type": "organization_number" } }, "admin": null, "tech": null, "billing": null, "draft": false, "serviceStatus": "active", "contactDetailsVerification": null, "actions": { "canEditContacts": { "allowed": true, "reason": null }, "requiresIdentityVerification": { "allowed": true, "reason": "BankID verification is required before updating the registrant's personal or organisation number." } }, "updateOutcome": { "syncTriggered": false, "orderActivation": null, "registrantRegistrationIdentifierApplied": null, "registrantRegistrationIdentifierBlockedReason": null, "holderChanged": false }}Response fields
registrantnulladminnulltechnullbillingnulldraftbooleanserviceStatusstringactive, suspended, expired, pending, cancelled, terminated, unknown.contactDetailsVerificationnullactionsobjectcanEditContactsobjectallowedbooleanreasonstring or nullcodestring or nullrequiresIdentityVerificationobjectallowed: true means identity verification is needed before the registrant’s personal identity number or organisation number can change. Today that is BankID, for .se, .nu and .test domains.allowedbooleanreasonstring or nullcodestring or nullupdateOutcomenullErrors
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; code is domain_not_found. |
| 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. |