Skip to Content

Authentication

All API requests are authenticated using an API key passed via the X-API-KEY HTTP header.

curl -X GET "https://api.linkshark.xyz/link/external/v1/shortenedUrl?page=0&size=20" \ -H "X-API-KEY: your_api_key_here"

Important: Every request must include the X-API-KEY header. Requests without it will receive a 401 Unauthorized response.


How It Works

  1. Generate an API key from the LinkShark Dashboard.
  2. Include the key in the X-API-KEY header of every request.
  3. The server validates your key and associates the request with your organization.
  4. If the key is missing, invalid, or expired, the API returns a 401 Unauthorized error.

Header Format

HeaderTypeRequiredDescription
X-API-KEYstringYesYour API key obtained from the dashboard

Example

curl -X POST "https://api.linkshark.xyz/link/external/v1/shortenedUrl/save" \ -H "X-API-KEY: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com"}'

Error Responses

Missing API Key:

HTTP/1.1 401 Unauthorized Please send API key in the request

Invalid API Key:

HTTP/1.1 401 Unauthorized API Key is Invalid. Please check your API Key or generate a new one

Authentication error responses are returned as plain text, not JSON.

Last updated on