API Overview
Learn how to programmatically interact with GoLink using standard REST APIs.
Developer API Overview
GoLink features a complete REST API that empowers developers to automate short link creation, manage custom domains, fetch click telemetry, and build internal workflow tools.
Base URL
All API routes are served under the /api prefix on your GoLink deployment:
Production Base URL
For local development:
Local Base URL
Authentication & Headers
Requests to protected API routes require an authenticated session or Bearer token, along with the targeted organization context:
Request Headers
When interacting with the API from frontend dashboard components, the user's Better Auth session cookie is automatically forwarded by the browser.
Standard Response Format
Successful responses return a JSON object with success: true and the corresponding resource payload:
200 OK Response
Error Handling
If an error occurs, GoLink returns an appropriate HTTP status code with a descriptive JSON payload:
Error Response Format
Common HTTP Error Codes
| Status Code | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Validation error, missing required fields, or invalid slug format. |
| 401 | UNAUTHORIZED | Missing or expired authentication token. |
| 403 | FORBIDDEN | Insufficient permissions or unconfigured custom domain. |
| 404 | NOT_FOUND | The requested link, domain, or organization was not found. |
| 409 | CONFLICT | The short slug is already in use on the specified domain. |
| 500 | INTERNAL_SERVER_ERROR | An unexpected server-side error occurred. |
Available API Resources
- Links API — Create, list, inspect, edit, and delete short links.
- Domains API — Register, verify, and set primary branded domains.
- Analytics API — Query click counts, visitor geographies, and timeseries charts.
Last updated on October 20, 2026