Skip to content

Commit

Permalink
update userPreferences -> users.preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Dec 28, 2023
1 parent cf7d78a commit 2581426
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -840,7 +840,7 @@ const { items: tenants, has_more } = await courier.tenants.list();
Courier currently does not allow creating new topics via the API. You must create topics via the Courier UI. Once a topic is created, you can update a user's preferences for that topic via the API.

```ts
await courier.userPreferences.update("<USER_ID>", "<VALID_TOPIC_ID>", {
await courier.users.preferences.update("<USER_ID>", "<VALID_TOPIC_ID>", {
default_status: "OPTED_IN",
status: "OPTED_OUT",
});
Expand All @@ -851,15 +851,15 @@ Courier currently does not allow creating new topics via the API. You must creat
- Get all topic level preferences for a user

```ts
const { items: userPreferences } = await courier.userPreferences.list(
const { items: userPreferences } = await courier.users.preferences.list(
"<USER_ID>"
);
```

- Get a specific topic level preference for a user

```ts
const userPreference = await courier.userPreferences.get(
const userPreference = await courier.users.preferences.get(
"<USER_ID>",
"<VALID_TOPIC_ID>"
);
Expand Down

0 comments on commit 2581426

Please sign in to comment.