Update account preferences

PATCH /api/v2/me/preferences

Partially update account and billing preferences.

This endpoint requires a customer account context; standalone admins must select or impersonate a customer account first.

Account fields require write:account; billing automation fields such as billing.cardAutoCharge, billing.separateInvoices, and notifications.delivery require write:billing and account-owner access — contact and delegated sessions get 403 for billing automation changes even when they hold write:billing.

Enabling security.bankIdOnlyLogin is rejected with 400 until the account has completed BankID verification.

Set billing.separateInvoices.enabled to false for consolidated monthly renewal invoices or true for separate invoices per service/domain.

Set billing.cardAutoCharge.configured to control the saved auto-charge preference; after saving, read the response billing.cardAutoCharge.status because configured: true still needs a saved card before auto-charge is effectively active.

For invoice notification delivery, send notifications.delivery.overrideEnabled: false to return to defaults, or true plus enabledEmails to save an explicit category allow-list.

Account & Access Preferences

Authentication

Required API scopes: write:accountwrite:billing

Authenticate with an API key in the Authorization: Bearer <token> header.

Context

Headers

Authorization Bearer <token>
Accept application/json
Content-Type application/json

Body

required
application/json
localization object
localization.languageCode string · enum · Example: en
sv
en
localization.timezone string · Example: Europe/Stockholm
notifications object
notifications.emailEnabled boolean · Example: true
notifications.smsEnabled boolean · Example: false
notifications.delivery object
notifications.delivery.overrideEnabled boolean · Example: true

false resets invoice notification delivery to default behavior. true saves an explicit allow-list from enabledEmails.

notifications.delivery.enabledEmails array<string> · Example: ["notify_billing","notify_support"]
security object
security.bankIdOnlyLogin boolean · Example: false
security.twoFactorEnabled boolean · Example: true
billing object
billing.peppol object
billing.peppol.optedOut boolean · Example: false
billing.cardAutoCharge object
billing.cardAutoCharge.configured boolean · Example: true

Saved automatic-card-charge preference. The effective response can still be status: needs_payment_method when no saved card exists.

billing.separateInvoices object
billing.separateInvoices.enabled boolean · Example: false

false means consolidated monthly renewal invoices. true means separate invoices per service/domain.

categories object

Responses

200 Updated account preferences.
localization object
localization.languageCode string · enum required · Example: en

Preferred control-panel and email language.

sv
en
localization.timezone string required · Example: Europe/Stockholm

IANA timezone used for account-facing timestamps.

notifications object
notifications.emailEnabled boolean required · Example: true

General email notification preference stored in account preferences.

notifications.smsEnabled boolean required · Example: false

General SMS notification preference stored in account preferences.

notifications.delivery null required
security object
security.bankIdOnlyLogin boolean required · Example: false

When true, password login is disabled and BankID is required for account login.

security.twoFactorEnabled boolean required · Example: true

Whether TOTP/MFA is enabled for the account.

billing object
billing.peppol object required
billing.peppol.optedOut boolean required · Example: false

Whether the account opted out of Peppol e-invoice delivery when eligible.

billing.peppol.optOutReason string · nullable required · Example: null

Customer-facing opt-out reason when Peppol delivery is disabled by preference.

billing.peppol.optedOutAt string · nullable required · Example: null

ISO timestamp for the Peppol opt-out preference, or null when not opted out.

billing.cardAutoCharge null required
billing.separateInvoices null required
categories object
categories.general object required
categories.ui object required
categories.notifications object required
categories.billing object required
categories.dashboard object required
400 Invalid request. The response body is an RFC 7807 Problem Details document.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
401 Unauthorized. Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 Forbidden when the caller has no customer account context, lacks the required write scope, or attempts billing automation changes without account-owner access.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
404 Not found. The resource does not exist or is not owned by the caller.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Internal error. Retry later or contact support if the issue persists.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
502 The preference write could not be saved upstream (billing automation settings or the language preference). Retry later.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
PATCH https://cloud.hostup.se/api/v2/me/preferences
For AI assistants
View as Markdown
cURL
curl -X PATCH "https://cloud.hostup.se/api/v2/me/preferences" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "billing": {
      "separateInvoices": {
        "enabled": false
      }
    }
  }'
Response
{
  "localization": {
    "languageCode": "en",
    "timezone": "Europe/Stockholm"
  },
  "notifications": {
    "emailEnabled": true,
    "smsEnabled": false,
    "delivery": {
      "overrideEnabled": true,
      "enabledEmails": [
        "notify_billing",
        "notify_support",
        "notify_services",
        "notify_domains"
      ],
      "billing": {
        "enabled": true,
        "actions": {
          "canToggle": {
            "allowed": false,
            "reason": "Add a billing notification recipient before changing billing email delivery."
          }
        }
      }
    }
  },
  "security": {
    "bankIdOnlyLogin": false,
    "twoFactorEnabled": true
  },
  "billing": {
    "peppol": {
      "optedOut": false,
      "optOutReason": null,
      "optedOutAt": 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 service invoices",
      "description": "Create separate invoices for services instead of grouping them together.",
      "reason": null,
      "actions": {
        "canToggle": {
          "allowed": true,
          "reason": null
        }
      }
    }
  },
  "categories": {
    "general": {},
    "ui": {},
    "notifications": {},
    "billing": {},
    "dashboard": {}
  }
}
Request Body Use consolidated invoices
{
  "billing": {
    "separateInvoices": {
      "enabled": false
    }
  }
}