Connect your own app, script, or workflow to SafeLinkMe using a personal API key. This guide covers the general flow; your dashboard always shows the current details.
Open the Rest API tool in your dashboard and choose Generate API key. The key is shown only once, so copy it right away and store it somewhere safe.
Add your key in the Authorization header as a Bearer token. Requests without a valid key are rejected.
Responses are JSON. Successful creates return status 201, reads return 200, and failures return an error code you can match against the table below.
Create a shortlink. Send url (required, must start with http:// or https://) and an optional alias. Without an alias, a random code is generated.
curl -X POST https://api.safelinkme.net/api/v1/links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/page","alias":"my-code"}'
{
"id": 123,
"code": "my-code",
"customAlias": true,
"destUrl": "https://example.com/page",
"createdAt": 1790000000000
}
Your shortlink is https://safelinkme.net/ followed by the returned code.
List the links in your account, 50 per page. Use ?page=2 to move through pages.
curl "https://api.safelinkme.net/api/v1/links?page=1" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"links": [
{
"id": 123,
"code": "my-code",
"custom_alias": 1,
"dest_url": "https://example.com/page",
"status": "active",
"views": 0,
"earnings": 0,
"created_at": 1790000000000
}
],
"page": 1,
"pageSize": 50
}
Get the details of one link you own, including views and earnings. Links that belong to other accounts or were deleted return NOT_FOUND.
curl https://api.safelinkme.net/api/v1/links/my-code \ -H "Authorization: Bearer YOUR_API_KEY"
An alias must be 3 to 30 characters using lowercase letters, numbers, hyphens, and underscores. It cannot start or end with a hyphen or underscore, cannot contain two hyphens in a row, and cannot match a reserved word such as a page name on the site. Aliases are converted to lowercase and must be unique across the platform.
| Code | Status | What to do |
|---|---|---|
| UNAUTHORIZED | 401 | Check that the key is correct, active, and sent as a Bearer token. |
| INVALID_BODY | 400 | Send valid JSON with the Content-Type header set to application/json. |
| INVALID_DEST_URL | 400 | The url must be a full http:// or https:// address. |
| INVALID_ALIAS | 400 | Follow the alias rules above. |
| ALIAS_TAKEN | 409 | Choose a different alias. |
| NOT_FOUND | 404 | No link with that code exists in your account. |
| RATE_LIMITED | 429 | You reached a usage limit. Wait a while and try again. |
| MAINTENANCE | - | The Rest API is temporarily unavailable. Try again later. |
Anyone with your key can create links in your account. Keep it out of public code, screenshots, and front-end scripts.
Regenerating creates a new key and the old one stops working immediately. Update every app that used it.
Revoking disables the key completely. You can generate a new one whenever you need it.
Generate your key and create your first link in minutes.