Belgeler
Ctrl+K Arama Alt+[Alt+] Kılavuzlar
API anahtarını al

API

Notifications

Product inbox notifications (navbar bell) and brand digest preferences. All routes below accept X-API-Anahtarı and cost 1 kredi per call.

Inbox

AL/api/v1/notifications

Paginated inbox notifications for the API key owner, newest first.

Send X-API-Anahtarı on every request.

Query parameters

  • sınırtamsayı

    Max 30.

    Default: 30
  • before_idtamsayı

    Cursor — return rows older than this id.

Talep
curl -sS \
  -H "X-API-Key: $WH_API_KEY" \
  "{origin}/api/v1/notifications?limit=30&before_id=0"
const res = await fetch(`${ORIGIN}/api/v1/notifications?limit=30&before_id=0`, {
  method: 'GET',
  headers: {
    'X-API-Key': process.env.WH_API_KEY,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    f"{ORIGIN}/api/v1/notifications?limit=30&before_id=0",
    headers={"X-API-Key": os.environ["WH_API_KEY"]},
)
data = res.json()
Yanıt
{
    "success": true,
    "notifications": [
        {
            "id": 1284,
            "type": "system",
            "title": "Brand digest ready",
            "body": "Allbirds launched 6 new ads this week.",
            "action_url": "/brands/details/108897621643793",
            "read_at": null,
            "is_read": false,
            "created_at": "2026-03-14T09:22:00+00:00"
        }
    ],
    "has_more": false,
    "unread": 3
}
{
    "success": false,
    "error": "Unauthorized"
}
{
    "success": false,
    "error": "Rate limit exceeded. Max 60 requests per minute."
}
AL/api/v1/notifications/unread-count

Unread notification count.

Send X-API-Anahtarı on every request.
Talep
curl -sS \
  -H "X-API-Key: $WH_API_KEY" \
  "{origin}/api/v1/notifications/unread-count"
const res = await fetch(`${ORIGIN}/api/v1/notifications/unread-count`, {
  method: 'GET',
  headers: {
    'X-API-Key': process.env.WH_API_KEY,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    f"{ORIGIN}/api/v1/notifications/unread-count",
    headers={"X-API-Key": os.environ["WH_API_KEY"]},
)
data = res.json()
Yanıt
{
    "success": true,
    "count": 3
}
{
    "success": false,
    "error": "Unauthorized"
}
YAYIN/api/v1/notifications/mark-read

Mark specific notifications read.

Send X-API-Anahtarı on every request.

Body parameters

  • idsarrayrequired

    JSON array of notification ids.

Talep
curl -sS \
  -X POST \
  -H "X-API-Key: $WH_API_KEY" \
  -H "Content-Type: application/json" \
  "{origin}/api/v1/notifications/mark-read" \
  -d '{"ids":[1284,1283]}'
const res = await fetch(`${ORIGIN}/api/v1/notifications/mark-read`, {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.WH_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "ids": [
          1284,
          1283
      ]
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    f"{ORIGIN}/api/v1/notifications/mark-read",
    headers={"X-API-Key": os.environ["WH_API_KEY"]},
    json={
        "ids": [
            1284,
            1283
        ]
    },
)
data = res.json()
Yanıt
{
    "success": true,
    "updated": 2,
    "unread": 1
}
{
    "success": false,
    "error": "ids must be an array"
}
{
    "success": false,
    "error": "Unauthorized"
}
{
    "success": false,
    "error": "Failed to mark notifications read"
}
YAYIN/api/v1/notifications/mark-all-read

Mark every inbox notification read for the API key owner.

Send X-API-Anahtarı on every request.
Talep
curl -sS \
  -X POST \
  -H "X-API-Key: $WH_API_KEY" \
  "{origin}/api/v1/notifications/mark-all-read"
const res = await fetch(`${ORIGIN}/api/v1/notifications/mark-all-read`, {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.WH_API_KEY,
  },
});
const data = await res.json();
import os, requests

res = requests.post(
    f"{ORIGIN}/api/v1/notifications/mark-all-read",
    headers={"X-API-Key": os.environ["WH_API_KEY"]},
)
data = res.json()
Yanıt
{
    "success": true,
    "updated": 3,
    "unread": 0
}
{
    "success": false,
    "error": "Unauthorized"
}
{
    "success": false,
    "error": "Failed to mark all notifications read"
}

Brand digest prefs

These live under /api/v1/brands/notifications/* — bkz. Brands için prefs ve prefs/save.