Skip to main content

update-customer

dci update-customer <customerId> [body]

Partially updates the general settings and contact info of the customer identified by \{customerId\}. \{customerId\} must match the customer resolved from the bearer token; a token scoped to a different customer gets 403, even if that customer would otherwise be reachable through a reseller/MTS relationship. Requires the Settings permission and DoiT API access (platform:externalApi); updating allowedInviteDomains additionally requires the UsersManager permission.

The request body must use application/merge-patch+json (RFC 7396): an omitted field leaves the current value unchanged, and an explicit null also leaves it unchanged, except for urlSlug, where an explicit empty string removes the customer's active URL slug rather than leaving it unchanged.

Fields are nested exactly as getCustomer returns them - currency and allowedInviteDomains under settings, emails under contact - so every value is read and written at the same path. settings.currency accepts only the codes listed in the schema and cannot be cleared; allowedInviteDomains and contact.emails are cleared with an empty array.

  • customerId — Customer ID. Must match the customer resolved from the bearer token - a token scoped to a different customer gets 403.

Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.

Merge-patch semantics

Omitted fields keep their current value, and so does an explicit null — except urlSlug, where an empty string removes the slug. settings.currency accepts only the codes listed in the schema and cannot be cleared; allowedInviteDomains and contact.emails are cleared with an empty array. Requires the Settings permission and DoiT API access (platform:externalApi).

Examples

# Change the currency used for monetary values.
dci update-customer <customer-id> settings.currency: EUR
Exit code 0 and no output; `dci get-customer <customer-id> --output json` shows the new value.
# Restrict which email domains can be invited (requires the UsersManager permission).
dci update-customer <customer-id> settings.allowedInviteDomains: [acme.com, acme.io]
# Replace the contact emails; an empty array clears them.
dci update-customer <customer-id> contact.emails: [[email protected], [email protected]]
# Set the Console URL display name; an empty string removes the active slug.
dci update-customer <customer-id> urlSlug: acme

Request

Content-Type: application/merge-patch+json

FieldTypeRequiredDescription
urlSlugstringThe customer's URL display name. An explicit empty string removes the active slug; a non-empty value must be 3-12 characters of lowercase letters, digits, or dashes, starting and ending with a letter or digit, and must be unique across all customers.
settingsobjectCustomer settings. Shared by the getCustomer response and the updateCustomer request body so a value is always read and written at the same path. currency accepts only the listed codes; any other value is rejected with 400. Unlike urlSlug and allowedInviteDomains it cannot be cleared - no value unsets it.
settings.currencystringCurrency code for monetary values. One of: "USD", "ILS", "EUR", "AUD", "CAD", "GBP", "DKK", "NOK", "SEK", "BRL", "SGD", "MXN", ….
settings.allowedInviteDomainsarray of stringEmail domains allowed to self-invite into the customer. Updating this field requires the UsersManager permission in addition to Settings. An empty array clears the list.
settings.mfaRequiredbooleanWhether users of this customer are required to enroll in multi-factor authentication. A missing value is treated as true. Disabling this does not remove MFA enrollments existing users already have.
contactobjectCustomer point-of-contact details. Shared by the getCustomer response and the updateCustomer request body so a value is always read and written at the same path.
contact.emailsarray of string (email)Point-of-contact email addresses for the customer.
Raw JSON schema
{
"type": "object",
"description": "Partial update to a customer's general settings. Every field is optional; only fields present in the request body are changed. Fields are nested exactly as the `getCustomer` response nests them. See the operation description for `urlSlug`'s null-vs-absent semantics, which differ from every other field.",
"properties": {
"urlSlug": {
"type": "string",
"description": "The customer's URL display name. An explicit empty string removes the active slug; a non-empty value must be 3-12 characters of lowercase letters, digits, or dashes, starting and ending with a letter or digit, and must be unique across all customers.",
"x-doit-confidentiality": "customer-data"
},
"settings": {
"type": "object",
"description": "Customer settings. Shared by the `getCustomer` response and the `updateCustomer` request body so a value is always read and written at the same path.\n\n`currency` accepts only the listed codes; any other value is rejected with `400`. Unlike `urlSlug` and `allowedInviteDomains` it cannot be cleared - no value unsets it.",
"properties": {
"currency": {
"description": "Currency code for monetary values.",
"type": "string",
"enum": [
"USD",
"ILS",
"EUR",
"AUD",
"CAD",
"GBP",
"DKK",
"NOK",
"SEK",
"BRL",
"SGD",
"MXN",
"CHF",
"MYR",
"TWD",
"EGP",
"ZAR",
"JPY",
"IDR",
"AED",
"THB",
"COP"
]
},
"allowedInviteDomains": {
"type": "array",
"description": "Email domains allowed to self-invite into the customer. Updating this field requires the `UsersManager` permission in addition to `Settings`. An empty array clears the list.",
"items": {
"type": "string"
},
"x-doit-pii": true,
"x-doit-confidentiality": "customer-data"
},
"mfaRequired": {
"type": "boolean",
"description": "Whether users of this customer are required to enroll in multi-factor authentication. A missing value is treated as `true`. Disabling this does not remove MFA enrollments existing users already have.",
"x-doit-confidentiality": "customer-data"
}
}
},
"contact": {
"type": "object",
"description": "Customer point-of-contact details. Shared by the `getCustomer` response and the `updateCustomer` request body so a value is always read and written at the same path.",
"properties": {
"emails": {
"type": "array",
"description": "Point-of-contact email addresses for the customer.",
"items": {
"type": "string",
"format": "email"
},
"x-doit-pii": true,
"x-doit-confidentiality": "customer-data"
}
}
}
}
}

Output

On success, this command produces no response data.

Errors

On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.

HTTP status to exit code mapping
HTTP statusExit codeError codeMeaning
400, 42230VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.
40921RESOURCE_CONFLICTThe operation conflicts with the resource's current state.
4151API_ERRORThe request failed; the printed error message has details.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: updatecustomer