How-to
Apple Shortcuts
Automate Swush on iOS and macOS.
Use iOS Shortcuts with Get Contents of URL. Every request must include your API key in the x-api-key header.
Before you start
- Grab your API key in Swush: Settings → API.
- Know your base URL (for self‑hosted:
https://your-domain.com). - Open Shortcuts on iOS and tap + to create a new shortcut.
Build a shortcut (iOS)
These steps are the same for bookmarks, notes, and short links. Only the URL and JSON body change.
- Add Action → Get Contents of URL
- Set Method to POST.
- Tap Headers → add:
- Key:
x-api-key - Value: your API key
- Tap Request Body → choose JSON.
- Add the fields for the request (see each section below).
- (Optional) Add Show Notification to display the response.
Share Sheet integration (recommended)
To send the current page or selected text from Safari:
- In the shortcut editor, tap ⓘ → enable Show in Share Sheet.
- Under Accepted Types, choose URLs (and Text if you want notes).
- In your JSON body, use the Shortcut Input token for
url,originalUrl, orcontent.
Helpful variables
- Shortcut Input → Use for the current URL or selected text.
- Ask for Input → Prompt for a title, tags, or description.
- Text → Build a comma‑separated tag list for
newTags.
Bookmark
POST /api/v1/bookmarks- JSON body
{
"url": "https://example.com",
"title": "Optional title",
"isPublic": false,
"tags": ["reading"]
}iOS example
url: Shortcut Input (Type: URL)title: Ask for Input (Text)tags: Ask for Input → Split Text by comma → Get Items from List
Short link
POST /api/v1/shorten- JSON body
{
"originalUrl": "https://example.com",
"isPublic": true
}iOS example
originalUrl: Shortcut Input (Type: URL)isPublic: Ask for Input (Boolean)
Note
POST /api/v1/notes- JSON body
{
"title": "Optional title",
"content": "note text",
"sourceUrl": "https://source.com",
"isPublic": false,
"tags": ["ideas"]
}iOS example
content: Shortcut Input (Text) or Ask for InputsourceUrl: Shortcut Input (URL) when run from Safarititle: Ask for Input (Text)
Upload
POST /api/v1/upload- Body: Form
Fields:
file(File)isPublicdescription(optional)folderName(optional)newTags(comma-separated)
iOS example
- Add Select File (or Select Photos).
- Add Get Contents of URL → Method: POST.
- Request Body: Form and map:
file: Selected filedescription: Ask for Input (Text)folderName: Ask for Input (Text)newTags: Ask for Input (Text, comma‑separated)isPublic: Ask for Input (Boolean)
Troubleshooting
- 401/403: API key missing or invalid. Re‑copy the key from Settings → API.
- 404: Check your base URL and endpoint path.
- 422: JSON body fields are missing or wrong type. Ensure booleans are true/false.
- Uploads fail: Use Form body and ensure
fileis a File object.