Skip to content

Update account preferences

PATCH /api/v2/me/preferences

Changes one or more account preferences. Send only the fields you want to change. The response holds all preferences, as GET /api/v2/me/preferences returns them. billing.separateInvoices.enabled: false puts domain renewals on one combined monthly invoice. true gives each domain renewal its own invoice. After you change billing.cardAutoCharge.configured, read billing.cardAutoCharge.status in the response. Automatic card payments need a saved card. To choose which e-mails the account gets, send notifications.delivery. Send overrideEnabled: false to return to defaults, which send every category.

Authentication: An API key with one of these scopes: write:account, write:billing. About keys and scopes

Request

Body

localizationobject
Language and timezone.
languageCodestring
Language for the client area and e-mails: sv or en. One of sv, en.
timezonestring
Timezone name, for example Europe/Stockholm. 1 to 50 characters.
notificationsobject
Notification settings.
emailEnabledboolean
General e-mail notification setting.
smsEnabledboolean
General SMS notification setting.
deliveryobject
Which e-mail categories the account gets.
overrideEnabledboolean
false goes back to the default, which sends every category. true saves the list in enabledEmails.
enabledEmailsarray of string
The categories to send. Required when overrideEnabled is true.
securityobject
Stored security preference flags.
bankIdOnlyLoginboolean
A stored preference flag. It does not change how anyone signs in. Setting it to true needs a fresh BankID sign-in in the client area and is refused for an API key.
twoFactorEnabledboolean
A stored preference flag. It does not turn two-factor login on or off.
billingobject
Invoice delivery and billing automation.
peppolobject
Peppol e-invoice choices. Same as PATCH /api/v2/me/preferences/peppol.
optedOutboolean
true stops new invoices from going out as Peppol e-invoices.
creditNotesOptedOutboolean
true stops credit notes from being sent automatically. Default false.
cardAutoChargeobject
Automatic card payments.
configuredboolean
true charges the saved card automatically when invoices are due. Without a saved card the response shows status: needs_payment_method.
separateInvoicesobject
How domain renewals are invoiced.
enabledboolean
false combines domain renewals on one monthly invoice. true gives each domain renewal its own invoice.
categoriesobject
Free-form settings for your own client: general, ui, notifications, billing or dashboard, each an object of key-value pairs. Keys use letters, digits and underscores, up to 100 characters.

Example

PATCH /api/v2/me/preferences
curl -X PATCH "https://cloud.hostup.se/api/v2/me/preferences" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"billing": {
"separateInvoices": {
"enabled": false
}
}
}'

Responses

200 All account preferences after the change.

Response 200
{
"localization": {
"languageCode": "en",
"timezone": "Europe/Stockholm"
},
"notifications": {
"emailEnabled": true,
"smsEnabled": false,
"delivery": {
"overrideEnabled": true,
"enabledEmails": [
"notify_billing",
"notify_support"
],
"billing": {
"enabled": true,
"actions": {
"canToggle": {
"allowed": false,
"reason": "Add a billing notification recipient before changing billing email delivery."
}
}
}
}
},
"security": {
"bankIdOnlyLogin": false,
"twoFactorEnabled": false
},
"billing": {
"peppol": {
"optedOut": false,
"optOutReason": null,
"optedOutAt": null,
"creditNotesOptedOut": false,
"creditNotesOptedOutAt": null
},
"cardAutoCharge": {
"enabled": true,
"label": "Card auto-charge",
"description": "Automatically charge the saved card when invoices are due.",
"reason": null,
"actions": {
"canToggle": {
"allowed": true,
"reason": null
}
},
"method": "card",
"status": "active",
"configured": true,
"hasPaymentMethod": true
},
"separateInvoices": {
"enabled": false,
"label": "Separate domain invoices",
"description": "Receive a separate invoice for each domain renewal.",
"reason": null,
"actions": {
"canToggle": {
"allowed": true,
"reason": null
}
}
}
},
"categories": {
"general": {},
"ui": {},
"notifications": {},
"billing": {},
"dashboard": {}
}
}
Response fields
localizationobject
languageCodestring
Language of the client area and the e-mails. One of sv, en.
timezonestring
IANA time zone for the times shown to the account.
notificationsobject
emailEnabledboolean
The general e-mail notification setting.
smsEnabledboolean
The general SMS notification setting.
deliverynull
securityobject
bankIdOnlyLoginboolean
When true, password sign-in is off and BankID is needed to sign in.
twoFactorEnabledboolean
Whether two-factor authentication (TOTP) is on for the account.
billingobject
peppolobject
optedOutboolean
Whether the account has opted out of Peppol e-invoices, while it is eligible for them.
optOutReasonstring or null
The opt-out reason to show, when Peppol delivery is off by choice.
optedOutAtstring or null
When the account opted out of Peppol (ISO 8601). Null when it has not opted out.
creditNotesOptedOutboolean
True when the account has turned off automatic credit notes. Default false. Credit notes for refunded or cancelled invoices are then sent automatically, the same way as the original invoice.
creditNotesOptedOutAtstring or null
When automatic credit notes were last turned off. Null otherwise.
cardAutoChargenull
separateInvoicesnull
categoriesobject
generalobject
uiobject
notificationsobject
billingobject
dashboardobject

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400invalid_request: the body changes no supported field. Or a field has the wrong type or value.
401Unauthorized. Authentication is required.
403forbidden: the request has no customer account context. Also returned when the key lacks the scope the changed fields need. An API key that sets security.bankIdOnlyLogin to true gets it too.
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.
502upstream_failed: the billing settings or the language could not be saved right now. Other fields in the same request may already be saved. Read the preferences again before you retry.