Skip to main content

Articles

In Directify, articles are blog posts that appear in your directory’s blog section. These can be written in HTML or Markdown format and include full SEO metadata support. The API uses slug-based storage to prevent duplicate articles and automatically generates SEO-friendly URLs.

Get Directory Articles

Retrieve all articles for a specific directory with pagination.
Parameters:
  • directory_id (integer, required): The ID of the directory
Query Parameters:
  • page (integer, optional): Page number for pagination (default: 1)
Response:

Get Single Article

Retrieve a specific article by ID.
Parameters:
  • directory_id (integer, required): The ID of the directory
  • article_id (integer, required): The ID of the article
Response:

Check Article Exists

Check if an article with a specific slug already exists in the directory.
Parameters:
  • directory_id (integer, required): The ID of the directory
Request Body:
Request Body Fields:
  • slug (string, required): The article slug to check for existence
Response (Article exists):
Response (Article doesn’t exist):

Create Article

Create a new article in the directory. The API uses updateOrCreate based on slug to prevent duplicates.
Parameters:
  • directory_id (integer, required): The ID of the directory
Request Body:
Request Body Fields:
  • title (string, required): The article title (max 255 characters)
  • slug (string, optional): URL-safe slug (lowercase letters, numbers, hyphens only). Auto-generated from title if not provided
  • content (string, optional): HTML content of the article. Required if markdown is not provided
  • markdown (string, optional): Markdown content of the article. Required if content is not provided
  • active (boolean, optional): Whether the article is published (default: true)
  • published_at (datetime, optional): Publication date (default: current timestamp)
  • thumbnail_url (string, optional): URL to the article thumbnail image (max 255 characters)
  • thumbnail_alt_text (string, optional): Alt text for the thumbnail image (max 255 characters)
  • categories (array, optional): Array of category strings for organizing articles
  • seo (object, optional): SEO metadata object with the following optional fields:
    • title (string, optional): SEO title (max 255 characters)
    • description (string, optional): Meta description (max 500 characters)
    • keywords (string, optional): Meta keywords (max 255 characters)
    • og_title (string, optional): Open Graph title (max 255 characters)
    • og_description (string, optional): Open Graph description (max 500 characters)
    • og_image (string, optional): Open Graph image URL (max 255 characters)
    • twitter_title (string, optional): Twitter card title (max 255 characters)
    • twitter_description (string, optional): Twitter card description (max 500 characters)
    • twitter_image (string, optional): Twitter card image URL (max 255 characters)
    • canonical (string, optional): Canonical URL (max 255 characters). Leave empty to use the article’s own URL
Response:

Update Article

Update an existing article. If the title changes and no slug is provided, a new slug will be automatically generated.
Parameters:
  • directory_id (integer, required): The ID of the directory
  • article_id (integer, required): The ID of the article
Request Body:
Request Body Fields:
  • title (string, optional): The article title (max 255 characters)
  • slug (string, optional): URL-safe slug (lowercase letters, numbers, hyphens only). Auto-generated from title if title changes and no slug provided
  • content (string, optional): HTML content of the article. Required if markdown is not provided
  • markdown (string, optional): Markdown content of the article. Required if content is not provided
  • active (boolean, optional): Whether the article is published
  • published_at (datetime, optional): Publication date
  • thumbnail_url (string, optional): URL to the article thumbnail image (max 255 characters)
  • thumbnail_alt_text (string, optional): Alt text for the thumbnail image (max 255 characters)
  • categories (array, optional): Array of category strings for organizing articles
  • seo (object, optional): SEO metadata object with the following optional fields:
    • title (string, optional): SEO title (max 255 characters)
    • description (string, optional): Meta description (max 500 characters)
    • keywords (string, optional): Meta keywords (max 255 characters)
    • og_title (string, optional): Open Graph title (max 255 characters)
    • og_description (string, optional): Open Graph description (max 500 characters)
    • og_image (string, optional): Open Graph image URL (max 255 characters)
    • twitter_title (string, optional): Twitter card title (max 255 characters)
    • twitter_description (string, optional): Twitter card description (max 500 characters)
    • twitter_image (string, optional): Twitter card image URL (max 255 characters)
    • canonical (string, optional): Canonical URL (max 255 characters). Leave empty to use the article’s own URL
Response:

Toggle Article Status

Toggle the active status of an article (publish/unpublish).
Parameters:
  • directory_id (integer, required): The ID of the directory
  • article_id (integer, required): The ID of the article
Response:

Get Articles by Category

Retrieve articles filtered by a specific category.
Parameters:
  • directory_id (integer, required): The ID of the directory
  • category (string, required): The category name to filter by
Query Parameters:
  • page (integer, optional): Page number for pagination (default: 1)
Response:

Delete Article

Delete an article from the directory.
Parameters:
  • directory_id (integer, required): The ID of the directory
  • article_id (integer, required): The ID of the article
Response:

Key Features

Slug-Based Storage

  • Articles are stored using updateOrCreate based on slug to prevent duplicates
  • Slugs are automatically generated from titles if not provided
  • Slugs must be URL-safe (lowercase letters, numbers, and hyphens only)
  • Slugs are unique within each directory

Content Format Support

  • Support for both HTML and Markdown content
  • Use either content (HTML) or markdown field
  • At least one content field is required (required_without validation)
  • is_markdown flag indicates which format is being used

SEO Integration

  • Full SEO metadata support including Open Graph and Twitter cards
  • SEO data is automatically created/updated with articles
  • Canonical URLs supported via seo.canonical (leave empty to use the article’s own URL)
  • SEO data is optional but recommended for better search visibility

Category Management

  • Articles support multiple categories as an array of strings
  • Categories can be used for filtering and organization
  • Category filtering endpoint available for easy content discovery

BlogBuster Integration

  • Support for blog_buster_article_id field for external article management
  • Compatible with existing BlogBuster article import workflows
  • Maintains integration with automated article pulling systems