Endpoint
- Method: GET
- Path: /posts
- Summary: Retrieve a paginated list of posts filtered by account, status, social platform, tags, and title.
Parameters
Query
| Name | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
| account | integer | Yes | - | - | Account ID context for the request. |
| status | string | No | - | draft, scheduled, published, archived | Filter by post status. |
| social | string | No | - | x, linkedin, instagram | Filter by social platform. |
| tag_id | integer or null | No | - | - | Filter by tag ID. |
| title | string or null | No | - | - | Filter by title (partial match). |
| page | integer | No | 1 | >=1 | Page number (1-based). |
| size | integer | No | 10 | 1-100 | Page size (max 100). |
Cookie
| Name | Type | Required | Description |
|---|---|---|---|
| access_token | string or null | No | Access token supplied via cookie for session-style auth. |
Header
| Name | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string or null | No | API key for key-based authentication if enabled. |
| Authorization | string or null | No | Bearer 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.