Skip to content

Content Endpoints

Public endpoints for retrieving portfolio content. No authentication required.

MethodEndpointDescription
GET/api/v1/contentList content items
GET/api/v1/content/:type/:slugGet single content item
GET/api/v1/content/bundleGet all content in one request

GET /content

List content items with optional filtering.

Query Parameters

ParameterTypeDefaultDescription
typestring-Filter by content type. Any string matching /^[a-z0-9-]+$/ (e.g., project, experience, blog-post, certification)

INFO

This endpoint always returns published content only. To list drafts or archived content, use the admin endpoint GET /api/v1/admin/content.

Response

json
{
  "data": [
    {
      "id": "content_abc123",
      "type": "project",
      "slug": "my-project",
      "data": {
        "title": "My Project",
        "description": "A great project"
      },
      "status": "published",
      "version": 1,
      "sortOrder": 0,
      "createdAt": "2025-01-25T10:00:00Z",
      "updatedAt": "2025-01-25T10:00:00Z"
    }
  ]
}

GET /content/:type/:slug

Get a single content item by type and slug.

Path Parameters

ParameterTypeDescription
typestringContent type (any string matching /^[a-z0-9-]+$/)
slugstringURL-friendly identifier

Response

json
{
  "data": {
    "id": "content_abc123",
    "type": "project",
    "slug": "my-project",
    "data": {
      "title": "My Project",
      "description": "A great project",
      "content": "## Overview\n\nThis project...",
      "tags": ["typescript", "express"],
      "featured": true
    },
    "status": "published",
    "version": 3,
    "sortOrder": 1,
    "createdAt": "2025-01-25T10:00:00Z",
    "updatedAt": "2025-01-26T15:30:00Z"
  }
}

GET /content/bundle

Get all published content organized by type. See Content Model - Content Bundle for the full type definition.

Response

json
{
  "data": {
    "project": [...],
    "experience": [...],
    "education": [...],
    "skill": [...],
    "about": [...],
    "contact": [...],
    "blog-post": [...],
    "certification": [...]
  }
}

TIP

The bundle is a dynamic Record<string, ContentWithData[]>. Keys correspond to the raw content type strings in the database, and all values are arrays. The set of keys depends on which types exist in your database -- custom types appear automatically.

See Also

Released under the MIT License.