Skip to content

API Key Management

API keys provide a secure way to authenticate with Slink’s API for external integrations and automated uploads. They’re perfect for tools like ShareX or custom scripts that need to upload images programmatically.

  1. Navigate to Your Profile

    Go to your user profile page and click on the “API Keys” tab.

  2. Create New API Key

    Click the “Create API Key” button to open the creation dialog.

  3. Configure Your Key

    • Name: Give your API key a descriptive name (e.g., “ShareX Upload Key”, “Automation Script”)
    • Expiry Date (Optional): Set an expiration date for enhanced security, or leave empty for a permanent key
  4. Save and Store Securely

    Once created, copy and store your API key immediately. It will only be shown once and cannot be recovered if lost.

API keys are used in the Authorization header with the Bearer prefix:

Terminal window
curl -X POST \
-H "Authorization: Bearer sk_your_api_key_here" \
-F "image=@/path/to/your/image.jpg" \
https://your-slink-instance.com/api/external/upload

Upload Image:

  • Endpoint: POST /api/external/upload
  • Authentication: Required (API Key)
  • Body: Multipart form data with image field
  • Response: JSON with image URL and metadata

ShareX Integration:

  • Endpoint: GET /api/user/sharex-config?baseUrl=<url>&apiKey=<key>
  • Authentication: Required (User login)
  • Response: ShareX configuration file (.sxcu)

Slink provides built-in ShareX integration for seamless screenshot and image uploads.

  1. Create an API Key (see steps above)

  2. Download ShareX Config

    After creating a new API key, click “Download ShareX Config” to get a pre-configured .sxcu file.

  3. Import to ShareX

    Double-click the downloaded .sxcu file or import it manually in ShareX under: Destinations → Custom uploaders → Import → From file

If you prefer manual setup:

  1. Open ShareX and go to Destinations → Custom uploaders
  2. Click New to create a new uploader
  3. Configure the following settings:
    • Name: Slink
    • Method: POST
    • Request URL: https://your-slink-instance.com/api/external/upload
    • Headers: Authorization: Bearer your_api_key_here
    • Body: Form data (multipart/form-data)
    • File form name: image
    • URL: $json:url$
  • Use descriptive names to identify where each key is used
  • Set expiration dates for keys used in temporary or testing scenarios
  • Rotate keys regularly for enhanced security
  • Revoke unused keys to minimize attack surface
  • One key per application - Don’t share keys between different tools or scripts
  • Monitor usage - Check the “Last Used” field to identify inactive keys
  • Environment variables - Store API keys in environment variables, not in code
  • Never commit to version control - Add API keys to your .gitignore
  • Use secure storage - Consider using password managers or secure vaults
  • Limit access - Only share keys with team members who need them