Skip to main content

Endpoint

GET /v1/{organizationId}/posts
Retrieves a paginated list of posts for the specified organization. Supports filtering by status and content type, as well as sorting by creation date.

Authentication

This endpoint requires Bearer token authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Path Parameters

organizationId
string
required
The unique identifier of the organization. The API key must have access to this organization.Example: org_123

Query Parameters

limit
integer
default:"10"
Number of items per page. Must be between 1 and 100.Example: 10
page
integer
default:"1"
Page number to retrieve. Must be at least 1.Example: 1
sort
string
default:"desc"
Sort order by creation date.Options: asc | desc
status
string[]
default:"[published]"
Filter posts by status. Can be a single value or multiple values by repeating the query parameter.Options: draft | publishedDefault: ["published"] (only published posts)Examples:
  • Single value: ?status=published
  • Multiple values: ?status=draft&status=published
contentType
string[]
Filter posts by content type. Can be a single value or multiple values by repeating the query parameter.Options: changelog | linkedin_postDefault: All content typesExamples:
  • Single value: ?contentType=changelog
  • Multiple values: ?contentType=changelog&contentType=linkedin_post

Response

posts
array
Array of post objects matching the query criteria.
pagination
object
Pagination metadata for navigating through the result set.

Examples

curl -X GET "https://api.notra.ai/v1/org_123/posts?limit=10&page=1&sort=desc" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

200 Success
{
  "posts": [
    {
      "id": "post_456",
      "title": "New Feature Release v2.0",
      "content": "We're excited to announce the release of version 2.0...",
      "markdown": "# New Feature Release v2.0\n\nWe're excited to announce...",
      "contentType": "changelog",
      "sourceMetadata": {
        "author": "[email protected]",
        "version": "2.0.0"
      },
      "status": "published",
      "createdAt": "2026-03-01T12:00:00.000Z",
      "updatedAt": "2026-03-01T14:30:00.000Z"
    },
    {
      "id": "post_789",
      "title": "Product Update: Q1 2026",
      "content": "Looking back at our Q1 achievements...",
      "markdown": "# Product Update: Q1 2026\n\nLooking back...",
      "contentType": "linkedin_post",
      "sourceMetadata": null,
      "status": "published",
      "createdAt": "2026-02-28T10:15:00.000Z",
      "updatedAt": "2026-02-28T10:15:00.000Z"
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "nextPage": 2,
    "previousPage": null,
    "totalPages": 5,
    "totalItems": 47
  }
}
400 Bad Request
{
  "error": "Invalid query parameters"
}
401 Unauthorized
{
  "error": "Missing or invalid API key"
}
403 Forbidden
{
  "error": "Forbidden: organization access denied"
}
503 Service Unavailable
{
  "error": "Authentication service unavailable"
}

Status Codes

CodeDescription
200Posts fetched successfully
400Invalid path params or query parameters
401Missing or invalid API key
403Forbidden - API key does not have access to the specified organization
503Authentication service unavailable

Notes

  • The default behavior is to return only published posts unless you explicitly specify the status query parameter
  • To retrieve all posts regardless of status, include both values: ?status=draft&status=published
  • Posts are ordered by creation date with the most recent first by default (sort=desc)
  • The maximum page size is 100 items
  • The API key must belong to the organization specified in the path, otherwise a 403 error will be returned

Build docs developers (and LLMs) love