---
title: "Set entity preference"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sureshake.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sureshake API › notifications

`PUT /v2/notifications/preferences/entity/{entityId}`

## Path parameters

- `entityId` (`notification-set-entity-preference.path.entityId`; string, required)
  - format `uuid`

## Request body

- `digestFrequencyOverride` (`notification-set-entity-preference.digestFrequencyOverride`; string, optional, nullable)
  - one of `"immediate"`, `"daily"`, `"weekly"`, `"none"`
- `muted` (`notification-set-entity-preference.muted`; boolean, optional)

## Example request

```json
{
  "digestFrequencyOverride": "immediate",
  "muted": true
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sureshake.com/v2/notifications/preferences/entity/<entityId>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "digestFrequencyOverride": "immediate",
  "muted": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/notifications/preferences/entity/<entityId>';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({digestFrequencyOverride: 'immediate', muted: true})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/notifications/preferences/entity/<entityId>"

payload = {
    "digestFrequencyOverride": "immediate",
    "muted": True
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "data": {
    "entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",
    "digestFrequencyOverride": "immediate",
    "muted": true
  },
  "meta": {
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`notification-set-entity-preference.response.200.data`; object, required)
  - `entityId` (`notification-set-entity-preference.response.200.data.entityId`; string, required)
    - format `uuid`
  - `digestFrequencyOverride` (`notification-set-entity-preference.response.200.data.digestFrequencyOverride`; string, required, nullable)
    - one of `"immediate"`, `"daily"`, `"weekly"`, `"none"`
  - `muted` (`notification-set-entity-preference.response.200.data.muted`; boolean, required)
- `meta` (`notification-set-entity-preference.response.200.meta`; object, optional)
  - `timestamp` (`notification-set-entity-preference.response.200.meta.timestamp`; string, required)
    - format `date-time`

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`notification-set-entity-preference.response.400.error`; object, required)
  - `code` (`notification-set-entity-preference.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`notification-set-entity-preference.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`notification-set-entity-preference.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`notification-set-entity-preference.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`notification-set-entity-preference.response.401.error`; object, required)
  - `code` (`notification-set-entity-preference.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`notification-set-entity-preference.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`notification-set-entity-preference.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`notification-set-entity-preference.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`notification-set-entity-preference.response.500.error`; object, required)
  - `code` (`notification-set-entity-preference.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`notification-set-entity-preference.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`notification-set-entity-preference.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`notification-set-entity-preference.response.500.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/notification-set-entity-preference/index.md
