Skip to main content

GET /dashboard

Retrieves a list of all viewer links created by the authenticated user, including link metadata and associated user information.

Authentication

Requires JWT authentication token in the Authorization header.

Response

Returns an array of ViewerLink objects:
id
integer
Unique identifier for the viewer link
repo_name
string
Name of the GitHub repository associated with this link
user_id
integer
ID of the user who created the link
token
string
The unique access token for this viewer link
expires_at
string
ISO 8601 timestamp when the link expires
max_views
integer
Maximum number of views allowed (0 for unlimited)
view_count
integer
Current number of times the link has been accessed
created_at
string
ISO 8601 timestamp when the link was created
updated_at
string
ISO 8601 timestamp when the link was last updated
deleted_at
string
ISO 8601 timestamp when the link was soft-deleted (null if active)
User
object
Associated user information (preloaded)

Example Request

curl -X GET http://localhost:8080/dashboard \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

[
  {
    "id": 1,
    "repo_name": "my-private-repo",
    "user_id": 42,
    "token": "abc123def456ghi789jkl",
    "expires_at": "2026-03-10T12:00:00Z",
    "max_views": 10,
    "view_count": 3,
    "created_at": "2026-03-03T12:00:00Z",
    "updated_at": "2026-03-03T12:00:00Z",
    "deleted_at": null,
    "User": {
      "id": 42,
      "github_username": "johndoe",
      "email": "[email protected]"
    }
  },
  {
    "id": 2,
    "repo_name": "another-repo",
    "user_id": 42,
    "token": "xyz789uvw456rst123mno",
    "expires_at": "2026-03-06T12:00:00Z",
    "max_views": 0,
    "view_count": 15,
    "created_at": "2026-03-02T12:00:00Z",
    "updated_at": "2026-03-02T12:00:00Z",
    "deleted_at": null,
    "User": {
      "id": 42,
      "github_username": "johndoe",
      "email": "[email protected]"
    }
  }
]

Status Codes

  • 200 OK - Successfully retrieved viewer links
  • 401 Unauthorized - Missing or invalid authentication token
  • 500 Internal Server Error - Failed to fetch links from database

Notes

  • Only returns links created by the authenticated user
  • Includes preloaded User relationship data
  • Returns an empty array if the user has no viewer links

Build docs developers (and LLMs) love