Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Activity API

Endpoints for curated external contributions: pull requests and issues you landed on other repositories, ranked by impact and recency.

Admin

Admin endpoints require Bearer token authentication with PLINTH_API_KEY.

Authorization: Bearer <your-api-key>

Publish activity

POST /api/admin/activity
Content-Type: application/json

Upserts by the natural key (forge, repo_owner, repo_name, kind, number).

Request body (PublishActivityRequest):

FieldTypeRequiredDescription
forgestringyes"github" or "codeberg"
repo_ownerstringyesRepository owner
repo_namestringyesRepository name
kindstringyes"pr" or "issue"
numberintegeryesPR or issue number, greater than 0
urlstringyesCanonical forge URL
titlestringyesContribution title
bodystringnoContribution body or description
statestringyes"open", "closed", or "merged"
created_atstringyesISO-8601 creation timestamp
closed_atstringnoISO-8601 close timestamp
merged_atstringnoISO-8601 merge timestamp
impactintegernoCurated impact score, 1..=10, default 1
additionsintegernoLines added
deletionsintegernoLines deleted
comments_countintegernoNumber of comments reported by the forge
labelsstring[]noLabel names
repo_starsintegernoRepository star count
embeddingfloat[]no384-dimensional fastembed vector supplied by the CLI
featuredboolnoShow in the home strip, default false
publishedboolnoInclude in public surfaces, default true
content_hashstringnoOptional content fingerprint

Response (200):

{
  "success": true,
  "url": "https://github.com/owner/repo/pull/1234",
  "id": 42,
  "message": "Activity published successfully"
}

Update activity

PATCH /api/admin/activity/{id}
Content-Type: application/json

Updates curated fields for a numeric activity id.

FieldTypeRequiredDescription
impactintegernoNew impact score, 1..=10
featuredboolnoNew featured flag
publishedboolnoNew public visibility flag

Delete activity

DELETE /api/admin/activity/{id}

Deletes an activity entry by numeric id.

Public

List activity

GET /api/activity?limit=<n>&featured=<bool>

Returns entries ranked by score descending, then reference date descending. Reading a stale entry serves cached data immediately and triggers a single-flighted background refresh.

ParameterTypeDefaultDescription
limitintegerserver defaultMaximum entries
featuredboolomittedWhen true, return featured entries only

Response (200):

[
  {
    "id": 42,
    "forge": "github",
    "repo_owner": "owner",
    "repo_name": "repo",
    "kind": "pr",
    "number": 1234,
    "url": "https://github.com/owner/repo/pull/1234",
    "title": "Improve build output",
    "state": "merged",
    "impact": 7,
    "labels": ["rust"],
    "featured": true,
    "score": 6.92
  }
]

Get activity

GET /api/activity/{id}

Returns one activity entry by numeric id.

Feed

GET /feeds/activity.xml

RSS 2.0 feed for curated external activity. The response is application/rss+xml with Cache-Control: public, max-age=3600; entries link to the forge URL and are ordered by ranking.

Activity entries are unioned into semantic search at GET /api/search. See the Search API.