# ShortLi > ShortLi is a link shortener and link-in-bio platform. Use the API to create and > manage short links, custom aliases, QR codes, password-protected/expiring links, > geo-targeted redirects, and (on Pro accounts) click analytics. ## Authentication All link endpoints require a Bearer API key: Authorization: Bearer API keys are minted by a signed-in **Pro** user in the web console at https://sli.ink/api ("API Token Management"). An agent cannot create its own key. - If you already have a key, send it on every request. - If you do not have a key, STOP and ask the user you are acting on behalf of to sign in, open https://sli.ink/api, and generate one — then give it to you. A request without a valid key returns HTTP 401 with a JSON body containing `code` ("API_KEY_REQUIRED" or "API_KEY_INVALID"), `hint`, and `actionRequired`, so you can act on it programmatically. ## Quickstart Create a short link: curl -X POST https://sli.ink/api/link \ -H "Authorization: Bearer $SHORTLI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "targetUrl": "https://example.com/a/very/long/url" }' # => { "success": true, "url": "sli.ink/xYGe" } List the links you created: curl https://sli.ink/api/link -H "Authorization: Bearer $SHORTLI_API_KEY" # => { "success": true, "linkDataList": [ ... ], "isProAccount": true } Update a link (one field per request): curl -X PATCH https://sli.ink/api/link \ -H "Authorization: Bearer $SHORTLI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "shortUrl": "sli.ink/xYGe", "update": { "customName": "Launch" } }' Delete a link: curl -X DELETE https://sli.ink/api/link \ -H "Authorization: Bearer $SHORTLI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "shortUrl": "sli.ink/xYGe" }' ## Endpoints - POST /api/link Create a short link. Required: `targetUrl`. Optional: `customName`, `slug`, `password`, `expiryDate`+`expiryTime`, `expiryMaxRedirect`, `geoRules`, and Pro options such as `customDomain`, `scheduledRedirect*`, `clickRedirect*`, `webhook*`, `formConfig`. - GET /api/link List the authenticated user's links (with analytics on Pro). - PATCH /api/link Update a link. Required: `shortUrl` and `update`. - DELETE /api/link Delete a link. Required: `shortUrl`. Full schema: https://sli.ink/api/openapi Machine-readable manifest: https://sli.ink/api/agent Human console (create an API key here): https://sli.ink/api ## Error codes Responses that fail include `success: false`, a human `error` string, and a machine `code`: - API_KEY_REQUIRED (401) — no key was sent. Ask the user for a key, then retry. - API_KEY_INVALID (401) — the key is invalid, expired, or revoked. Ask the user to create a new one. - PRO_REQUIRED (402) — the acting account is not on a Pro plan. - INVALID_REQUEST (400) — the JSON body is invalid; see `issues`. - RATE_LIMITED (429) — too many requests; retry later. - INTERNAL_ERROR (400/500) — the request could not be completed. ## Pro features and payments Custom domains, conditional/geo redirects, webhooks, data-collection forms, and analytics require a Pro account. Upgrade: https://sli.ink/pro Agents will soon be able to pay per request for Pro features via **x402** instead of holding a subscription. Until that ships, Pro-only requests return HTTP 402 with `code: "PRO_REQUIRED"`.