API Reference - SEO Templates

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108124

← Back to API Reference | Getting Started

SEO Templates

SEO Templates define the reusable SEO metadata patterns applied to dynamically generated pages such as category search results, service pages, and location pages. Each template uses token placeholders (EG %Profession_name%, %Service_name%) that are substituted at runtime to produce unique, keyword-rich titles and meta descriptions at scale. This is primarily a reference table used for GET operations; templates are typically managed through the admin panel.

Model name in URL: list_seo_template — DB table: list_seo_template

The SEO Template Object

FieldTypeDescription
template_idintegerUnique template ID (primary key, read-only)
master_idintegerMaster record ID; 0 for site-level templates
seo_typestringPage type this template applies to (EG profile_search_results, category); max 255 characters
databasestringDatabase table associated with this page type; max 255 characters
sectionstringSection or sub-type within the page type; max 255 characters
database_idintegerID of the associated database record; 0 for global templates
filenamestringURL pattern template for generated pages; supports token placeholders (EG %profession_name%/%service_name%); max 255 characters
titlestringTitle tag template; supports token placeholders (EG %Service_name% %%Profession_name%%); max 255 characters
meta_keywordsstringMeta keywords template; supports token placeholders; max 255 characters
meta_descstringMeta description template; supports token placeholders; max 255 characters
seo_texttextAdditional SEO body text template; supports token placeholders
facebook_titlestringOpen Graph title template for social sharing; max 255 characters
facebook_descstringOpen Graph description template for social sharing; max 255 characters
facebook_imagestringOpen Graph image URL for social sharing; max 255 characters
h1textH1 heading template; supports token placeholders
h2textH2 heading template; supports token placeholders
breadcrumbtextBreadcrumb label template; supports token placeholders
content_menustringMenu section this page type belongs to; max 255 characters
nicknamestringHuman-readable label for this template displayed in the admin panel; max 255 characters
content_orderintegerSort order for this template within its page type group
contenttextMain HTML content template for generated pages; supports widget shortcodes
content_footertextFooter content template for generated pages
content_activeintegerWhether the content section is active; 1 = active, 0 = hidden
show_formintegerWhether to display a contact form on generated pages; 1 = show, 0 = hide
form_namestringName of the form to display if show_form is enabled; max 255 characters
content_imagestextJSON array of image references used in the template content
date_updatedstringTimestamp of last update in YYYYMMDDHHmmss format; max 14 characters
updated_bystringEmail or identifier of the admin who last updated this record; max 25 characters
content_csstextCustom CSS scoped to generated pages using this template
menu_layoutstringLayout template to use for the navigation menu on generated pages; max 255 characters
hide_from_menuintegerWhether to hide generated pages from navigation menus; 1 = hidden, 0 = visible
hide_header_linksintegerWhether to hide header navigation links on generated pages; 1 = hidden, 0 = visible
hide_headerintegerWhether to hide the site header on generated pages; 1 = hidden, 0 = visible
hide_footerintegerWhether to hide the site footer on generated pages; 1 = hidden, 0 = visible
hide_top_rightintegerWhether to hide the top-right header area on generated pages; 1 = hidden, 0 = visible
content_groupstringGroup label for organizing this template in the admin panel; max 255 characters
content_settingsstringJSON object of additional page settings and layout options; max 255 characters
content_layoutstringLayout variant to use for the content area of generated pages; max 255 characters
content_headtextHTML or widget shortcodes injected into the header area of generated pages
content_sidebarstringSidebar configuration or widget shortcode for generated pages; max 255 characters
revision_timestamptimestampLast modified timestamp (auto-updated)
allowed_productsstringComma-separated list of plan/product IDs that can view generated pages; empty means all plans; max 255 characters
content_footer_htmltextRaw HTML injected at the bottom of generated pages

List SEO Templates

GET /api/v2/list_seo_template/get

Returns a paginated list of SEO template records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_seo_template/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "template_id": "4",
      "master_id": "0",
      "seo_type": "profile_search_results",
      "database": "users_data",
      "section": "",
      "database_id": "0",
      "filename": "%profession_name%/%service_name%",
      "title": "%Service_name% %%Profession_name%% - %%Profession_name%% Specializing in %Service_name%",
      "meta_keywords": "%Profession_name%,%%Profession_name%%,%Service_name%",
      "meta_desc": "Search our database of %%Profession_name%% specializing in %Service_name%%.",
      "seo_text": "",
      "facebook_title": "The Best %%Profession_name%% Offering %Service_name%%",
      "facebook_desc": "Who is the best %Profession_name% specializing in %Service_name%?",
      "facebook_image": "",
      "h1": "",
      "h2": "",
      "breadcrumb": "",
      "nickname": "Search Results - Members - Main / Sub Category",
      "content_order": "0",
      "content": "",
      "content_active": "1",
      "revision_timestamp": "2024-08-25 14:22:14"
    }
  ],
  "total": "18",
  "current_page": 1,
  "total_pages": 1
}

Retrieve an SEO Template Record

GET /api/v2/list_seo_template/get/{template_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_seo_template/get/4" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "template_id": "4",
      "master_id": "0",
      "seo_type": "profile_search_results",
      "database": "users_data",
      "filename": "%profession_name%/%service_name%",
      "title": "%Service_name% %%Profession_name%%",
      "nickname": "Search Results - Members - Main / Sub Category",
      "revision_timestamp": "2024-08-25 14:22:14"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create an SEO Template Record

POST /api/v2/list_seo_template/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/list_seo_template/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "seo_type=location_results" \
  -d "database=users_data" \
  -d "filename=%profession_name%/in/%location_name%" \
  -d "title=%Profession_name%+in+%Location_name%+-+Find+Local+%Profession_name%" \
  -d "nickname=Location+Search+Results" \
  -d "content_active=1"

Example Response

Copy
{
  "status": "success",
  "message": {
    "template_id": "19",
    "seo_type": "location_results",
    "database": "users_data",
    "filename": "%profession_name%/in/%location_name%",
    "title": "%Profession_name% in %Location_name% - Find Local %Profession_name%",
    "nickname": "Location Search Results",
    "content_active": "1"
  }
}

Update an SEO Template Record

PUT /api/v2/list_seo_template/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/list_seo_template/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "template_id=19" \
  -d "meta_desc=Find+the+best+%Profession_name%+in+%Location_name%.+Compare+and+connect+today."

Example Response

Copy
{
  "status": "success",
  "message": {
    "template_id": "19",
    "seo_type": "location_results",
    "filename": "%profession_name%/in/%location_name%",
    "title": "%Profession_name% in %Location_name% - Find Local %Profession_name%",
    "meta_desc": "Find the best %Profession_name% in %Location_name%. Compare and connect today."
  }
}

Delete an SEO Template Record

DELETE /api/v2/list_seo_template/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/list_seo_template/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "template_id=19"

Example Response

Copy
{
  "status": "success",
  "message": "list_seo_template record was deleted"
}