API documentation

Version 1 · JSON over HTTPS. Full schema: OpenAPI 3 document · interactive reference.

API Base URL
https://s.developers.sa/api/v1

Every endpoint below is relative to this URL, e.g. POST https://s.developers.sa/api/v1/links. HTTPS only.

Quick start

  1. Create an account and verify your email.
  2. Create an API key on the API keys page and store it securely.
  3. Create a link:
curl -X POST https://s.developers.sa/api/v1/links \ -H "Authorization: Bearer $SHORTENURL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1042" \ -d '{"url":"https://developers.sa/products/1042?utm_source=sms"}'

Response 201 Created (with a Location: /api/v1/links/aB3xY9kQ header):

{ "code": "aB3xY9kQ", "shortUrl": "https://s.developers.sa/aB3xY9kQ", "originalUrl": "https://developers.sa/products/1042?utm_source=sms", "trackingUrl": "https://s.developers.sa/t/5f0c1e9a7b3d4c2e8f6a1b0d9c7e5a3f", "passwordProtected": false, "activatesAt": null, "createdAt": "2026-11-27T09:30:12.123Z", "alreadyExisted": false }

Share shortUrl with your users. trackingUrl opens the link's private analytics page - keep it to yourself.

Authentication

Send your key on every request in the Authorization header (or X-Api-Key):

Authorization: Bearer su_AbCd1234_9fK2...

Keys are never accepted in the query string. Each key can be limited to specific scopes, given an expiry date, rotated (the old key keeps working for 24 hours) and revoked instantly. Plain-HTTP requests are refused with https_required.

Scopes

ScopeAllows
links:readList and read your links, download QR codes
links:writeCreate, disable, enable and delete links
stats:readRead click statistics for your links
usage:readRead your plan, quota and usage

Endpoints

MethodURLScopeDescription
POSThttps://s.developers.sa/api/v1/linkslinks:writeCreate a link (201, or 200 when it already existed)
GEThttps://s.developers.sa/api/v1/linkslinks:readList your links (newest first)
GEThttps://s.developers.sa/api/v1/links/{code}links:readGet a link
PATCHhttps://s.developers.sa/api/v1/links/{code}links:writeDisable / re-enable: {"isActive": false} (returns the link)
DELETEhttps://s.developers.sa/api/v1/links/{code}links:writeDelete a link (204)
GEThttps://s.developers.sa/api/v1/links/{code}/statsstats:readClick statistics
GEThttps://s.developers.sa/api/v1/links/{code}/qr.png
https://s.developers.sa/api/v1/links/{code}/qr.svg
links:readQR code image
GEThttps://s.developers.sa/api/v1/usageusage:readPlan, quota and 30-day usage

You only ever see your own links. Links created on the public website or by other accounts return not_found.

Creating links

FieldTypeNotes
urlstring, requiredAbsolute http(s) URL, max 2048 characters. Screened for malware/phishing.
aliasstringCustom code, 3-16 letters/digits. Pro plans and above.
passwordstringVisitors must enter it before redirecting (8-128 chars). Never returned. Pro plans and above.
activatesAtISO 8601Link won't redirect before this instant (max 1 year ahead). Pro plans and above.

Shortening the same plain URL again returns your existing link with 200 and "alreadyExisted": true - no quota is used. Links with an alias, password or schedule are always new.

Pagination

curl "https://s.developers.sa/api/v1/links?limit=50" \ -H "Authorization: Bearer $SHORTENURL_API_KEY"

returns {"data": [...], "nextCursor": "3f2a9c1e-7b4d-4e8a-9c6f-0d1b2a3c4e5f"}. Pass it back unchanged for the next page:

curl "https://s.developers.sa/api/v1/links?limit=50&cursor=3f2a9c1e-7b4d-4e8a-9c6f-0d1b2a3c4e5f" \ -H "Authorization: Bearer $SHORTENURL_API_KEY"

nextCursor is an opaque value (treat it as a string) and is null on the last page. limit is 1-100 (default 20). An invalid cursor returns 400 validation_failed.

Idempotency

Add Idempotency-Key: <unique value> to POST https://s.developers.sa/api/v1/links so a retried request (timeout, network error) can never create a duplicate. For 24 hours the same key with the same body replays the original response (header Idempotent-Replayed: true); the same key with a different body fails with idempotency_key_reused.

Rate limits & quotas

  • Requests per minute depend on your plan and apply per account across all keys. Exceeding them returns 429 rate_limited with a Retry-After header.
  • Links per month count new links created since the 1st of the month (UTC). Creation responses include X-Quota-Limit and X-Quota-Remaining. When exhausted: 429 quota_exceeded.
  • Requests without a valid key are limited per IP address.
  • Check your current numbers any time with GET https://s.developers.sa/api/v1/usage or on the Usage page.

Errors

Errors use RFC 9457 application/problem+json. Branch on code, never on the message text:

Example: POST https://s.developers.sa/api/v1/links after the monthly quota is used up returns 429:

{ "type": "https://s.developers.sa/developers/docs#error-quota_exceeded", "title": "Too Many Requests", "status": 429, "detail": "Monthly link quota of 200 reached. It resets on 2026-12-01 (UTC). Upgrade your plan for more.", "instance": "/api/v1/links", "code": "quota_exceeded", "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" }

Each type links to the matching row of the table below.

CodeHTTPMeaning
authentication_required401No API key was sent. Use Authorization: Bearer <key>.
invalid_api_key401The key is malformed or doesn't exist.
api_key_revoked401The key was revoked. Create a new one.
api_key_expired401The key passed its expiry date (or its rotation grace period).
client_suspended403Your account is suspended. Contact support.
client_blocked403Your account is blocked.
insufficient_scope403The key lacks the scope this endpoint needs.
feature_not_in_plan403Alias, password, scheduling or QR isn't included in your plan.
https_required400The API only accepts HTTPS requests.
validation_failed400A field is missing or invalid; see the errors member.
invalid_url400The destination isn't an absolute public http(s) URL.
invalid_alias400Aliases are 3-16 letters/digits and can't be reserved words.
invalid_password400Link passwords are 8-128 characters.
invalid_activation400activatesAt must be in the future and within one year.
idempotency_key_invalid400Idempotency-Key must be 1-64 printable ASCII characters.
not_found404No such link in your account (or no such endpoint).
method_not_allowed405The HTTP method isn't supported for this endpoint.
unsupported_media_type415Send request bodies as application/json.
alias_taken409The alias is already used by another link.
already_shortened422The URL is already a short link from this service.
already_short_enough422The URL is already as short as a short link.
blocked_domain422Links to this domain are not allowed.
unsafe_url422The destination was flagged as malware/phishing. Repeated attempts suspend the account.
idempotency_key_reused422The Idempotency-Key was used with a different request body.
rate_limited429Too many requests per minute for your plan. See Retry-After.
quota_exceeded429Monthly link quota reached. Resets on the 1st (UTC).
domain_rate_limited429Too many new links to one destination domain. Retry later.
internal_error500Unexpected error. Retry; contact support with the traceId.
safety_check_unavailable503Destination screening is temporarily unavailable. Retry shortly.
generation_failed503A short code couldn't be generated. Retry.

Security checklist

  • Keep keys server-side only - never in mobile apps, browser JavaScript or source control.
  • Use one key per environment/service, with only the scopes it needs, and an expiry date.
  • Rotate keys regularly and immediately if one may have leaked; revoke unused keys.
  • Retry 429 and 503 with exponential back-off, honoring Retry-After.
  • Don't shorten links to content you don't control without screening it - unsafe destinations are rejected and repeated attempts suspend the account.