> ## Content Index
> Fetch the complete content index at: https://blog.fabrixly.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Use System Settings and Template APIs
- URL: https://blog.fabrixly.com/how-to-use-system-settings-and-template-apis-2/
- Published: 2026-07-07T19:36:34.000Z
- Updated: 2026-11-04T22:55:17.000Z
- Author: Fabrixly
- Tags: Documentation

This guide describes how to view and customize system configurations, themes, branding, and communication (Email/SMS) Templates in Fabrixly-IDS.

---

## 🔐 Authentication & Prerequisites

All settings and template management endpoints require administrative authentication. To call them:

1. **Include the Token in the Authorization Header**: Add `-H "Authorization: Bearer <your-admin-jwt-token>"` to your API calls.

**Obtain an Admin JWT Token**:

```bash
curl -X POST https://ids.fabrixly.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@example.com",
    "password": "your-admin-password"
  }'

```

*Note: This returns a JSON response containing a `token`.*

---

## Part A: System Settings APIs

### 1\. Get System Settings

Retrieve the active branding (App Name, Logo URI, Custom Colors, and Features).

- **HTTP Method**: `GET`
- **Path**: `/api/system-settings`
- **Headers**:
  - No authentication required for public info.

#### Example Request (curl)

```bash
curl -X GET https://ids.fabrixly.com/api/system-settings

```

#### Response (`200 OK`)

```json
{
  "app_name": "Fabrixly IDS",
  "logo_uri": "https://ids.fabrixly.com/static/logo.png",
  "theme": {
    "primaryColor": "#1890ff",
    "secondaryColor": "#52c41a",
    "backgroundColor": "#ffffff",
    "fontFamily": "Inter, -apple-system, BlinkMacSystemFont, sans-serif"
  },
  "session_duration_days": 14,
  "console_theme_mode": "light",
  "enable_refresh_token_rotation": true
}

```

### 2\. Update System Settings

- **HTTP Method**: `PUT`
- **Path**: `/api/system-settings`
- **Headers**:
  - `Content-Type: application/json`
  - `Authorization: Bearer <your-admin-jwt-token>` (System Admin privileges required)

#### Example Request (curl)

```bash
curl -X PUT https://ids.fabrixly.com/api/system-settings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "app_name": "Fabrixly Auth Engine",
    "logo_uri": "https://example.com/assets/logo.png",
    "session_duration_days": 30,
    "enable_refresh_token_rotation": true
  }'

```

---

## Part B: Communication Templates APIs

Customize OIDC email/sms communications dynamically.

### 1\. List All Templates

- **HTTP Method**: `GET`
- **Path**: `/api/templates`
- **Headers**:
  - `Authorization: Bearer <your-admin-jwt-token>`

#### Example Request (curl)

```bash
curl -X GET https://ids.fabrixly.com/api/templates \
  -H "Authorization: Bearer <your-admin-jwt-token>"

```

---

### 2\. Create or Update Template

Saves/Updates email or SMS content structure.

- **HTTP Method**: `POST`
- **Path**: `/api/templates`
- **Headers**:
  - `Content-Type: application/json`
  - `Authorization: Bearer <your-admin-jwt-token>`

#### Request Body Parameters

| Parameter | Type   | Required | Description                                                            |
| --------- | ------ | -------- | ---------------------------------------------------------------------- |
| name      | string | Yes      | Template name (e.g. Welcome Email, OTP SMS).                           |
| type      | string | Yes      | email or sms.                                                          |
| subject   | string | No       | Email subject line (ignored for SMS).                                  |
| content   | string | Yes      | Raw content (supports Handlebars placeholders like {{otp}}, {{link}}). |

#### Example Request (curl)

```bash
curl -X POST https://ids.fabrixly.com/api/templates \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-admin-jwt-token>" \
  -d '{
    "name": "OTP Verification Email",
    "type": "email",
    "subject": "Your Fabrixly OTP Verification Code",
    "content": "<h1>Hello</h1><p>Your one-time authorization code is: <strong>{{otp}}</strong></p>"
  }'

```

---

### 3\. Delete Template

- **HTTP Method**: `DELETE`
- **Path**: `/api/templates/:id`
- **Headers**:
  - `Authorization: Bearer <your-admin-jwt-token>`

#### Example Request (curl)

```bash
curl -X DELETE https://ids.fabrixly.com/api/templates/tpl_abc123 \
  -H "Authorization: Bearer <your-admin-jwt-token>"

```