slsh.me

api.slsh.me › back to slsh.me

slsh.me API v1

Bearer-token auth, JSON in/out, real-time clicks. Base URL: https://api.slsh.me/v1.

Authentication

Every request to /v1/* must include an Authorization: Bearer <token> header. Create tokens at app.slsh.me/settings/api. Tokens are named PATs; revoke any of them individually.

Missing or invalid tokens return 401 {"error": "invalid_token"}.

List your short links

GET /v1/links

Returns an array of links owned by the authenticated token's user, paginated 100/page.

200 Success
401 Missing or invalid token

Create a short link

POST /v1/links

Creates a short link from a long URL. Slug is auto-generated if omitted.

NameTypeRequiredDescription
url String required The destination URL (http or https)
slug String Custom slug; must be unique within your account
password String Password-protect the redirect
expires_at String ISO 8601 expiry timestamp
max_clicks Integer Auto-expire after N clicks
og_title String Open Graph title
og_description String Open Graph description
201 Created
401 Missing or invalid token
422 Invalid params

Fetch a link by slug

GET /v1/links/:slug

200 Success
401 Missing or invalid token
403 Slug belongs to another user
404 Unknown slug

Update a link

PATCH /v1/links/:slug

Updates the destination URL or metadata. The slug is immutable; any slug in the body is ignored.

NameTypeRequiredDescription
url String Replace the destination URL
password String Set or change the password
expires_at String ISO 8601 expiry timestamp
max_clicks Integer Auto-expire after N clicks
og_title String Open Graph title
og_description String Open Graph description
200 Updated
401 Missing or invalid token
403 Slug belongs to another user
404 Unknown slug
422 Invalid params

Delete a link

DELETE /v1/links/:slug

Permanently deletes the link and cascades to its click history.

204 Deleted
401 Missing or invalid token
403 Slug belongs to another user
404 Unknown slug