Update a user

​

Update a user's label, location, or default return wallets. Omitted fields keep their values, and the changes apply together or not at all. The user keeps its id, wallets, and payment history. Pass subaccountId to update a user in a subaccount.

A new label must be unique in the account. The old label stops resolving at once, and you can register it again for a new user. A label may be empty. Labels starting with sandbox- are reserved, and sandbox users cannot be renamed.

location and returnWallets follow the rules of POST /add-user-record. A label already in use returns 409, as does an update still being processed for this user; retry shortly. An unregistered return wallet, a wallet whose activation failed, or an unsupported chain returns 422.

Path Parameters

Body

required
application/json
  • The new label. It may be empty, must be unique within the account, and cannot start with sandbox-. Omit it to keep the current label.

  • Send location when collection is on. Omit it to keep the saved location. A new location replaces the old one. Use codes, not names.

    Properties: 2
  • Replaces the user's default return wallets: one wallet per chain, each registered to the user. Omit to keep the current defaults.

    Properties: 2
  • Update a user in one of your subaccounts. Must be a direct child of the authenticated account.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for patch/api/v1/users/id/{userId}
curl https://api.bettermoney.com/api/v1/users/id/123e4567-e89b-12d3-a456-426614174000 \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --data '{
  "label": "usr_7c41d0"
}'
{
  "id": "string",
  "label": "string",
  "accountId": "123e4567-e89b-12d3-a456-426614174000",
  "wallets": [
    {
      "address": "string",
      "chain": "string",
      "status": "PENDING"
    }
  ],
  "returnWallets": [
    {
      "chain": "string",
      "address": "string"
    }
  ],
  "location": {
    "country": "string",
    "subdivision": "string"
  }
}