Developer Documentation

jekcms API Reference

Integrate jekcms into your applications. Comprehensive REST API for content management, media uploads, webhook triggers, and statistics.

REST API v1 API Key Required JSON
Base URL https://yourdomain.com/api/v1

Authentication

All API requests require an API key that must be sent with every request. Generate your key from the jekcms admin panel under Settings → API.

Header Authentication (Recommended)

# X-API-Key header GET /api/v1/posts X-API-Key: your_api_key_here # Bearer token (alternative) GET /api/v1/posts Authorization: Bearer your_api_key_here

cURL Example

Terminal
$ curl -X GET "https://yourdomain.com/api/v1/posts" \ -H "X-API-Key: your_api_key_here" \ -H "Content-Type: application/json" {"status":"ok","data":[...],"total":42,"page":1}

Security note: Never embed your API key in client-side code (JavaScript, HTML). Use it only in server-side integrations or automation tools like n8n.

Posts

GET /api/v1/posts List all posts
GET /api/v1/posts/{id} Get single post
POST /api/v1/posts Create new post
PUT /api/v1/posts/{id} Update post
DELETE /api/v1/posts/{id} Delete post

Parameters — GET /posts

# Query parameters page integer — Page number (default: 1) per_page integer — Results per page (default: 20, max: 100) status string — "published" | "draft" | "all" (default: "published") category string — Filter by category slug search string — Full-text search in title and content order string — "desc" | "asc" (default: "desc") order_by string — "date" | "title" | "views" (default: "date")

Create Post — POST /posts

{ "title": "My Post Title", "content": "<p>Full HTML content here</p>", "excerpt": "Short description", "status": "published", // "published" | "draft" "category_id": 3, "featured_image": "images/2026/01/cover.avif", "tags": ["php", "cms", "tutorial"], "seo_title": "My Post Title | jekcms", "seo_description": "SEO meta description (max 160 chars)" }

n8n integration: Use HTTP Request node in n8n to post to jekcms. Method: POST, URL: /api/v1/posts, Headers: X-API-Key. Prepare JSON body with Set node.

Media

POST /api/v1/media Upload image
GET /api/v1/media Media library
DELETE /api/v1/media/{id} Delete media

jekcms automatically converts uploaded images to AVIF and WebP formats. The original file is also retained. The response includes all three URLs.

Upload Image — POST /media

# multipart/form-data POST /api/v1/media X-API-Key: your_api_key_here Content-Type: multipart/form-data # Form fields image file — JPG / PNG / WebP / AVIF (max 10MB) alt string — Alt text (optional) folder string — Target folder e.g. "2026/05" (optional)

Response Example

{ "status": "ok", "id": 142, "path": "images/2026/05/photo.avif", "url_avif": "https://yourdomain.com/uploads/images/2026/05/photo.avif", "url_webp": "https://yourdomain.com/uploads/images/2026/05/photo.webp", "url_orig": "https://yourdomain.com/uploads/images/2026/05/photo.jpg", "width": 1200, "height": 630 }

Categories

GET /api/v1/categories List all categories
GET /api/v1/categories/{slug} Category detail

Category List Response

{ "status": "ok", "data": [ { "id": 1, "name": "Technology", "slug": "technology", "description": "Tech news and reviews", "post_count": 47 } ] }

Webhooks

jekcms sends an HTTP POST request to a URL when specific events occur. Combined with n8n, you can build powerful automation workflows.

POST /api/v1/webhook/trigger Trigger webhook
GET /api/v1/webhook/list List webhooks

Webhook Payload Structure

# jekcms sends this to your webhook URL on post.published { "event": "post.published", "timestamp": "2026-05-01T14:32:00Z", "site": "yourdomain.com", "post": { "id": 256, "title": "My New Article", "slug": "my-new-article", "url": "https://yourdomain.com/my-new-article", "category": "technology", "image": "images/2026/05/cover.avif" } }

Trigger Events

post.published — New post published post.updated — Post content updated post.deleted — Post moved to trash media.uploaded — New image uploaded comment.approved — Comment approved

Using with n8n: Create a Webhook node in n8n, save the generated URL as your webhook address in jekcms. When post.published fires, the n8n workflow starts automatically.

Statistics

GET /api/v1/stats Site metrics
GET /api/v1/stats/posts Post statistics
GET /api/v1/stats/traffic Traffic summary

GET /stats Response

{ "status": "ok", "total_posts": 342, "published": 318, "draft": 24, "total_views": 158420, "views_today": 1247, "views_this_month": 38614, "total_media": 512, "disk_used_mb": 284.6, "categories": 8, "uptime": "99.97%" }

Error Codes

All error responses use the same structure: {"status":"error","code":401,"message":"..."}. The table below lists possible error codes and recommended solutions.

Code Meaning Resolution
400 Bad Request Check JSON format and required fields.
401 Unauthorized Send your API key in the X-API-Key header.
403 Forbidden Your API key does not have permission to access this resource.
404 Not Found Check the ID or slug.
422 Validation Error Check the errors array in the response for field-level details.
429 Too Many Requests Rate limit exceeded. Check the Retry-After header and wait accordingly.
500 Internal Server Error An unexpected server-side error occurred. If the problem persists, contact support.

Retry on 429: Use exponential backoff — wait 1s, then 2s, then 4s between retries. In n8n, use the Wait node for this.

Start Using the API

Purchase jekcms, generate your API key, and start building integrations within minutes.

View Pricing
  • Full REST API access
  • n8n automation integration
  • AVIF/WebP auto-conversion
  • Webhook support
  • API key management

Be the first to know

New features, release notes & CMS guides — a couple of emails a month, no spam.