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:
Required Permission: org:update
Common Settings
While the settings field accepts any JSON object, here are commonly used configuration options:
Business Settings
Default timezone for the organization (IANA format) Example: "America/Lima", "America/New_York"
Default currency for the organization (ISO 4217) Example: "PEN", "USD", "EUR"
Whether prices include tax by default Example: true or false
settings.default_language
Default language for the organization Example: "es", "en"
Display Settings
Primary brand color (hex format) Example: "#FF6B35"
Logo position in customer-facing interfaces Options: "left", "center", "right"
settings.show_preparation_time
Display estimated preparation time to customers
Operational Settings
settings.enable_reservations
Allow customers to make table reservations
Enable delivery order type
Enable takeout order type
settings.auto_print_orders
Automatically print orders to kitchen
settings.require_customer_name
Make customer name required for orders
Notification Settings
settings.notification_email
Email address for system notifications
settings.order_notifications
Send notifications for new orders
settings.low_stock_alerts
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