Skip to content

Latest commit

 

History

History
258 lines (179 loc) · 14.3 KB

README.md

File metadata and controls

258 lines (179 loc) · 14.3 KB

Customers

(customers)

Overview

Available Operations

  • list - Retrieve a list of customers
  • create - Create a customer ⚠️ Deprecated
  • get - Retrieve a customer
  • update - Update a customer
  • delete - Delete a customer

list

Retrieve a list of customers for the authenticated workspace.

Example Usage

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)

Parameters

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.

Response

List[operations.GetCustomersResponseBody]

Errors

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 */*

create

[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.

Example Usage

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)

Parameters

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.

Response

operations.CreateCustomerResponseBody

Errors

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 */*

get

Retrieve a customer by ID for the authenticated workspace.

Example Usage

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)

Parameters

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.

Response

operations.GetCustomerResponseBody

Errors

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

Update a customer for the authenticated workspace.

Example Usage

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)

Parameters

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.

Response

operations.UpdateCustomerResponseBody

Errors

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

Delete a customer from a workspace.

Example Usage

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)

Parameters

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.

Response

operations.DeleteCustomerResponseBody

Errors

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 */*