AstraCMS
Authors

Get a single author

Get a single author by slug or ID, optionally including related posts

GET
/v1/{workspaceId}/authors/{identifier}

Path Parameters

workspaceId*string

Workspace identifier

identifier*string

Author slug or ID

Query Parameters

limit?string

Number of posts per page when including posts

Default"10"
page?string

Page number for pagination when including posts

Default"1"
include?string

Related resources to include (e.g., posts)

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://api.astracms.dev/v1/my-workspace/authors/john-doe"
{
  "id": "clx1a2b3c4d5e6f7g8h9i",
  "name": "John Doe",
  "image": "https://example.com/avatar.jpg",
  "slug": "john-doe",
  "bio": "Tech writer and developer",
  "role": "Senior Developer",
  "socials": [
    {
      "url": "https://twitter.com/johndoe",
      "platform": "twitter"
    }
  ],
  "posts": {
    "data": [
      {
        "id": "clx4b6d8f0h2j4l6n8p0r",
        "title": "Getting Started with JavaScript",
        "slug": "getting-started-with-javascript",
        "description": "Learn the basics of JavaScript",
        "coverImage": "https://example.com/cover.jpg",
        "publishedAt": "2024-01-01T12:00:00Z"
      }
    ],
    "pagination": {
      "limit": 10,
      "currentPage": 1,
      "nextPage": 2,
      "previousPage": null,
      "totalPages": 5,
      "totalItems": 48
    }
  }
}
{
  "error": "string",
  "details": null,
  "message": "string"
}
{
  "error": "string",
  "details": null,
  "message": "string"
}
{
  "error": "string",
  "details": null,
  "message": "string"
}

Last updated on