# ShareX setup: upload with one keypress

How to set up ShareX with hematite: download the config, add it to ShareX, and upload with one keypress. What each part does, and what its errors mean.

[ShareX](https://getsharex.com) is a free screenshot tool for Windows. With hematite's config, a capture goes straight up and its link lands on your clipboard. The same file works in [XerahS and SnapX](#xerahs-and-snapx). Without either, [upload from the browser](https://hematite.gg/docs/getting-started/first-upload) or set up [another uploader](#other-uploaders).

## Set it up

1. **Download your config.** In hematite, open [Settings → Uploaders](https://hematite.gg/settings/uploaders) and press **Download config** beside ShareX. You get `sharex-config.sxcu`.
2. **Open the file.** With ShareX installed, opening a `.sxcu` file adds it to ShareX as a custom uploader.
3. **Choose it.** In ShareX, under **Destinations**, set **Image uploader** to **Custom image uploader**, with hematite's as the one in use.
4. **Take a screenshot.** When it's up, the link is on your clipboard.

> **Warning: The file holds a token: keep it to yourself**
>
> Each config you download carries a new upload token, which is shown nowhere
> else. Anyone with the file can upload to your account. If it gets out, remove
> the token (below) and download a new config.

## What's in the file

The config is plain JSON. These are its parts and what each does:

```json title="sharex-config.sxcu"
{
  "Version": "19.0.0",
  "Name": "hematite.gg - Images",
  "DestinationType": "ImageUploader",
  "RequestMethod": "POST",
  "RequestURL": "https://api.hematite.gg/v1/images",
  "Headers": {
    "Authorization": "hmu_live_…"
  },
  "Arguments": {
    "p": "sharex",
    "v": "1",
    "t": "1762885440000"
  },
  "Body": "MultipartFormData",
  "FileFormName": "file",
  "URL": "{json:data.shareUrl}",
  "DeletionURL": "{json:data.deleteUrl}",
  "ErrorMessage": "Error: {json:message}"
}
```

| Part                    | What it does                                                                                                   |
| ----------------------- | -------------------------------------------------------------------------------------------------------------- |
| `RequestURL`            | Where captures are sent: the API's upload endpoint, [`POST /images`](https://hematite.gg/docs/developers/reference/images#post-images) |
| `Headers.Authorization` | Your upload token (`hmu_live_…`). It can upload and do nothing else                                            |
| `Arguments`             | Says the upload comes from ShareX (`p`), which config it is (`v`) and when the file was made (`t`)             |
| `FileFormName`          | The form field the image is sent in, `file`                                                                    |
| `URL`                   | The link ShareX copies: the one your [link settings](https://hematite.gg/docs/guides/share-links) make                                 |
| `DeletionURL`           | A link that deletes the upload, kept in ShareX's history                                                       |
| `ErrorMessage`          | What ShareX shows when an upload fails: hematite's message                                                     |

## How ShareX uploads come out

- **They take your [upload settings](https://hematite.gg/settings/upload):** who can see them (Unlisted unless you chose otherwise), when they delete themselves, how they're compressed and whether their file names are random.
- **Their link** follows the same settings: share page or file, your domain, your share code's style.
- **They go in no folder.** Move them from [your images](https://hematite.gg/images).

## The delete link

ShareX keeps a deletion link for each upload in its history. Opening it asks **Delete this image?**, and **Delete permanently** deletes it, no sign-in needed. A deletion link works for 24 hours after the upload; after that it says it expired, and you delete the image from [your images](https://hematite.gg/images).

## Your upload tokens

A config's token lasts 90 days. You can have ten upload tokens at a time, counting every uploader's and the ones you made for your own scripts. They're listed beside the uploaders on [Settings → Uploaders](https://hematite.gg/settings/uploaders), and in [Settings → Security](https://hematite.gg/settings/security) under **Upload tokens**, each under the name of the uploader it's for (this one's is **ShareX**), with when it was made and when it expires. Remove one in either place and the config holding it stops working; the others carry on. With ten, remove one before you download a new config.

## XerahS and SnapX

[XerahS](https://github.com/ShareX/XerahS), the ShareX team's new app for Windows, macOS and Linux, reads the same config. It's before its 1.0, so it's set up by hand:

1. **Import it.** In XerahS, open **Settings → Destination Settings**, press **Add Custom Uploader**, then **Import...**, and choose `sharex-config.sxcu`.
2. **Save it.** Press **Save to Plugins**. Then, in the new uploader's **…** menu, choose **Set as Default**.
3. **Upload after a capture.** Make sure uploading is among XerahS's tasks after a capture, as in ShareX.

Two things work differently from ShareX:

- **A failed upload goes elsewhere.** When hematite refuses an upload, XerahS tries your other uploaders next, by default. If you've set up others, the capture can end up there.
- **The delete link** is kept in its history, but there's no menu item to open it. Delete the image from [your images](https://hematite.gg/images) instead.

Don't open the config with XerahS directly (double-click, or passing it on the command line): XerahS then uploads the file itself, token and all, to your file uploader.

**[SnapX](https://github.com/SnapXL/SnapX)**, a fork of ShareX, reads the config too: under **Settings → Destinations**, **Custom uploaders**, press **Import** and choose the file (on Windows, opening it does the same). It then uploads with hematite at once, without asking first as ShareX does. SnapX has only test releases so far, and says it isn't ready for use. **XerahS's iPhone app**, in preview, opens the file from Files; it keeps no delete link.

## Other uploaders

For a Mac, [ishare](https://hematite.gg/docs/uploaders/ishare) has a config of its own. [Flameshot](https://hematite.gg/docs/uploaders/flameshot), [ksnip](https://hematite.gg/docs/uploaders/ksnip) and [Greenshot](https://hematite.gg/docs/uploaders/greenshot) run [hematite's upload script](https://hematite.gg/docs/uploaders/upload-script). On a phone, use [a Shortcut on the iPhone](https://hematite.gg/docs/uploaders/iphone) or [HTTP Shortcuts on Android](https://hematite.gg/docs/uploaders/android).

## When it fails

ShareX shows the error after `Error:`; [API errors and rate limits](https://hematite.gg/docs/developers/errors) has the full list.

| ShareX says                                        | What it means                                                              | What to do                                   |
| -------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------- |
| Authentication is required for this route.         | The token is missing, expired or removed                                   | Download a new config                        |
| Storage limit reached                              | Your plan's storage is full                                                | Delete something, or see [pricing](https://hematite.gg/pricing) |
| Request validation failed.                         | The file is over 16 MB, or isn't PNG, JPEG, GIF or WebP                    | Capture as PNG or JPEG, or make it smaller   |
| Forbidden                                          | The token was used for something other than uploading                      | Use the config as it came                    |
| Too many requests. Please slow down and try again. | Uploads past the limit, 60 a minute | Wait a moment, then upload again             |
