Skip to content

Latest commit

 

History

History
98 lines (65 loc) · 6.37 KB

README.md

File metadata and controls

98 lines (65 loc) · 6.37 KB

Preferences

(subscribers.preferences)

Overview

Available Operations

  • list - Get subscriber preferences
  • update - Update subscriber global or workflow specific preferences

list

Get subscriber global and workflow specific preferences

Example Usage

from novu_py import Novu


with Novu(
    secret_key="YOUR_SECRET_KEY_HERE",
) as novu:

    res = novu.subscribers.preferences.list(subscriber_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
subscriber_id str ✔️ N/A
idempotency_key Optional[str] A header for idempotency purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SubscribersControllerGetSubscriberPreferencesResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 414 application/json
models.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
models.ValidationErrorDto 422 application/json
models.ErrorDto 500 application/json
models.APIError 4XX, 5XX */*

update

Update subscriber global or workflow specific preferences

Example Usage

from novu_py import Novu


with Novu(
    secret_key="YOUR_SECRET_KEY_HERE",
) as novu:

    res = novu.subscribers.preferences.update(subscriber_id="<id>", patch_subscriber_preferences_dto={
        "channels": {},
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
subscriber_id str ✔️ N/A
patch_subscriber_preferences_dto models.PatchSubscriberPreferencesDto ✔️ N/A
idempotency_key Optional[str] A header for idempotency purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SubscribersControllerUpdateSubscriberPreferencesResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 414 application/json
models.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
models.ValidationErrorDto 422 application/json
models.ErrorDto 500 application/json
models.APIError 4XX, 5XX */*