Quick start
- Create an account and verify your email.
- Create an API key on the API keys page and store it securely.
- Create a link:
Response 201 Created (with a Location: /api/v1/links/aB3xY9kQ header):
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):
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
| Scope | Allows |
|---|---|
| links:read | List and read your links, download QR codes |
| links:write | Create, disable, enable and delete links |
| stats:read | Read click statistics for your links |
| usage:read | Read your plan, quota and usage |
Endpoints
| Method | URL | Scope | Description |
|---|---|---|---|
| POST | https://s.developers.sa/api/v1/links | links:write | Create a link (201, or 200 when it already existed) |
| GET | https://s.developers.sa/api/v1/links | links:read | List your links (newest first) |
| GET | https://s.developers.sa/api/v1/links/{code} | links:read | Get a link |
| PATCH | https://s.developers.sa/api/v1/links/{code} | links:write | Disable / re-enable: {"isActive": false} (returns the link) |
| DELETE | https://s.developers.sa/api/v1/links/{code} | links:write | Delete a link (204) |
| GET | https://s.developers.sa/api/v1/links/{code}/stats | stats:read | Click statistics |
| GET | https://s.developers.sa/api/v1/links/{code}/qr.png https://s.developers.sa/api/v1/links/{code}/qr.svg | links:read | QR code image |
| GET | https://s.developers.sa/api/v1/usage | usage:read | Plan, 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
| Field | Type | Notes |
|---|---|---|
| url | string, required | Absolute http(s) URL, max 2048 characters. Screened for malware/phishing. |
| alias | string | Custom code, 3-16 letters/digits. Pro plans and above. |
| password | string | Visitors must enter it before redirecting (8-128 chars). Never returned. Pro plans and above. |
| activatesAt | ISO 8601 | Link 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
returns {"data": [...], "nextCursor": "3f2a9c1e-7b4d-4e8a-9c6f-0d1b2a3c4e5f"}. Pass it back unchanged for the next page:
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:
Each type links to the matching row of the table below.
| Code | HTTP | Meaning |
|---|---|---|
| authentication_required | 401 | No API key was sent. Use Authorization: Bearer <key>. |
| invalid_api_key | 401 | The key is malformed or doesn't exist. |
| api_key_revoked | 401 | The key was revoked. Create a new one. |
| api_key_expired | 401 | The key passed its expiry date (or its rotation grace period). |
| client_suspended | 403 | Your account is suspended. Contact support. |
| client_blocked | 403 | Your account is blocked. |
| insufficient_scope | 403 | The key lacks the scope this endpoint needs. |
| feature_not_in_plan | 403 | Alias, password, scheduling or QR isn't included in your plan. |
| https_required | 400 | The API only accepts HTTPS requests. |
| validation_failed | 400 | A field is missing or invalid; see the errors member. |
| invalid_url | 400 | The destination isn't an absolute public http(s) URL. |
| invalid_alias | 400 | Aliases are 3-16 letters/digits and can't be reserved words. |
| invalid_password | 400 | Link passwords are 8-128 characters. |
| invalid_activation | 400 | activatesAt must be in the future and within one year. |
| idempotency_key_invalid | 400 | Idempotency-Key must be 1-64 printable ASCII characters. |
| not_found | 404 | No such link in your account (or no such endpoint). |
| method_not_allowed | 405 | The HTTP method isn't supported for this endpoint. |
| unsupported_media_type | 415 | Send request bodies as application/json. |
| alias_taken | 409 | The alias is already used by another link. |
| link_locked | 409 | The platform disabled this link; it can't be changed through the API. |
| already_shortened | 422 | The URL is already a short link from this service. |
| already_short_enough | 422 | The URL is already as short as a short link. |
| tracking_link | 422 | Tracking links can't be shortened. |
| unknown_short_link | 422 | The URL points to a short link that doesn't exist. |
| blocked_domain | 422 | Links to this domain are not allowed. |
| unsafe_url | 422 | The destination was flagged as malware/phishing. Repeated attempts suspend the account. |
| idempotency_key_reused | 422 | The Idempotency-Key was used with a different request body. |
| rate_limited | 429 | Too many requests per minute for your plan. See Retry-After. |
| quota_exceeded | 429 | Monthly link quota reached. Resets on the 1st (UTC). |
| domain_rate_limited | 429 | Too many new links to one destination domain. Retry later. |
| internal_error | 500 | Unexpected error. Retry; contact support with the traceId. |
| safety_check_unavailable | 503 | Destination screening is temporarily unavailable. Retry shortly. |
| generation_failed | 503 | A 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.