Skip to main content
GET
/
posts
/
{id}
Get Post
curl --request GET \
  --url https://api.example.com/posts/{id}

Endpoints

GET /posts/{id}
GET /posts/slug/{slug}

Path Parameters

ParameterTypeDescription
idstringPost ID
slugstringPost slug (URL-friendly identifier)

Query Parameters

ParameterTypeDescription
includestringRelated resources (author, categories, tags)
fields[post]stringSparse fieldset
formatstringContent format: html (default) or raw

Example Request

curl -X GET "https://api.skayle.ai/v1/posts/slug/getting-started?include=author,categories,tags" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "data": {
    "id": "post_abc123",
    "type": "post",
    "attributes": {
      "title": "Getting Started with Skayle",
      "slug": "getting-started-with-skayle",
      "excerpt": "Learn how to set up Skayle for your content workflow.",
      "content": "<h2>Introduction</h2><p>Welcome to Skayle...</p>",
      "featuredImage": {
        "url": "https://cdn.skayle.io/images/featured.jpg",
        "alt": "Featured image",
        "width": 1200,
        "height": 630
      },
      "status": "published",
      "publishedAt": "2024-01-15T10:00:00Z",
      "createdAt": "2024-01-14T08:30:00Z",
      "updatedAt": "2024-01-15T09:45:00Z"
    },
    "relationships": {
      "author": {
        "data": { "id": "author_1", "type": "author" }
      },
      "categories": {
        "data": [{ "id": "cat_1", "type": "category" }]
      },
      "tags": {
        "data": [
          { "id": "tag_1", "type": "tag" },
          { "id": "tag_2", "type": "tag" }
        ]
      }
    }
  },
  "included": [
    {
      "id": "author_1",
      "type": "author",
      "attributes": {
        "name": "John Doe",
        "slug": "john-doe",
        "bio": "Technical writer at Skayle",
        "avatar": "https://cdn.skayle.io/avatars/john.jpg"
      }
    },
    {
      "id": "cat_1",
      "type": "category",
      "attributes": {
        "name": "Tutorials",
        "slug": "tutorials"
      }
    }
  ]
}

Error Responses

404 Not Found

{
  "errors": [
    {
      "status": "404",
      "title": "Not Found",
      "detail": "Post not found"
    }
  ]
}