Updating Blog Post
Endpoint: PUT /admin/blogs/{blog_id}
Purpose
This API allows administrators to update an existing blog entry by specifying its ID. The endpoint supports modifications such as updating the blog’s title, content, image, metadata, publication status, visibility, and SEO configuration. It helps maintain accurate and optimized content for audience engagement and discoverability.
Path Parameters
Parameter | Type | Description |
---|---|---|
blog_id | Integer | The unique ID of the blog post |
Query Parameters
No query parameters for this endpoint.
Use Case
This API is used to update the content and metadata of an existing blog. Administrators may change the title, revise the content, change visibility or publication status, assign categories, and update SEO metadata like canonical URLs, tracking settings, and analytics integrations. This ensures blog entries remain relevant and properly optimized.
Request Body
Key | Type | Description |
---|---|---|
title | String | Title of the blog post. |
categories | Array | List of category objects the blog belongs to. |
selected_customers | Object | Contains customer and group IDs the blog is targeted to. |
image | Object | Information about the blog's associated image. |
content | String | Main body content of the blog. |
date | String | Date the blog was created or scheduled. |
status | String | Status of the blog post (e.g., draft, published). |
visibility | String | Defines who can view the blog (e.g., public, private, restricted). |
url | String | URL slug or permalink for the blog. |
type | String | Type of blog content (e.g., 'page_seo'). |
page_seo | Object | SEO-related settings for the blog. |
tag_name | String | Name of the custom HTML tag associated with the blog. |
tag_content | String | Content for the custom HTML tag. |
{
"blog": {
"title": "BLOG_TITLE",
"categories": [
{
"id": "CATEGORY_ID"
}
],
"image": {
"file_name": "BLOG_IMAGE_FILE_NAME",
"base64": "BLOG_IMAGE_BASE64_ENCODED"
},
"content": "BLOG_CONTENT",
"date": "BLOG_DATE",
"status": "BLOG_STATUS",
"visibility": "BLOG_VISIBILITY",
"url": "BLOG_URL",
"type": "BLOG_TYPE",
"page_seo": {
"overwite_auto_page_seo": "PAGE_SEO_OVERWRITE_AUTO",
"seo_title": "PAGE_SEO_TITLE",
"seo_description": "PAGE_SEO_DESCRIPTION",
"disable_search_engine_index": "PAGE_SEO_DISABLE_INDEX",
"enable_canonical_url": "PAGE_SEO_ENABLE_CANONICAL",
"enable_meta_tag": "PAGE_SEO_ENABLE_META",
"analytics_use_default": "PAGE_SEO_ANALYTICS_USE_DEFAULT",
"tracking_enabled": "PAGE_SEO_TRACKING_ENABLED",
"tracking_method": "PAGE_SEO_TRACKING_METHOD",
"google_analytics_enabled": "GOOGLE_ANALYTICS_ENABLED",
"google_analytics_4": "GOOGLE_ANALYTICS_4_ID",
"google_ads_conversion_id": "GOOGLE_ADS_CONVERSION_ID",
"google_ads_conversion_label": "GOOGLE_ADS_CONVERSION_LABEL",
"google_analytics_debug_mode_enabled": "GA_DEBUG_MODE",
"google_analytics_track_event_enable": "GA_TRACK_EVENTS",
"google_analytics_add_to_cart_event": "GA_ADD_TO_CART_EVENT",
"google_analytics_view_item_event": "GA_VIEW_ITEM_EVENT",
"google_analytics_view_item_list_event": "GA_VIEW_ITEM_LIST_EVENT",
"google_analytics_begin_checkout_event": "GA_BEGIN_CHECKOUT_EVENT",
"google_analytics_purchase_event": "GA_PURCHASE_EVENT",
"google_analytics_remove_from_cart_event": "GA_REMOVE_FROM_CART_EVENT",
"google_analytics_view_cart_event": "GA_VIEW_CART_EVENT",
"google_analytics_add_payment_info_event": "GA_ADD_PAYMENT_INFO_EVENT",
"google_analytics_add_shipping_info_event": "GA_ADD_SHIPPING_INFO_EVENT",
"facebook_pixel_enabled": "FACEBOOK_PIXEL_ENABLED",
"facebook_pixel_id": "FACEBOOK_PIXEL_ID",
"facebook_pixel_track_event_enable": "FACEBOOK_PIXEL_TRACK_EVENTS",
"facebook_pixel_add_payment_info_event": "FACEBOOK_PIXEL_ADD_PAYMENT_INFO_EVENT",
"facebook_pixel_add_to_cart_event": "FACEBOOK_PIXEL_ADD_TO_CART_EVENT",
"facebook_pixel_initiate_checkout_event": "FACEBOOK_PIXEL_INITIATE_CHECKOUT_EVENT",
"facebook_pixel_purchase_event": "FACEBOOK_PIXEL_PURCHASE_EVENT",
"facebook_pixel_search_event": "FACEBOOK_PIXEL_SEARCH_EVENT",
"custom_code_use_default": "CUSTOM_CODE_USE_DEFAULT",
"is_custom_code_enable_in_header": "CUSTOM_CODE_ENABLE_HEADER",
"custom_code_in_header": "CUSTOM_CODE_HEADER_CONTENT",
"is_custom_code_enable_in_footer": "CUSTOM_CODE_ENABLE_FOOTER",
"custom_code_in_footer": "CUSTOM_CODE_FOOTER_CONTENT"
},
"tag_name": "BLOG_TAG_NAME",
"tag_content": "BLOG_TAG_CONTENT"
}
}
Response
{
"blog": {
"id": BLOG_ID,
"name": "BLOG_TITLE",
"url": "BLOG_URL",
"content": "BLOG_CONTENT",
"date": "BLOG_DATE",
"is_published": BLOG_PUBLISHED_STATUS,
"visibility": "BLOG_VISIBILITY",
"categories": [],
"created_at": "BLOG_CREATED_AT",
"is_disposible": BLOG_IS_DISPOSABLE,
"is_in_trash": BLOG_IS_IN_TRASH,
"image": {
"title": "BLOG_IMAGE_TITLE",
"alternative_text": "BLOG_IMAGE_ALT_TEXT",
"file_name": "BLOG_IMAGE_FILE_NAME",
"link": "BLOG_IMAGE_LINK"
},
"created_by": {
"id": CREATED_BY_ID,
"name": "CREATED_BY_NAME"
},
"selected_customers": [],
"seo_configs": [
{
"id": SEO_CONFIG_ID_1,
"value": "SEO_CONFIG_VALUE_1",
"type": "SEO_TYPE",
"config_key": "SEO_CONFIG_KEY_1"
},
{
"id": SEO_CONFIG_ID_2,
"value": "SEO_CONFIG_VALUE_2",
"type": "SEO_TYPE",
"config_key": "SEO_CONFIG_KEY_2"
},
{
"id": SEO_CONFIG_ID_3,
"value": "SEO_CONFIG_VALUE_3",
"type": "SEO_TYPE",
"config_key": "SEO_CONFIG_KEY_3"
}
]
}
}
Updating a Blog Category
Endpoint: PUT /admin/blog_categories/{category_id}
Purpose
This endpoint updates an existing blog category's information by specifying its ID. Admins can modify the category's name, description, associated blogs, image, SEO settings, visibility status, and other meta details. It ensures that blog organization remains flexible and aligned with marketing or content strategies over time.
Path Parameters
Parameter | Type | Description |
---|---|---|
category_id | Number | Required. The unique ID of the blog category to update. |
Query Parameters
No query parameters for this endpoint.
Use Case
An admin updates a blog category when its description needs revision, a new image must be added, or the SEO configurations require optimization for better search engine performance. It is commonly used during blog restructuring, rebranding, or regular SEO enhancements.
Request Body
Key | Type | Description |
---|---|---|
name | String | Name of the blog category. |
description | String | Description of the blog category. |
blogs | Array | List of blog references linked to this category. |
image | Object | Image information related to the category. |
content | String | Content or body text related to the category. |
date | String | Date/time associated with the blog category. |
status | String | Publication status (e.g., draft, published). |
visibility | String | Visibility level (e.g., public, private). |
url | String | URL slug for the category page. |
type | String | Type identifier, typically used for SEO settings. |
page_seo | Object | SEO configuration for the category. |
tag_name | String | Custom HTML tag name. |
tag_content | String | Content for the custom HTML tag. |
{
"blog_category": {
"name": "CATEGORY_NAME",
"description": "CATEGORY_DESCRIPTION",
"blogs": [
{
"id": "BLOG_ID"
}
],
"image": {
"title": "IMAGE_TITLE",
"alternative_text": "IMAGE_ALTERNATIVE_TEXT",
"file_name": "IMAGE_FILE_NAME",
"base64": "IMAGE_BASE64_ENCODED_STRING"
},
"content": "BLOG_CONTENT",
"date": "BLOG_DATE_TIME",
"status": "BLOG_STATUS",
"visibility": "BLOG_VISIBILITY",
"url": "BLOG_URL",
"type": "PAGE_SEO",
"page_seo": {
"overwite_auto_page_seo": "OVERWRITE_AUTO_PAGE_SEO",
"seo_title": "SEO_TITLE",
"seo_description": "SEO_DESCRIPTION",
"disable_search_engine_index": "DISABLE_SEARCH_ENGINE_INDEX",
"enable_canonical_url": "ENABLE_CANONICAL_URL",
"enable_meta_tag": "ENABLE_META_TAG",
"analytics_use_default": "ANALYTICS_USE_DEFAULT",
"tracking_enabled": "TRACKING_ENABLED",
"tracking_method": "TRACKING_METHOD",
"google_analytics_enabled": "GOOGLE_ANALYTICS_ENABLED",
"google_analytics_4": "GOOGLE_ANALYTICS_4",
"google_ads_conversion_id": "GOOGLE_ADS_CONVERSION_ID",
"google_ads_conversion_label": "GOOGLE_ADS_CONVERSION_LABEL",
"google_analytics_debug_mode_enabled": "GOOGLE_ANALYTICS_DEBUG_MODE_ENABLED",
"google_analytics_track_event_enable": "GOOGLE_ANALYTICS_TRACK_EVENT_ENABLE",
"google_analytics_add_to_cart_event": "GOOGLE_ANALYTICS_ADD_TO_CART_EVENT",
"google_analytics_view_item_event": "GOOGLE_ANALYTICS_VIEW_ITEM_EVENT",
"google_analytics_view_item_list_event": "GOOGLE_ANALYTICS_VIEW_ITEM_LIST_EVENT",
"google_analytics_begin_checkout_event": "GOOGLE_ANALYTICS_BEGIN_CHECKOUT_EVENT",
"google_analytics_purchase_event": "GOOGLE_ANALYTICS_PURCHASE_EVENT",
"google_analytics_remove_from_cart_event": "GOOGLE_ANALYTICS_REMOVE_FROM_CART_EVENT",
"google_analytics_view_cart_event": "GOOGLE_ANALYTICS_VIEW_CART_EVENT",
"google_analytics_add_payment_info_event": "GOOGLE_ANALYTICS_ADD_PAYMENT_INFO_EVENT",
"google_analytics_add_shipping_info_event": "GOOGLE_ANALYTICS_ADD_SHIPPING_INFO_EVENT",
"facebook_pixel_enabled": "FACEBOOK_PIXEL_ENABLED",
"facebook_pixel_id": "FACEBOOK_PIXEL_ID",
"facebook_pixel_track_event_enable": "FACEBOOK_PIXEL_TRACK_EVENT_ENABLE",
"facebook_pixel_add_payment_info_event": "FACEBOOK_PIXEL_ADD_PAYMENT_INFO_EVENT",
"facebook_pixel_add_to_cart_event": "FACEBOOK_PIXEL_ADD_TO_CART_EVENT",
"facebook_pixel_initiate_checkout_event": "FACEBOOK_PIXEL_INITIATE_CHECKOUT_EVENT",
"facebook_pixel_purchase_event": "FACEBOOK_PIXEL_PURCHASE_EVENT",
"facebook_pixel_search_event": "FACEBOOK_PIXEL_SEARCH_EVENT",
"custom_code_use_default": "CUSTOM_CODE_USE_DEFAULT",
"is_custom_code_enable_in_header": "IS_CUSTOM_CODE_ENABLE_IN_HEADER",
"custom_code_in_header": "CUSTOM_CODE_IN_HEADER",
"is_custom_code_enable_in_footer": "IS_CUSTOM_CODE_ENABLE_IN_FOOTER",
"custom_code_in_footer": "CUSTOM_CODE_IN_FOOTER"
},
"tag_name": "TAG_NAME",
"tag_content": "TAG_CONTENT"
}
}
Response
Returns the updated blog category object, including updated ID, name, description, SEO configurations, image URL, and timestamps. The response confirms that the category was successfully modified, ensuring admins can verify the changes immediately after the update operation.
{
"blog_category": {
"id": BLOG_CATEGORY_ID,
"name": "BLOG_CATEGORY_NAME",
"url": "BLOG_CATEGORY_URL_SLUG",
"description": "BLOG_CATEGORY_DESCRIPTION",
"is_disposible": BOOLEAN,
"is_in_trash": BOOLEAN,
"image": {
"title": IMAGE_TITLE,
"alternative_text": IMAGE_ALT_TEXT,
"file_name": "IMAGE_FILE_NAME",
"link": "IMAGE_LINK_URL"
},
"created_at": "YYYY-MM-DDTHH:MM:SS",
"updated_at": "YYYY-MM-DDTHH:MM:SS",
"seo_configs": [
{
"id": SEO_CONFIG_ID_1,
"value": "SEO_CONFIG_VALUE_1",
"type": "SEO_CONFIG_TYPE",
"config_key": "SEO_CONFIG_KEY_1"
},
{
"id": SEO_CONFIG_ID_2,
"value": "SEO_CONFIG_VALUE_2",
"type": "SEO_CONFIG_TYPE",
"config_key": "SEO_CONFIG_KEY_2"
}
]
}
}