Reference
API Reference
Complete REST API specification for public, authentication, user, and admin endpoints.
API Reference
Complete documentation of all HTTP REST API routes supported by GO Shortener.
Public Endpoints
Shorten URL
POST /api/links/shorten
Create a new shortened link. Available to anonymous visitors and authenticated users.
- Request Body:
{ "url": "https://example.com/long-page-url", "expiration_days": 7, "turnstile_token": "optional_token_string" } - Response
201 Created:{ "short_code": "K8xP2q", "short_url": "https://go.arcn.online/K8xP2q", "destination_url": "https://example.com/long-page-url", "expires_at": "2026-09-10T14:30:00Z", "created_at": "2026-09-03T14:30:00Z" }
Redirect to Destination
GET /{code}
Resolves short code and redirects visitor:
302 Found: Redirects todestination_urlviaLocationheader.410 Gone: Displayed if link has expired.403 Forbidden: Displayed if link has been disabled by moderation.404 Not Found: Short code does not exist.
Link Metadata
GET /api/links/{code}/info
Fetches public information for a shortened link.
Submit Abuse Report
POST /api/reports
Flags a malicious link for administrator review.
- Request Body:
{ "short_code": "K8xP2q", "reason": "phishing", "details": "Suspicious login prompt detected.", "turnstile_token": "optional_token" } - Response
201 Created:{"status": "report_submitted"}
Health Check
GET /api/health
Returns application readiness:
- Response
200 OK:{"status": "ok"}
Authentication Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /api/auth/register | Register new user account with email and password |
POST | /api/auth/login | Authenticate with email/password; issues go_session cookie |
POST | /api/auth/google | Authenticate with Firebase Google ID token |
POST | /api/auth/logout | Revokes and clears the go_session cookie |
GET | /api/auth/me | Fetches current user profile and role |
GET | /api/auth/firebase-config | Public client configuration for Firebase Web App |
User Endpoints (Authenticated)
| Method | Endpoint | Description |
|---|---|---|
GET | /api/user/dashboard | Returns summary statistics, quota usage, and recent links |
GET | /api/user/links | Returns paginated list of links created by the user |
GET | /api/user/links/{code}/analytics | Returns detailed aggregated click telemetry |
POST | /api/user/links/{code}/renew | Renews an expired link preserving short code |
POST | /api/user/links/{code}/request-permanent | Submits a permanent link auto-renew request |
DELETE | /api/user/links/{code} | Soft-deletes a user-owned link |
Admin Endpoints (RBAC Protected)
System & Users
| Method | Endpoint | Min Role | Description |
|---|---|---|---|
GET | /api/admin/overview | Moderator | System telemetry counters |
GET | /api/admin/users | Moderator | Searchable user listing |
POST | /api/admin/users/{id}/timeout | Moderator | Applies timed suspension (30s to 7d) |
POST | /api/admin/users/{id}/ban | Moderator | Issues permanent ban with optional link deactivation |
POST | /api/admin/users/{id}/unban | Moderator | Restores banned or suspended account |
POST | /api/admin/users/{id}/role | Super Admin | Updates user role (super_admin, moderator, user) |
Links & Moderation
| Method | Endpoint | Min Role | Description |
|---|---|---|---|
GET | /api/admin/links | Moderator | Search and inspect all system links |
POST | /api/admin/links/{code}/disable | Moderator | Disables abusive link (returns 403 to visitors) |
POST | /api/admin/links/{code}/enable | Moderator | Re-enables a disabled link |
DELETE | /api/admin/links/{code} | Moderator | Permanently deletes link and analytics |
GET | /api/admin/reports | Moderator | Lists pending abuse reports |
POST | /api/admin/reports/{id}/resolve | Moderator | Resolves or dismisses an abuse report |
GET | /api/admin/permanent-requests | Moderator | Lists pending permanent link requests |
POST | /api/admin/permanent-requests/{id}/resolve | Moderator | Approves or rejects permanent status |
GET | /api/admin/login-records | Super Admin | Inspects security audit records |