(customers)
- list - Retrieve a list of customers
create- Create a customer⚠️ Deprecated- get - Retrieve a customer
- update - Update a customer
- delete - Delete a customer
Retrieve a list of customers for the authenticated workspace.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as dub:
res = dub.customers.list(request={})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetCustomersRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
List[operations.GetCustomersResponseBody]
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.Conflict | 409 | application/json |
errors.InviteExpired | 410 | application/json |
errors.UnprocessableEntity | 422 | application/json |
errors.RateLimitExceeded | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |
[Deprecated]: Customer creation can only be done via tracking a lead event. Use the /track/lead endpoint instead.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as dub:
res = dub.customers.create()
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateCustomerRequestBody | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.CreateCustomerResponseBody
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.Conflict | 409 | application/json |
errors.InviteExpired | 410 | application/json |
errors.UnprocessableEntity | 422 | application/json |
errors.RateLimitExceeded | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Retrieve a customer by ID for the authenticated workspace.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as dub:
res = dub.customers.get(request={
"id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetCustomerRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetCustomerResponseBody
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.Conflict | 409 | application/json |
errors.InviteExpired | 410 | application/json |
errors.UnprocessableEntity | 422 | application/json |
errors.RateLimitExceeded | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Update a customer for the authenticated workspace.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as dub:
res = dub.customers.update(request={
"id": "<id>",
})
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdateCustomerRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.UpdateCustomerResponseBody
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.Conflict | 409 | application/json |
errors.InviteExpired | 410 | application/json |
errors.UnprocessableEntity | 422 | application/json |
errors.RateLimitExceeded | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Delete a customer from a workspace.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as dub:
res = dub.customers.delete(id="<id>")
assert res is not None
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
id |
str | ✔️ | The unique identifier of the customer in Dub. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DeleteCustomerResponseBody
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.Conflict | 409 | application/json |
errors.InviteExpired | 410 | application/json |
errors.UnprocessableEntity | 422 | application/json |
errors.RateLimitExceeded | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |