staqlydocs
REST APIAPI referencePosts

Archive a draft, published or failed post

Archive a draft, published or failed post (posts:write)

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.

POST
/v1/posts/{id}/archive

The post stays as it is, but the post list and the calendar leave it out unless they ask for include_archived. A scheduled or publishing post can't be archived (409). Archiving an archived post changes nothing.

Authorization

headerAuthorizationBearer <token>

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

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
collection_id*string
collection_name*string
title*string

The post's title; empty on posts from before titles were required

content*string
media*array<string>

Media ids, in order

media_items*array<>

The same media, resolved

status*PostStatus

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"
publish_at*|

When it goes out (scheduled), or the time it kept as a note (draft after cancel)

Formatdate-time
published_at*|
Formatdate-time
unpublished_at*|

When it was taken down from its channels

Formatdate-time
unpublished_by*string

Who took it down: a person or the API key

archived_at*|

When it was archived: lists and the calendar leave it out unless include_archived is true

Formatdate-time
tags*array<string>
metadata*

Free JSON for your own use

source*string

Who created it: a client name, an agent, a schedule

external_ref*string

Your own reference

repeat_every*RepeatEvery

Repeat the post: once it is published, staqly schedules a copy this long after its publish time (every 1 to 6 days, every 1 or 2 weeks, every month); the copy repeats too. Empty: no repeat. To stop, clear repeat_every on the next scheduled copy, or delete it.

Value in"""1d""2d""3d""4d""5d""6d""1w""2w""1mo"
thread*array<>

Replies published under the post after it, in order

version*integer

Grows with every edit; see PostPatch.expected_version

targets*array<>
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
created_by*string

Who created the post: a person, or the API key (agent, automation) that did; empty when unknown

open_comments*integer

Reviewers' comment threads not resolved yet

Example Request
curl -X POST 'https://staqly.example.com/v1/posts/string/archive'
Example Response
{  "id": "string",  "collection_id": "string",  "collection_name": "string",  "title": "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",  "unpublished_at": "2019-08-24T14:15:22Z",  "unpublished_by": "string",  "archived_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",      "removal": "",      "removal_error": "string",      "removed_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}