GoLink

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
https://golink.buzz/api

For local development:

Local Base URL
http://localhost:3000/api

Authentication & Headers

Requests to protected API routes require an authenticated session or Bearer token, along with the targeted organization context:

Request Headers
Authorization: Bearer <YOUR_API_TOKEN> x-organization-id: <ORGANIZATION_ID> Content-Type: application/json

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
{ "success": true, "links": [ { "_id": "67b5f928e124801ac1a94e5b", "shortLink": "docs", "domain": "go.golink.buzz", "url": "https://docstra.sudhucodes.com/docs", "active": true, "clicksCount": 1420, "createdAt": "2026-03-15T10:00:00.000Z" } ] }

Error Handling

If an error occurs, GoLink returns an appropriate HTTP status code with a descriptive JSON payload:

Error Response Format
{ "success": false, "code": "BAD_REQUEST", "message": "Destination URL is required" }

Common HTTP Error Codes

Status CodeCodeDescription
400BAD_REQUESTValidation error, missing required fields, or invalid slug format.
401UNAUTHORIZEDMissing or expired authentication token.
403FORBIDDENInsufficient permissions or unconfigured custom domain.
404NOT_FOUNDThe requested link, domain, or organization was not found.
409CONFLICTThe short slug is already in use on the specified domain.
500INTERNAL_SERVER_ERRORAn unexpected server-side error occurred.

Available API Resources

Last updated on October 20, 2026