Documentation
Everything you need to know about ContentShelter
Getting Started
Learn how to set up your first content and integrate with your website.
Read more โAuthentication
Secure your API with API keys and authentication methods.
Read more โAPI Reference
Complete API documentation with examples and best practices.
Read more โEmbed Scripts
How to use embed scripts to display content on your website.
Read more โContent Types
Understanding different content types and how to use them effectively.
Read more โAnalytics
Track and analyze your content performance with our analytics tools.
Read more โGetting Started
Follow these steps to create your first content and display it on your website.
Add a Website
Register your website in Dashboard โ Websites โ each site gets its own content space.
Create Content
Use the rich editor in Dashboard โ Content to write blogs, articles, and more. Publish or schedule it.
Authentication
All API requests require both an API key and an API secret, sent as request headers. Each key pair is bound to a specific website.
API Key & Secret
Include both in request headers:
Getting API Keys
- Log in to your ContentShelter dashboard
- Navigate to "API Keys" in dashboard
- Click "Create API Key"
- Configure permissions and rate limits
- Copy both API key and secret
- Each API key is website-specific for security
Keep your secret safe. Never expose the API secret in client-side code or public repositories. For client-side display, use the embed script which only needs the public API key.
API Reference
The ContentShelter API lets you securely fetch published content from your account and display it on your websites.
Your First API Request โ Step by Step
Get your API Key and Secret
- Log in to your ContentShelter dashboard
- Go to Dashboard โ API Keys
- Click "Create API Key" and select your website
- Copy both values โ the API Key (starts with
cs_) and the API Secret
Pick your endpoint URL
For example, to list your blog posts:
Add the auth headers (this is the part people miss)
Every request needs two headers. Without them you'll get "Both x-api-key and x-api-secret headers are required".
In Postman:
- Set method to GET and paste the URL
- Open the Headers tab
- Add row: Key
x-api-key, Value: your API key - Add row: Key
x-api-secret, Value: your API secret - Click Send
In JavaScript:
Read the response
A successful response looks like this:
If something goes wrong
| Error | Fix |
|---|---|
| "Both x-api-key and x-api-secret headers are required" | You didn't add the headers โ see step 3 |
| 401 "Invalid or inactive API key" | Key or secret is wrong, or the key is deactivated โ recheck in Dashboard โ API Keys |
| 403 Forbidden | Key doesn't have permission for this website โ check key settings |
| 429 Too Many Requests | Rate limit hit โ wait or raise limits in key settings |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET | /api/public/content/{contentType}/list | Key + Secret | List content of a specific type |
GET | /api/public/content/{contentType}/{slug} | Key + Secret | Get single content item |
GET | /api/public/posts | Key + Secret | List all published content (any type) |
GET | /api/public/posts/{slug} | ?apikey= param | Get single post (client-safe) |
GET | /api/public/blog | Key + Secret | List blog posts with search |
GET | /api/public/categories | Key + Secret | List categories for your website |
Ready-to-Use URLs
Copy any URL below and replace YOUR_API_KEY / YOUR_API_SECRET and SLUG with your own values. In local development, use http://localhost:3000 as the base URL.
All endpoints except /api/public/posts/SLUG require the headers x-api-key: YOUR_API_KEY and x-api-secret: YOUR_API_SECRET.
Get Content List
Parameters
contentType- Content type (blog_post, article, guide, news, faq)limit- Number of items per page (default: 10)page- Page number (default: 1)
Example Request
Response
Get Single Content
Parameters
contentType- Content typeslug- Content slug
Example Request
Response
Get All Posts
Parameters
category- Filter by category slug (optional)contentType- Filter by content type (optional)limit- Items per page (default: 10)page- Page number (default: 1)
Example Request
Get Single Post (Client-Safe)
This endpoint only requires the public API key as a query parameter โ no secret needed โ so it's safe to call directly from browser JavaScript on your website.
Example Request
Get Blog Posts
Parameters
category- Filter by category slug, or "all" (optional)search- Search title, excerpt, and content (optional)limit- Items per pagepage- Page number
Example Request
Get Categories
Returns all categories configured for the website associated with your API key. Useful for building category navigation on your site.
Example Request
Rate Limiting
API requests are rate-limited to prevent abuse. Each API key has configurable limits:
- Default limit: 1,000 requests per hour
- Rate limit headers are included in responses
- Exceeding limits returns HTTP 429 status
- Configure limits in your API key settings
Error Handling
401 Unauthorized
Missing or invalid API key
403 Forbidden
Insufficient permissions or origin not allowed
404 Not Found
Content not found
429 Too Many Requests
Rate limit exceeded
500 Internal Server Error
Server error occurred
For the full API reference including WordPress integration examples, see the API Reference page.
Embed Scripts
The fastest way to display ContentShelter content on any website โ no backend code required. Add a single script tag and your posts render automatically.
Basic Usage
Add this to your HTML before the closing body tag:
How It Works
- The script reads your API key from its own
apikeyquery parameter - It creates a
#contentshelter-containerdiv where the script tag is placed - It fetches your published blog posts and renders them as styled article cards
- Each card shows title, author, publish date, and excerpt
- Clicking "Read more" opens the full post in a modal overlay
Features
- Automatic content loading and display
- Responsive design out of the box
- Modal popup for full articles
- Automatic API key extraction from script URL
- Error handling and loading states
Note: The embed script only needs the public API key (no secret), making it safe for client-side use. It currently displays blog_post content โ use the API for other content types.
Content Types
Every piece of content has a type that determines how it's organized and fetched. Use the contentType parameter in API requests.
blog_postBlog Post
Standard blog articles with title, content, excerpt, featured image, tags, and categories. The most common content type.
guideGuide
Step-by-step instructional content and how-to documentation for your audience.
newsNews
Time-sensitive announcements, press releases, and updates about your product or company.
faqFAQ
Question-and-answer pairs for support pages and knowledge bases.
Common Fields
All content types share the same core fields:
title,slug,content(HTML),excerptfeaturedImage,tags,categoryauthor,status,publishedAt
Analytics
Track how your content performs across every website that consumes it, from the dashboard's Analytics section.
Content Performance
See views and engagement for each piece of content, broken down by content type.
API Usage
Monitor API requests per key, including request counts and rate limit usage.
Website Breakdown
Compare performance across your connected websites to see which audiences engage most.
Dashboard Access
View analytics at Dashboard โ Analytics after logging in to your account.