Endpoint

  • Method: GET
  • Path: /posts
  • Summary: Retrieve a paginated list of posts filtered by account, status, social platform, tags, and title.

Parameters

Query

NameTypeRequiredDefaultAllowed Description
accountintegerYes--Account ID context for the request.
statusstringNo- draft, scheduled, published, archivedFilter by post status.
socialstringNo-x, linkedin, instagram Filter by social platform.
tag_idinteger or nullNo--Filter by tag ID.
titlestring or nullNo--Filter by title (partial match).
pageintegerNo1>=1Page number (1-based).
sizeintegerNo101-100Page size (max 100).

Cookie

NameTypeRequiredDescription
access_tokenstring or null NoAccess token supplied via cookie for session-style auth.

Header

NameTypeRequiredDescription
X-API-Key string or null NoAPI key for key-based authentication if enabled.
Authorizationstring or null NoBearer token Authorization header. Format: Authorization: Bearer <token>.

Responses

  • 200 OK — Successful response with a list of posts and pagination metadata.
  • 422 Validation Error — One or more parameters failed validation (e.g., size > 100, page < 1, invalid enum).

cURL

curl -s -X GET "https://srvr.postey.ai/v1/posts?account=123&page=1&size=10&status=published&social=x&tag_id=42&title=review"\ -H "X-API-Key: YOUR_API_KEY"\ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"\ --cookie "access_token=YOUR_ACCESS_TOKEN"

Api Code

Get All Post
💡

Note

Make sure to make expose the header keys in a env file for the security reasons.

Successful response schema (example)

  • items: array of Post objects containing id, title, status, platform, tags, createdAt, updatedAt, etc.
  • page: integer — current page number.
  • size: integer — page size requested.
  • totalPages: integer — computed total number of pages.
  • totalItems: integer — total matching posts.

Example:

{
  "items": [
    {
      "id": "pst_01",
      "title": "Postey.ai Review 2025",
      "status": "published",
      "social": "x",
      "tag_id": 42,
      "createdAt": "2025-08-20T10:02:00Z",
      "updatedAt": "2025-08-22T09:11:00Z"
    }
  ],
  "page": 1,
  "size": 10,
  "totalPages": 5,
  "totalItems": 49
}

Validation errors (422) example

{
  "detail": [
    { "loc": ["query", "size"], "msg": "ensure this value is less than or equal to 100", "type": "value_error.number.not_le" },
    { "loc": ["query", "page"], "msg": "ensure this value is greater than or equal to 1", "type": "value_error.number.not_ge" },
    { "loc": ["query", "status"], "msg": "value is not a valid enumeration member", "type": "type_error.enum" }
  ]
}

Note

In case you found validation error that is from our side you can feel free to reach out to us.

Notes:

  • Provide either Authorization header or cookie; behavior may vary by deployment; when both are sent, the server typically prioritizes Authorization.
  • Use stable sorting if supported to avoid duplicates while paginating through changing datasets.