Skip to content

Public REST API for programmatic link management #4

Description

@Manak-hash

Problem

There's no programmatic way to manage links, profile, or settings. Every link-in-bio competitor (Linktree, LinkStack) has an API. Without one, LinkBreeze can't integrate with CI pipelines, scripts, or third-party tools.

Proposed design

Authentication: API key stored in settings table (generated in admin panel). Sent via Authorization: Bearer <key> header.

Endpoints:

GET    /api/v1/links          List all links
POST   /api/v1/links          Create a link
PUT    /api/v1/links/:id      Update a link
DELETE /api/v1/links/:id      Delete a link
PUT    /api/v1/links/reorder  Reorder links (array of IDs)

GET    /api/v1/profile        Get profile
PUT    /api/v1/profile        Update profile

GET    /api/v1/analytics      Get analytics (views, clicks, top links)

Prep work already done

  • The queries layer (src/server/queries/) already abstracts all DB access
  • The metadata JSON column on links was added for future extensibility
  • ADR-0004 documents the data abstraction

Scope

This is a larger feature. Could be split into phases:

  1. API key auth + link CRUD (MVP)
  2. Profile + analytics endpoints
  3. Rate limiting + documentation

Acceptance criteria

  • API key generated in admin settings panel
  • Link CRUD endpoints working with Bearer auth
  • Rate limited (same infrastructure as existing endpoints)
  • OpenAPI/Swagger documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI or programmatic accessenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions