Update a customer
update_customerModify an existing customer's profile in an authenticated workspace by ID or external ID, including name, email, avatar, country, Stripe ID, and subscription cancellation status.
Instructions
Update a customer for the authenticated workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | |
| name | No | The customer's name. If not provided, the email address will be used, and if email is not provided, a random name will be generated. | |
| No | The customer's email address. | ||
| avatar | No | The customer's avatar URL. If not provided, a random avatar will be generated. | |
| account | No | Exact configured private workspace profile label; not a tenant or provider account ID. | |
| confirm | No | Must be true for the requested mutation or exclusive private output file. | |
| country | No | The customer's country in ISO 3166-1 alpha-2 format. Updating this field will only affect the customer's country in Dub's system (and has no effect on existing conversion events). | |
| payload | No | Complete native JSON body; do not mix with body flags or payload_file. Arrays use repeated JSON object flags or a whole native array in a private file. | |
| externalId | No | The customer's unique identifier your database. This is useful for associating subsequent conversion events from Dub's API to your internal systems. | |
| payload_file | No | Absolute regular non-symlink JSON body file, at most 1 MiB. Cannot mix with payload/body flags. | |
| stripeCustomerId | No | The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer. | |
| subscriptionCanceledAt | No | The date the customer canceled their subscription. Set to a timestamp to mark the subscription as canceled, or `null` to clear it (e.g. if they resubscribe). | |
| include_expanded_fields | No | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). |