# Blog Settings

Read, update, and subscribe to the store's blog comment settings through the Store API.

Blog settings control who can submit comments and whether new comments require moderation. Reads require `read_blog`; writes require `write_blog`. `comments_mode` is `disabled`, `all`, or `registered`.

Updates preserve omitted fields; a setting cannot be set to null. At least one setting must be supplied. An update that changes nothing keeps `updated_at`, emits no webhook and returns `BLOG_SETTINGS_UNCHANGED`. Unknown or wrongly typed fields are rejected with `STORE_API_BODY_PROPERTY_UNKNOWN` or `STORE_API_BODY_PROPERTY_INVALID`. Disabling comments hides existing comments and sets public counts to zero without deleting records. Re-enabling comments restores their visibility according to their moderation status. These endpoints configure comments; they do not create shopper comments.

## Endpoints

## Get blog settings

`GET /api/2025-01/blog/settings`

Returns the supported modes, the store's current mode and moderation choice, and its blocked words: a comment holding one of `comment_blocked_words` (or, while `comment_starter_words` is true, of the built-in `comment_starter_words_list`) waits for approval even with moderation off. Words match whole and case-insensitively; a phrase matches its words in order. `comment_blocked_words_max` and `comment_blocked_word_max_length` are the most words, and the longest one, the list accepts. `feed_urls` are the blog's RSS and Atom feeds on the primary domain (the 50 newest published posts with full content); null while the store has no primary domain.

Scope: `read_blog`

```curl
curl 'https://api-store.tringify.com/api/2025-01/blog/settings' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{
  "data": {
    "comment_blocked_word_max_length": 50,
    "comment_blocked_words": [
      "free shipping code",
      "dm me"
    ],
    "comment_blocked_words_max": 200,
    "comment_starter_words": true,
    "comment_starter_words_list": [
      "casino",
      "online casino",
      "seo services",
      "buy backlinks",
      "payday loan"
    ],
    "comments_mode": "registered",
    "comments_moderation": true,
    "comments_modes": [
      "disabled",
      "all",
      "registered"
    ],
    "feed_urls": {
      "atom": "https://shop.example.com/blogs/feed.atom",
      "rss": "https://shop.example.com/blogs/feed.xml"
    },
    "retention_notice": "Spam and trash are deleted after 30 days. IP addresses and browser details are removed after 30 days, and email addresses after 90 days. Approved and pending comments remain until you delete them.",
    "updated_at": "2026-09-01T08:00:00-04:00"
  },
  "success": true
}
```

## Update blog settings

`PUT /api/2025-01/blog/settings`

This is an atomic patch. Omitted fields stay unchanged; a field cannot be set to null. Disabling comments hides existing comments and reports zero counts without deleting them. A request that changes nothing sends no webhook, writes no audit record, keeps `updated_at` and answers BLOG_SETTINGS_UNCHANGED.

Scope: `write_blog`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/blog/settings' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "comment_blocked_words": [
    "free shipping code",
    "dm me"
  ],
  "comment_starter_words": true,
  "comments_mode": "registered",
  "comments_moderation": true
}'
```

Response:

```json
{
  "code": "BLOG_SETTINGS_UPDATED",
  "data": {
    "comment_blocked_word_max_length": 50,
    "comment_blocked_words": [
      "free shipping code",
      "dm me"
    ],
    "comment_blocked_words_max": 200,
    "comment_starter_words": true,
    "comment_starter_words_list": [
      "casino",
      "online casino",
      "seo services",
      "buy backlinks",
      "payday loan"
    ],
    "comments_mode": "registered",
    "comments_moderation": true,
    "comments_modes": [
      "disabled",
      "all",
      "registered"
    ],
    "feed_urls": {
      "atom": "https://shop.example.com/blogs/feed.atom",
      "rss": "https://shop.example.com/blogs/feed.xml"
    },
    "retention_notice": "Spam and trash are deleted after 30 days. IP addresses and browser details are removed after 30 days, and email addresses after 90 days. Approved and pending comments remain until you delete them.",
    "updated_at": "2026-09-01T08:05:00-04:00"
  },
  "message": "Blog settings updated.",
  "success": true
}
```

## Webhook events

Subscribe when an integration mirrors comment availability or moderation behavior. The settings update and its event commit together.

## Blog settings updated

Event: `blog_settings/update` · App scope: `read_blog` · Staff permission: `blog:write`

Fired when blog comment settings change.

```json
{
  "settings": {
    "comment_blocked_words": [
      "free shipping code",
      "dm me"
    ],
    "comment_starter_words": true,
    "comments_mode": "registered",
    "comments_moderation": true,
    "updated_at": "2026-06-09T12:00:00-04:00"
  }
}
```

