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

# Notifications

> In-app notifications and email preference management endpoints

# Notifications

## List Notifications

Retrieve the current user's notifications.

<CodeGroup>
  ```bash curl theme={null}
  curl -H "Authorization: Bearer thig_YOUR_KEY" \
    https://app.thig.ai/api/notifications
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('/api/notifications', {
    headers: { 'Authorization': 'Bearer thig_YOUR_KEY' }
  });
  const { notifications } = await res.json();
  ```
</CodeGroup>

## Mark Notification as Read

```bash theme={null}
curl -X PATCH https://app.thig.ai/api/notifications/NOTIFICATION_ID \
  -H "Authorization: Bearer thig_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"read": true}'
```

## Notification Preferences

### Get Preferences

```bash theme={null}
curl -H "Authorization: Bearer thig_YOUR_KEY" \
  https://app.thig.ai/api/user/notification-preferences
```

### Response

```json theme={null}
{
  "emailNotifications": true,
  "projectUpdates": true,
  "teamActivity": true,
  "commentMentions": true,
  "exportNotifications": true,
  "billingAlerts": true,
  "weeklyDigest": true,
  "securityAlerts": true
}
```

### Update Preferences

<ParamField body="emailNotifications" type="boolean">
  Master toggle for all email notifications
</ParamField>

<ParamField body="projectUpdates" type="boolean">
  Project status changes, PRD generation
</ParamField>

<ParamField body="teamActivity" type="boolean">
  Member joins, role changes
</ParamField>

<ParamField body="commentMentions" type="boolean">
  Comment replies and mentions
</ParamField>

<ParamField body="exportNotifications" type="boolean">
  Export completions and scheduled exports
</ParamField>

<ParamField body="billingAlerts" type="boolean">
  Usage warnings, payment issues
</ParamField>

<ParamField body="weeklyDigest" type="boolean">
  Weekly activity summary email
</ParamField>

<ParamField body="securityAlerts" type="boolean">
  Login events, MFA changes, password resets
</ParamField>

```bash theme={null}
curl -X PATCH https://app.thig.ai/api/user/notification-preferences \
  -H "Authorization: Bearer thig_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"weeklyDigest": false, "teamActivity": false}'
```

## Scheduled Exports

### List Scheduled Exports

```bash theme={null}
curl -H "Authorization: Bearer thig_YOUR_KEY" \
  https://app.thig.ai/api/scheduled-exports
```

### Create Scheduled Export

```bash theme={null}
curl -X POST https://app.thig.ai/api/scheduled-exports \
  -H "Authorization: Bearer thig_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "PROJECT_ID",
    "format": "pdf",
    "scheduleType": "weekly",
    "cronExpression": "0 9 * * 1",
    "deliveryMethod": "email",
    "recipients": ["pm@example.com", "cto@example.com"],
    "includeChangelog": true
  }'
```

### Run Export Now

```bash theme={null}
curl -X POST https://app.thig.ai/api/scheduled-exports/EXPORT_ID/run \
  -H "Authorization: Bearer thig_YOUR_KEY"
```

### Toggle / Delete

```bash theme={null}
# Toggle active/inactive
curl -X PATCH https://app.thig.ai/api/scheduled-exports/EXPORT_ID \
  -H "Authorization: Bearer thig_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isActive": false}'

# Delete
curl -X DELETE https://app.thig.ai/api/scheduled-exports/EXPORT_ID \
  -H "Authorization: Bearer thig_YOUR_KEY"
```
