API Reference - Image Settings
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108119
← Back to API Reference | Getting Started
Image Settings
Image Settings define the dimension constraints and aspect ratio rules for each image slot on your directory site (EG profile photos, cover images, post thumbnails). Each record specifies a named image type, its required dimensions, minimum dimensions, and the target aspect ratio. These settings are used by the platform's image processing pipeline when members upload photos.
image_settings — DB table: image_settingsThe Image Setting Object
| Field | Type | Description |
|---|---|---|
setting_id | integer | Unique image setting ID (primary key, read-only) |
setting_nickname | string | Human-readable label for this image slot displayed in the admin panel (EG Profile Photo); max 255 characters required on create |
setting_name | string | Machine-readable key identifying this image slot (EG profile_photo, cover_image); max 255 characters required on create |
setting_category | string | Category grouping for this image slot (EG profile_photo, post_image); max 255 characters |
setting_scope | string | Scope controlling which user level this setting applies to (EG parent, child); max 255 characters |
setting_description | text | Admin-facing description explaining this image slot's purpose, recommended dimensions, and usage |
ratio | string | Target aspect ratio for cropping or enforcing proportions (EG 1:1, 3:4, 16:9); max 50 characters |
width | integer | Target width in pixels that uploaded images will be resized to |
height | integer | Target height in pixels that uploaded images will be resized to |
min_height | integer | Minimum required height in pixels; uploads smaller than this will be rejected |
min_width | integer | Minimum required width in pixels; uploads smaller than this will be rejected |
List Image Settings
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/image_settings/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"setting_id": "1",
"setting_nickname": "Profile Photo",
"setting_name": "profile_photo",
"setting_category": "profile_photo",
"setting_scope": "parent",
"setting_description": "The maximum dimensions and ratio that your profile photos used on the website will have. The recommended default settings are a ratio of 1:1, a width of 400, and a height of 400.",
"ratio": "1:1",
"width": "400",
"height": "400",
"min_height": "200",
"min_width": "200"
}
],
"total": "10",
"current_page": 1,
"total_pages": 1
}Retrieve an Image Setting
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/image_settings/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"setting_id": "1",
"setting_nickname": "Profile Photo",
"setting_name": "profile_photo",
"setting_category": "profile_photo",
"setting_scope": "parent",
"setting_description": "The maximum dimensions and ratio that your profile photos used on the website will have. The recommended default settings are a ratio of 1:1, a width of 400, and a height of 400.",
"ratio": "1:1",
"width": "400",
"height": "400",
"min_height": "200",
"min_width": "200"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create an Image Setting
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/image_settings/create" \ -H "X-Api-Key: your-api-key-here" \ -d "setting_nickname=Banner+Image" \ -d "setting_name=banner_image" \ -d "setting_category=banner" \ -d "setting_scope=parent" \ -d "ratio=16:9" \ -d "width=1200" \ -d "height=675" \ -d "min_height=200" \ -d "min_width=355"
Example Response
{
"status": "success",
"message": {
"setting_id": "11",
"setting_nickname": "Banner Image",
"setting_name": "banner_image",
"setting_category": "banner",
"setting_scope": "parent",
"setting_description": null,
"ratio": "16:9",
"width": "1200",
"height": "675",
"min_height": "200",
"min_width": "355"
}
}Update an Image Setting
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/image_settings/update" \ -H "X-Api-Key: your-api-key-here" \ -d "setting_id=11" \ -d "width=1600" \ -d "height=900" \ -d "min_width=400" \ -d "min_height=225"
Example Response
{
"status": "success",
"message": {
"setting_id": "11",
"setting_nickname": "Banner Image",
"setting_name": "banner_image",
"setting_category": "banner",
"setting_scope": "parent",
"setting_description": "",
"ratio": "16:9",
"width": "1600",
"height": "900",
"min_height": "225",
"min_width": "400"
}
}Delete an Image Setting
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/image_settings/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "setting_id=11"
Example Response
{
"status": "success",
"message": "image_settings record was deleted"
}