SubizDeveloper Docs
Customers (Users)

API 4.1

Update customer details

Change a customer's attributes, such as name, email, or phone.

POSThttps://api.subiz.com.vn/4.1/users/{uid}

Use this endpoint to keep a customer in sync with your system, for example after the customer changes their email in your CRM.

Request body

Send only the attributes you want to change.

Field Type Description
uid (path) string Subiz user ID.
attributes array Attributes to change. Each item has a key and a value.
attributes[].key string Attribute key, such as fullname. See Common attributes.
attributes[].text string New value for text attributes. Use number, boolean, or datetime for other types; see Value types.
{
  "attributes": [
    {
      "key": "fullname",
      "text": "Alex Example"
    },
    {
      "key": "emails",
      "text": "alex.new@example.com"
    }
  ]
}

Subiz reads only a few fields from the body, mainly attributes. Other fields, such as id, created, or labels, are ignored, so you cannot change them here. Do not send back a whole customer object you read earlier.

Response

A successful request returns HTTP 200 with the updated customer. Selected fields:

{
  "id": "user_example",
  "account_id": "account_example",
  "attributes": [
    {
      "key": "fullname",
      "text": "Alex Example"
    },
    {
      "key": "emails",
      "text": "alex.new@example.com"
    }
  ]
}

When customer data changes, subscribed webhooks receive a user_info_updated event. Rapid updates can be combined into one event. See Customer information updated.

Limits and errors

A request can contain up to 1,000 attributes, and each value up to 2,048 bytes. See Customer attribute limits.

An invalid uid returns an error. If you only have the customer’s channel identity, first get the user ID with Find or create by channel identity. See Errors for the error format.

HTTP request

Replace YOUR_UID with the user ID and YOUR_ACCESS_TOKEN with your token.

POST https://api.subiz.com.vn/4.1/users/YOUR_UID
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
  "attributes": [
    {
      "key": "fullname",
      "text": "Alex Example"
    }
  ]
}