Skip to content

Integrations overview ​

Integrations are apps, plugins and bots that upload to your Chevereto website from somewhere else: your desktop, the command line, a chat app or another website. You upload from the tool you already use and get back the links, without opening your Chevereto website.

How integrations work ​

Most integrations talk to your Chevereto website through its API, a web address made for programs instead of people. Each Chevereto website has an upload API at its address followed by /api/1/upload, for example https://mysite.com/api/1/upload.

When you upload with an integration:

  1. The integration sends the file and your API key to the upload API
  2. Your website checks the key to know who is uploading, and saves the file to that account
  3. Your website replies with the details of the upload, including its links
  4. The integration shows you the links, or copies them to the clipboard

The upload works the same as if you used the website: it shows in your account and follows the same rules for formats, file size and moderation.

What you need ​

To set up an integration you need two things:

You needWhere to get it
Your API keyIn Settings > API
Your website addressThe address you open in your browser, for example https://mysite.com

Some integrations ask for the full upload URL (https://mysite.com/api/1/upload), others ask only for the website address and add /api/1/upload for themselves. Each integration guide tells you which one to use.

API not available?

If you don't see API in your settings, the website administrator has disabled the user API and integrations that need an API key won't work on that website.

What you can set on uploads ​

Besides the file, the API accepts options for each upload. Integrations decide which of these they let you set, so not every option is available in every integration.

OptionDescription
album_idAlbum where the upload goes. Must be one of your albums
titleTitle of the upload. Taken from the file metadata when not set
descriptionDescription of the upload. Taken from the file metadata when not set
tagsTags, separated by commas
category_idCategory of the upload
widthResize the image to this width, keeping its proportions
expirationDelete the upload after a time, for example PT5M (5 minutes) or P3D (3 days)
nsfw1 to flag the upload as not safe for work

TIP

The album ID is the last part of the album URL, after the dot. For https://mysite.com/album/vacation.AbCd the album ID is AbCd.

What you get back ​

The API replies in one of three ways. Integrations pick the one they need, and some let you choose:

FormatReply
jsonAll the details of the upload: links, size, thumbnails, delete link and more
txtOnly the direct link to the file
redirectSends you to the page of the upload on your website

Integrations without an API key ​

The Popup Upload Plugin works differently. It doesn't use your API key: it opens the upload box of your Chevereto website in a popup on another website, and uploads as whoever is signed in on your Chevereto website, or as a guest if the website allows guest uploads.

Keep your API key safe ​

Your API key works like a password for uploads: anyone who has it can upload files to your account.

  • Don't share your key or post it in forums, chats or screenshots
  • Don't save it in code that you publish, such as a public Git repository
  • For bots that other people can reach, like the Telegram Bot, limit who can use the bot

If you think your key was exposed, regenerate it. The old key stops working right away, so update every integration with the new key.

Troubleshooting ​

ProblemWhat to do
This API key format is no longer supportedYour key is from before Chevereto 4.4. Regenerate it
The key is rejected after it worked beforeThe key was regenerated. Copy the new key to the integration
Nothing is uploaded or the address isn't foundCheck the website address: use https://, and add or remove /api/1/upload as the guide says
The file is rejectedCheck that the website accepts the format and size of the file
The upload doesn't go to the albumCheck the album ID and that the album is yours

For developers ​

Build your own integration

Any program that can send a web request can upload to Chevereto. Send a POST request to /api/1/upload with the file in the source field and the user's API key in the X-API-Key header:

sh
curl --fail-with-body -X POST \
    -H "X-API-Key: YOUR_API_KEY" \
    -F "source=@image.jpeg" \
    -F "format=json" \
    https://mysite.com/api/1/upload

The JSON reply carries the links in image.url (direct), image.url_viewer (page) and image.delete_url (delete). The Authorization and File upload docs list every parameter and the full reply.

A few tips:

  • Ask users for their website address and API key, never ship a key in your code
  • Prefer the X-API-Key header over the key parameter, so the key doesn't end up in URLs and logs
  • Tell users that regenerating their key stops your integration until they enter the new one

To change Chevereto itself, for example with your own routes, theme or translations, see the developer documentation.

Made an integration? Send a pull request to the user manual repository with a guide for it in the integrations folder.

Released under the Apache-2.0 License.