Update a customer
Update a customer for the authenticated workspace.
1 min read
patch/customers/{id}
Request example
Response
patch/customers/{id}
Authorization
Path parameters
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).Query parameters
Whether to include expanded fields on the customer (
link, partner, discount).Body
application/jsonThe customer's email address.
Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
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.
The customer's avatar URL. If not provided, a random avatar will be generated.
The customer's unique identifier your database. This is useful for associating subsequent conversion events from Dub's API to your internal systems.
The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer.
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).
Responses
application/json
The customer was updated.
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 of the customer.
Email of the customer.
Avatar URL of the customer.
Unique identifier for the customer in the client's app.
The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer.
Country of the customer.
Total number of sales for the customer.
Total amount of sales for the customer.
The date the customer was created (usually the signup date or trial start date).
The date the customer made their first sale. Useful for calculating the time to first sale and LTV.
The date the customer canceled their subscription. Useful for calculating LTV and churn rate.
Show child attributesHide child attributes
The unique ID of the short link.
The domain of the short link. If not provided, the primary domain for the workspace will be used (or
dub.sh if the workspace has no domains).The short link slug. If not provided, a random 7-character slug will be generated.
The full URL of the short link, including the https protocol (e.g.
https://dub.sh/try).The destination URL of the short link.
The ID of the program the short link is associated with.