Skip to main content

Overview

The library is where users store and manage their content before publishing. Items can be external links (resolved via URL), uploaded media, or data tables. The library supports bulk saving, publishing to topics, and visibility management.

Public Endpoints

Resolve URL

GET /api/library/resolve-url-public?url={url}
Resolves an external URL to extract embed metadata. No authentication required — used by the collection editor for link previews. Query Parameters:
ParameterTypeDescription
urlstringURL to resolve (required)
Response:
{
  "platform": "twitter",
  "external_id": "1234567890",
  "title": "Tweet by @player",
  "author": "player",
  "provider_name": "Twitter",
  "thumbnail_url": "https://...",
  "embed_html": "<blockquote>...</blockquote>"
}
Supported Platforms:
PlatformURL Patterns
Twitter/Xtwitter.com, x.com
YouTubeyoutube.com, youtu.be
Instagraminstagram.com
TikToktiktok.com
ESPNespn.com
Substack*.substack.com
GenericAny other URL (extracts Open Graph data)

Authenticated Endpoints

List Library Items

GET /api/library/items
Requires authentication.
Returns the current user’s library items with pagination. Query Parameters:
ParameterTypeDescription
item_typestringFilter by type (external_media, uploaded_media, data_table)
offsetintegerPagination offset
limitintegerResults per page
visibilitystringFilter by visibility

Save Items

POST /api/library/save
Requires authentication.
Bulk save items to the library. Body:
{
  "external_links": [
    { "url": "https://x.com/player/status/123" }
  ],
  "uploaded_media": [
    { "url": "https://storage.example.com/uploads/img.webp", "title": "Match photo" }
  ],
  "data_tables": [
    { "title": "Season Stats", "columns": [...], "rows": [...] }
  ]
}

Publish Item

POST /api/library/{post_id}/publish
Requires authentication.
Publishes a library item, making it publicly visible. Optionally tag it to topics. Body:
FieldTypeDescription
tagsarrayTopic names to tag the post to

Update Item

PUT /api/library/{post_id}
Requires authentication.
Update a library item’s metadata (title, description, date, etc.).

Delete Item

DELETE /api/library/{post_id}
Requires authentication.
Remove an item from the library.