Skip to main content
PUT
Update a customer
Send only what changes: a field you leave out keeps its current value, and an address part you leave out stays as it is. A customer’s document can’t be changed, and neither can its status: use the activate and deactivate routes for that. customFields, when sent, replaces the customer’s whole map, so send every value you want to keep. Its keys are checked against the organization’s active custom fields for customers; unlike a create, a required custom field you leave out is not an error.

Path Parameters

realmId
string<uuid>
required

ID of your realm.

Format: UUID

organizationId
string<uuid>
required

ID of the organization the customer belongs to.

Format: UUID

customerId
string<uuid>
required

ID of the customer to update.

Format: UUID

Body

application/json
name
string

New name of the customer: a person's full name or a company's name. Omit it, or send it empty, to keep the current one.

Maximum string length: 100
Example:

"Ana Souza"

trandingName
string

New trade name of a company customer. Omit it, or send it empty, to keep the current one.

Example:

"Souza Studio"

email
string<email>

New e-mail address of the customer.

Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:

"ana.souza@example.com"

document
string

A customer's document can't be changed: the value is checked (it must be a valid CPF or CNPJ, with no dots, dashes or slashes) and then ignored.

Pattern: ^[A-Za-z0-9]+$
Example:

"52998224725"

phoneNumber
string

New Brazilian phone number in international format: +55, the area code and the number (10 or 11 digits).

Pattern: ^\+55[0-9]{10,11}$
Example:

"+5511999999999"

address
object

Parts of the postal address to change. Each part you send replaces the stored one; the parts you leave out stay as they are.

customFields
object

Values of the organization's custom fields for this customer, keyed by each field's slug. When sent it replaces the customer's whole map: a field you leave out is removed, and a value sent as null, an empty string or an empty list clears that field. Every key must be the slug of an active custom field defined for customers, and every value must fit that field's type. Omit customFields to leave the values untouched.


Example: {"cost-center":"CC-1020"}

Example:

Response

Successful response

The customer an update answers with: the same shape a create answers with.

id
string<uuid>
required

ID of the customer.

Example:

"7f3b1c52-9e4a-4d1b-8a67-2c5d9f0e4b13"

hash
string<uuid>
required

Token that identifies the customer in the link of their portal page.

Example:

"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"

address
object

Postal address of the customer.

Example:
name
string

Name of the customer: a person's full name or a company's name.

Example:

"Ana Souza"

document
string

Tax ID of the customer, without formatting: a CPF (11 digits) or a CNPJ (14 characters — the first 12 may be uppercase letters, the last 2 are digits).

Example:

"52998224725"

documentType
string

Kind of document: CPF for 11 characters, CNPJ otherwise.

Example:

"CPF"

trandingName
string

Trade name of a company customer.

Example:

"Souza Studio"

email
string

E-mail address of the customer.

Example:

"ana.souza@example.com"

phoneNumber
string

Phone number of the customer, in international format: + followed by digits.

Example:

"+5511999999999"

customFields
object | null

Values of the organization's custom fields for this customer, keyed by the field's slug. Absent, or null, when the customer has none.


Example: {"cost-center":"CC-1020"}

Example: