Documentation

Learn how to use MyDrafts API to access and manage your content.

Quick Start

To get started with MyDrafts, sign up for an account and create your first post in the editor. Once published, your content will be available through our API.

Authentication

Sign Up

Create an account to start creating content. Email confirmation may be required depending on your setup.

Sign In

Use your email and password to sign in and access the editor.

API Reference

GET/api/posts

Retrieve all published posts

Response

{
  "posts": [
    {
      "id": "uuid",
      "title": "Post Title",
      "excerpt": "Post excerpt...",
      "content_html": "<p>Content...</p>",
      "slug": "post-title",
      "published_at": "2024-01-01T00:00:00Z",
      "author": {
        "full_name": "John Doe"
      }
    }
  ]
}
GET/api/posts/[slug]

Retrieve a specific post by slug

Response

{
  "post": {
    "id": "uuid",
    "title": "Post Title",
    "excerpt": "Post excerpt...",
    "content_html": "<p>Content...</p>",
    "content_json": {},
    "slug": "post-title",
    "published_at": "2024-01-01T00:00:00Z",
    "feature_image": "url",
    "author": {
      "full_name": "John Doe",
      "profile_image": "url"
    },
    "tags": [
      {
        "name": "Technology",
        "slug": "technology"
      }
    ]
  }
}
GET/api/tags

Retrieve all tags

Response

{
  "tags": [
    {
      "id": "uuid",
      "name": "Technology",
      "slug": "technology",
      "description": "Tech related posts"
    }
  ]
}

Rate Limiting

API requests are rate-limited to ensure fair usage. Public read endpoints have generous limits. If you need higher limits, please contact support.

Security

  • All API requests must use HTTPS
  • Row-level security ensures users can only access their own drafts
  • Published content is publicly accessible via API
  • Authentication required for all write operations