Skip to main content
GET
/
posts
List Posts
curl --request GET \
  --url https://api.example.com/posts

Endpoint

GET /posts

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
perPageinteger10Items per page (max 100)
sortstring-publishedAtSort field and direction
filter[status]stringpublishedFilter by status
filter[category]string-Filter by category slug
filter[tag]string-Filter by tag slug
filter[author]string-Filter by author slug
includestring-Related resources to include
fields[post]string-Sparse fieldset

Example Request

curl -X GET "https://api.skayle.ai/v1/posts?page=1&perPage=10&include=author,categories" \
  -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...",
        "content": "<p>Full HTML content...</p>",
        "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" }]
        }
      }
    }
  ],
  "meta": {
    "total": 42,
    "page": 1,
    "perPage": 10,
    "totalPages": 5
  },
  "links": {
    "self": "/posts?page=1",
    "first": "/posts?page=1",
    "last": "/posts?page=5",
    "next": "/posts?page=2"
  }
}