Public URLDocs

API overview

Authentication, conventions, and the endpoint map for the Public Url REST API.

The Public Url API is a REST API served by the API gateway. All product operations available in the dashboard — links, domains, campaigns, analytics, reports, webhooks — are available programmatically.

Interactive reference

Every endpoint, parameter, schema, and example is documented in the API reference — grouped by resource, with code samples in seven languages and a playground to try requests directly from your browser.

Base URL

https://api.publicurl.in/v1

Self-hosted deployments expose the gateway on their own origin; locally it listens on http://localhost:4000/v1.

Authentication

Every endpoint is authenticated with an API key — create keys in the dashboard under Settings → API keys (or via POST /v1/api-keys) and send them as a bearer credential:

curl https://api.publicurl.in/v1/links \
  -H "Authorization: Bearer pu_your_api_key"

Keys can carry scopes and are scoped to the user (and, through the active workspace, to an organization). Browser sessions authenticated with a cookie are used automatically by the dashboard, but programmatic access always uses an API key.

The gateway validates the key, resolves the workspace and role, and forwards identity headers (x-user-id, x-workspace-id, x-role) to internal services. Keys are stored hashed, support IP allow-lists, and record last-used timestamps.

Response envelope

Responses use a consistent envelope with a data payload and request metadata:

{
  "data": [],
  "meta": { "requestId": "req_01J..." }
}

Errors are normalized by the gateway and include the request ID, which is also returned in the x-request-id response header — include it when reporting issues.

Rate limits

Coarse rate limits apply at the gateway, with stricter tiers on auth and event-ingestion routes. Rate-limit responses return 429 with retry guidance. If you need higher throughput for bulk operations, contact support.

Endpoint map

ResourceEndpointsNotes
LinksGET/POST /links, PATCH /links/{id}Create, list, and update short links.
Link previewGET /links/preview?url=...Unfurl a destination before linking.
DomainsGET/POST /domainsBranded domains and DNS verification.
AnalyticsGET /analytics/*Metrics, timeseries, and breakdowns.
CampaignsGET/POST /campaignsCampaign management.
UTM templatesGET/POST /utm-templatesReusable UTM presets.
ReportsGET/POST /reportsReport definitions and exports.
WebhooksGET/POST /webhooksSubscriptions and delivery logs.
MediaPOST /media, GET /media/{id}/contentAsset uploads and content.
Bio pagesGET/POST /bio-pagesBio page management.
Plans and billingGET /plans, /billing/*Subscription management.
API keysGET/POST /api-keysKey lifecycle (session auth only).
Audit logGET /audit-logWorkspace activity trail.
Security logGET /security-logAccount security events.
Deferred deep linksPOST /deferred/resolveResolve deferred deep-link matches.
GeoIPGET /geoipGeo lookup for the caller.
Public dashboardsGET /public/dashboards/{token}Unauthenticated shared dashboards.

The interactive OpenAPI reference for auth routes is served by the auth service at /v1/auth/reference.

Webhooks

To receive events instead of polling, subscribe an HTTPS endpoint to events like link.created, click.received, and conversion.received. Every delivery is signed and retried with exponential backoff. See Webhooks for the full reference.

On this page