Swush
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

  1. Grab your API key in Swush: Settings → API.
  2. Know your base URL (for self‑hosted: https://your-domain.com).
  3. 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.

  1. Add Action → Get Contents of URL
  2. Set Method to POST.
  3. Tap Headers → add:
  • Key: x-api-key
  • Value: your API key
  1. Tap Request Body → choose JSON.
  2. Add the fields for the request (see each section below).
  3. (Optional) Add Show Notification to display the response.

To send the current page or selected text from Safari:

  1. In the shortcut editor, tap → enable Show in Share Sheet.
  2. Under Accepted Types, choose URLs (and Text if you want notes).
  3. In your JSON body, use the Shortcut Input token for url, originalUrl, or content.

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
  • 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 Input
  • sourceUrl: Shortcut Input (URL) when run from Safari
  • title: Ask for Input (Text)

Upload

  • POST /api/v1/upload
  • Body: Form

Fields:

  • file (File)
  • isPublic
  • description (optional)
  • folderName (optional)
  • newTags (comma-separated)

iOS example

  1. Add Select File (or Select Photos).
  2. Add Get Contents of URLMethod: POST.
  3. Request Body: Form and map:
  • file: Selected file
  • description: 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 file is a File object.

On this page