Storyden
Collections

Collection Add Post

Add a post to a collection. The collection must be owned by the account making the request. The post can be any published post of any kind.

PUT
/collections/{collection_mark}/posts/{post_id}

Add a post to a collection. The collection must be owned by the account making the request. The post can be any published post of any kind.

Authorization

cookiestoryden-session<token>

Path Parameters

collection_mark*string

Either:

  • The unique collection ID.
  • A string of the form -
Formatxid-prefixed-kebab-case-string
post_id*string

Unique post ID.

Formatxid

Response Body

Collection content added.

application/json
  1. response

The full properties of a collection, for rendering a single collection somewhere where you can afford to show all the items in the collection.

id*Identifier

A unique identifier for this resource.

Formatxid
createdAt*string

The time the resource was created.

Formatdate-time
updatedAt*string

The time the resource was updated.

Formatdate-time
deletedAt?string

The time the resource was soft-deleted.

Formatdate-time
misc?

Arbitrary extra data stored with the resource.

name*CollectionName
slug*CollectionSlug

A polymorphic identifier which is either a raw ID, a slug or both values combined and separated by a hyphen. This allows endpoints to respond to varying forms of a resource's ID which may be present in different app contexts. For example, a slug may be used in a URL but raw IDs are often exposed as part of API responses or in certain endpoint parameters. This type allows flexibility in user experience as well as the API surface while ensuring performance during database queries and other operations.

For example, given a thread with the ID cc5lnd2s1s4652adtu50 and the slug top-10-movies-thread, Storyden will understand both the forms: cc5lnd2s1s4652adtu50-top-10-movies-thread or cc5lnd2s1s4652adtu50 or top-10-movies-thread as the identifier for that thread.

Marks are only ever used on the read path as they are a derivative data type and are not stored in the database as-is, while IDs and slugs are. The write path typically exposes slugs as writable and IDs as immutable.

Formatxid-prefixed-kebab-case-string
description?CollectionDescription
owner*

A minimal reference to an account.

items*array<>
Example Request
curl -X PUT 'https://example.com/api/collections/string/posts/string'
Example Response
{  "id": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "deletedAt": "2019-08-24T14:15:22Z",  "misc": {},  "name": "string",  "slug": "string",  "description": "string",  "owner": {    "id": "string",    "joined": "2019-08-24T14:15:22Z",    "suspended": "2019-08-24T14:15:22Z",    "handle": "string",    "name": "string",    "signature": "string",    "roles": [      {        "badge": true,        "default": true,        "id": "string",        "name": "string",        "colour": "string",        "meta": {}      }    ]  },  "items": [    {      "id": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "deletedAt": "2019-08-24T14:15:22Z",      "misc": {},      "owner": {        "id": "string",        "joined": "2019-08-24T14:15:22Z",        "suspended": "2019-08-24T14:15:22Z",        "handle": "string",        "name": "string",        "signature": "string",        "roles": [          {            "badge": true,            "default": true,            "id": "string",            "name": "string",            "colour": "string",            "meta": {}          }        ]      },      "added_at": "2019-08-24T14:15:22Z",      "membership_type": "normal",      "relevance_score": 0,      "item": {        "kind": "post",        "ref": {          "id": "string",          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z",          "deletedAt": "2019-08-24T14:15:22Z",          "misc": {},          "title": "string",          "description": "string",          "slug": "string",          "author": {            "id": "string",            "joined": "2019-08-24T14:15:22Z",            "suspended": "2019-08-24T14:15:22Z",            "handle": "string",            "name": "string",            "signature": "string",            "roles": [              {                "badge": true,                "default": true,                "id": "string",                "name": "string",                "colour": "string",                "meta": {}              }            ]          },          "visibility": "draft",          "assets": [            {              "id": "string",              "filename": "string",              "path": "string",              "mime_type": "string",              "width": 0,              "height": 0,              "parent": {}            }          ],          "reacts": [            {              "id": "string",              "emoji": "string",              "author": {                "id": "string",                "joined": "2019-08-24T14:15:22Z",                "suspended": "2019-08-24T14:15:22Z",                "handle": "string",                "name": "string",                "signature": "string",                "roles": [                  {                    "badge": true,                    "default": true,                    "id": "string",                    "name": "string",                    "colour": "string",                    "meta": {}                  }                ]              }            }          ],          "collections": {            "in_collections": 0,            "has_collected": true          },          "likes": {            "likes": 0,            "liked": true          },          "meta": {},          "body": "string",          "body_links": [            {              "id": "string",              "createdAt": "2019-08-24T14:15:22Z",              "updatedAt": "2019-08-24T14:15:22Z",              "deletedAt": "2019-08-24T14:15:22Z",              "misc": {},              "url": "string",              "slug": "string",              "domain": "string",              "title": "string",              "description": "string",              "favicon_image": {                "id": "string",                "filename": "string",                "path": "string",                "mime_type": "string",                "width": 0,                "height": 0,                "parent": {}              },              "primary_image": {                "id": "string",                "filename": "string",                "path": "string",                "mime_type": "string",                "width": 0,                "height": 0,                "parent": {}              },              "liveness_status": "unknown",              "liveness_checked_at": "2019-08-24T14:15:22Z",              "scrape_status": "pending",              "scrape_attempted_at": "2019-08-24T14:15:22Z",              "scraped_at": "2019-08-24T14:15:22Z"            }          ]        }      }    }  ]}