Skip to main content

Overview

Organization settings allow you to customize the behavior and appearance of your RestAI instance. Settings are stored as a flexible JSON object that can contain any configuration values your application needs.

Updating Settings

Settings are updated using the PATCH endpoint on the organization resource:
PATCH /v1/orgs/:id
Required Permission: org:update

Common Settings

While the settings field accepts any JSON object, here are commonly used configuration options:

Business Settings

settings.timezone
string
Default timezone for the organization (IANA format)Example: "America/Lima", "America/New_York"
settings.currency
string
Default currency for the organization (ISO 4217)Example: "PEN", "USD", "EUR"
settings.tax_included
boolean
Whether prices include tax by defaultExample: true or false
settings.default_language
string
Default language for the organizationExample: "es", "en"

Display Settings

settings.brand_color
string
Primary brand color (hex format)Example: "#FF6B35"
settings.logo_position
string
Logo position in customer-facing interfacesOptions: "left", "center", "right"
settings.show_preparation_time
boolean
Display estimated preparation time to customers

Operational Settings

settings.enable_reservations
boolean
Allow customers to make table reservations
settings.enable_delivery
boolean
Enable delivery order type
settings.enable_takeout
boolean
Enable takeout order type
settings.auto_print_orders
boolean
Automatically print orders to kitchen
settings.require_customer_name
boolean
Make customer name required for orders

Notification Settings

settings.notification_email
string
Email address for system notifications
settings.order_notifications
boolean
Send notifications for new orders
settings.low_stock_alerts
boolean
Send alerts when inventory is low

Example: Update Organization Settings

Request:
curl -X PATCH https://api.restai.com/v1/orgs/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Restaurante El Buen Sabor",
    "logo_url": "https://example.com/logo.png",
    "settings": {
      "timezone": "America/Lima",
      "currency": "PEN",
      "tax_included": true,
      "default_language": "es",
      "brand_color": "#FF6B35",
      "enable_reservations": true,
      "enable_delivery": true,
      "enable_takeout": true,
      "auto_print_orders": false,
      "require_customer_name": true,
      "notification_email": "[email protected]",
      "order_notifications": true,
      "low_stock_alerts": true,
      "show_preparation_time": true
    }
  }'
Response:
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Restaurante El Buen Sabor",
    "logo_url": "https://example.com/logo.png",
    "settings": {
      "timezone": "America/Lima",
      "currency": "PEN",
      "tax_included": true,
      "default_language": "es",
      "brand_color": "#FF6B35",
      "enable_reservations": true,
      "enable_delivery": true,
      "enable_takeout": true,
      "auto_print_orders": false,
      "require_customer_name": true,
      "notification_email": "[email protected]",
      "order_notifications": true,
      "low_stock_alerts": true,
      "show_preparation_time": true
    },
    "created_at": "2024-01-15T10:00:00Z",
    "updated_at": "2024-03-02T12:00:00Z"
  }
}

Example: Partial Settings Update

You can update individual settings without affecting others: Request:
curl -X PATCH https://api.restai.com/v1/orgs/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "brand_color": "#2C3E50",
      "enable_delivery": false
    }
  }'
The entire settings object is replaced when updated. Make sure to include all settings you want to preserve, or retrieve the current settings first and merge your changes.

Logo Management

The organization logo is managed via the logo_url field at the root level: Update Logo:
curl -X PATCH https://api.restai.com/v1/orgs/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "logo_url": "https://cdn.example.com/logos/new-logo.png"
  }'
Remove Logo:
curl -X PATCH https://api.restai.com/v1/orgs/123e4567-e89b-12d3-a456-426614174000 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "logo_url": null
  }'

Best Practices

Version your settings schema: As your application evolves, maintain backward compatibility with older settings structures.
Use typed settings: In your application code, define TypeScript interfaces for your settings to ensure type safety.
Validate settings: Implement validation logic to ensure settings contain valid values before saving.
Document custom settings: Keep internal documentation of any custom settings your application uses.

Validation Rules

  • name: 2-255 characters
  • logo_url: Must be a valid URL or null
  • settings: Any valid JSON object

Organizations

View all organization endpoints

Branches

Branch-level settings

Build docs developers (and LLMs) love