API Documentation
Welcome to the yLnk External Client API documentation. This API allows you to programmatically create, manage, and analyze short links using API key authentication.
Getting Started
Authentication
All API requests require authentication using an API key. You can create and manage API keys from your Settings page.
Using API Keys
Include your API key using the X-API-Key header:
X-API-Key: YOUR_API_KEY
Note: External client APIs only accept API keys via the X-API-Key header. JWT tokens (Authorization Bearer) are not supported for these endpoints.
Workspace Scope
- External API keys are workspace-bound.
- Every request runs in the workspace (
orgId) attached to that API key. - Cross-workspace data is not accessible.
Breaking Change (Key Rotation Required)
- Legacy external API keys without workspace binding (
orgId = null) are rejected. - Recreate API keys from the target workspace and rotate keys in your client applications.
Base URL
https://api.ylnk.cc/v2/external/client
Rate Limits
Rate limits and API-key availability depend on the effective workspace plan and configured server policies. Request throttling and link-creation quotas are separate. Handle 429 with bounded backoff; do not assume a fixed limit or that all responses expose quota headers.
Creation and domains
- New generated codes have 7 characters; existing codes remain valid.
- Send
Idempotency-Keyfor safe creation retries; without it each request creates a new link. - Aliases are unique per domain, not globally. Use
domainIdfor creation and stable link IDs for reads/analytics. - Custom domain registration, verification and mapping
- Authentication and API coverage for every feature
Response Format
All API responses follow this structure:
{
"status": true,
"message": "Success message",
"data": { ... }
}
Error Handling
Errors are returned with appropriate HTTP status codes:
400 Bad Request: Invalid request parameters401 Unauthorized: Missing or invalid API key403 Forbidden: Insufficient permissions406 Not Acceptable: Subscription quota rejection409 Conflict: Alias conflict, ambiguous code or changed/deleted idempotent request404 Not Found: Resource not found429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server error
Error response format:
{
"status": false,
"message": "Error",
"data": null,
"error": [
{
"errorCode": 400,
"message": "Readable error message"
}
]
}
Endpoints
Short Links
Analytics
Code Examples
Choose your preferred language:
