staqlydocs
REST APIAPI referencePosts

List posts of one collection

List posts of one collection (posts:read)

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

GET
/v1/collections/{id}/posts

The same filters as GET /v1/posts. The {id} may also be the collection's exact name.

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Path Parameters

id*string

Query Parameters

status?string

draft (being written), scheduled (goes out at publish_at), publishing (a job is at work), published (every target is), failed (a target is; retry it or edit and publish again)

Value in"draft""scheduled""publishing""published""failed"
channel_id?string

Posts with a target on this channel

publish_after?string

publish_at >= (RFC3339 or YYYY-MM-DD); posts without a time never match

publish_before?string

publish_at < (RFC3339 or YYYY-MM-DD)

q?string

Words of the content (case-insensitive substring match)

tag?string

Posts carrying this tag

sort?string

Default publish_asc (soonest first, posts without a time last). created_* and updated_desc order by those times.

Value in"publish_asc""publish_desc""created_desc""created_asc""updated_desc"
limit?integer

Page size (default 50, at most 200)

Range1 <= value <= 200
Default50
cursor?string

Opaque keyset cursor (the previous page's next_cursor)

Response Body

OK

application/json
  1. response
data*array<>
next_cursor?string
curl -X GET 'https://staqly.example.com/v1/collections/string/posts'
{  "data": [    {      "id": "string",      "collection_id": "string",      "collection_name": "string",      "content": "string",      "media": [        "string"      ],      "media_items": [        {          "id": "string",          "mime_type": "string",          "size_bytes": 0,          "original_name": "string",          "url": "string",          "sha256": "string",          "created_at": "2019-08-24T14:15:22Z",          "alt_text": "string",          "width": 0,          "height": 0,          "duration_ms": 0,          "folder_id": "string",          "tags": [            "string"          ],          "deleted_at": "2019-08-24T14:15:22Z",          "purge_at": "2019-08-24T14:15:22Z",          "duplicate_of": "string"        }      ],      "status": "draft",      "publish_at": "2019-08-24T14:15:22Z",      "published_at": "2019-08-24T14:15:22Z",      "tags": [        "string"      ],      "metadata": {},      "source": "string",      "external_ref": "string",      "repeat_every": "",      "thread": [        {          "content": "string",          "media": [            "string"          ],          "delay_seconds": 0,          "media_items": [            {              "id": "string",              "mime_type": "string",              "size_bytes": 0,              "original_name": "string",              "url": "string",              "sha256": "string",              "created_at": "2019-08-24T14:15:22Z",              "alt_text": "string",              "width": 0,              "height": 0,              "duration_ms": 0,              "folder_id": "string",              "tags": [                "string"              ],              "deleted_at": "2019-08-24T14:15:22Z",              "purge_at": "2019-08-24T14:15:22Z",              "duplicate_of": "string"            }          ]        }      ],      "version": 0,      "targets": [        {          "channel_id": "string",          "channel_name": "string",          "provider": "string",          "avatar_url": "string",          "content": "string",          "settings": {            "property1": "string",            "property2": "string"          },          "status": "pending",          "external_id": "string",          "external_url": "string",          "error": "string",          "attempts": 0,          "published_at": "2019-08-24T14:15:22Z",          "replies": [            {              "index": 0,              "status": "pending",              "external_id": "string",              "external_url": "string",              "error": "string",              "published_at": "2019-08-24T14:15:22Z"            }          ]        }      ],      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "open_comments": 0    }  ],  "next_cursor": "string"}