API Integrations

Connect your applications to our headless CMS with simple REST APIs.

Getting Started

Base URL: https://mywriter.nextjsexample.com/api/v1

All endpoints require an API Key via the x-api-key header, including Projects.

API Documentation

Read-only endpoints for accessing your content. All endpoints support JSON responses.

Projects

Read project information

GETx-api-key/projects

List projects for authenticated user.

Requirements
x-api-key header
Response
200: Project[]
Full URL
https://mywriter.nextjsexample.com/api/v1/projects
GETx-api-key/projects/:projectId

Get single project by id.

Requirements
x-api-key header; projectId path param
Response
200: Project | 404
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId

Categories

Read categories within a project

GETx-api-key/projects/:projectId/categories

List categories in a project.

Requirements
x-api-key header; projectId path param
Response
200: Category[]
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/categories
GETx-api-key/projects/:projectId/categories/:categoryId

Get category by id.

Requirements
x-api-key header; projectId, categoryId path params
Response
200: Category | 404
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/categories/:categoryId
GETx-api-key/projects/:projectId/categories/slug/:categorySlug

Get category by slug.

Requirements
x-api-key header; projectId, categorySlug path params
Response
200: Category | 404
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/categories/slug/:categorySlug

Posts

Read posts within a project

GETx-api-key/projects/:projectId/posts

List posts in project.

Requirements
x-api-key header; projectId path param
Response
200: Post[]
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/posts
GETx-api-key/projects/:projectId/posts/:postId

Get post by id.

Requirements
x-api-key header; projectId, postId path params
Response
200: Post | 404
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/posts/:postId
GETx-api-key/projects/:projectId/posts/slug/:postSlug

Get post by slug.

Requirements
x-api-key header; projectId, postSlug path params
Response
200: Post | 404
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/posts/slug/:postSlug

Research

Read research content ideas

GETx-api-key/projects/:projectId/research-content-ideas

List research content ideas.

Requirements
x-api-key header; projectId path param
Response
200: ResearchContentIdea[]
Full URL
https://mywriter.nextjsexample.com/api/v1/projects/:projectId/research-content-ideas

Integration Examples

Copy-paste ready code examples for popular languages and frameworks.

Fetch posts (JavaScript fetch)

const PROJECT_ID = '<PROJECT_ID>'; // from Project Settings
const API_KEY = '<YOUR_API_KEY>'; // from Developer Settings

const res = await fetch(`https://mywriter.nextjsexample.com/api/v1/projects/${PROJECT_ID}/posts`, {
  headers: { 'x-api-key': API_KEY }
});
const data = await res.json();
console.log(data);

Fetch posts (Python requests)

import requests

PROJECT_ID = '<PROJECT_ID>'  # from Project Settings
API_KEY = '<YOUR_API_KEY>'    # from Developer Settings

url = f"https://mywriter.nextjsexample.com/api/v1/projects/{'{' }PROJECT_ID{'}'}/posts"
headers = { 'x-api-key': API_KEY }
resp = requests.get(url, headers=headers)
print(resp.status_code)
print(resp.json())

Frontend Components

Drop-in UI components you can reuse in your frontend applications.

We are building a UI for this soon