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.
Responses
| 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.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| 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 | |
Responses
| 201 | Created |
| 401 | Missing or invalid token |
| 422 | Invalid params |
Fetch a link by slug
GET
/v1/links/:slug
Responses
| 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.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| 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 | |
Responses
| 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.
Responses
| 204 | Deleted |
| 401 | Missing or invalid token |
| 403 | Slug belongs to another user |
| 404 | Unknown slug |
List clicks for a link
GET
/v1/links/:link_slug/clicks
Returns the click stream (visits) for a link you own, newest first. Paginated 100/page.
Responses
| 200 | Success |
| 401 | Missing or invalid token |
| 403 | Link belongs to another user |
| 404 | Unknown link slug |