Skip to content

Upload API

The Upload API supports uploading files to CloudFlare ImgBed through third parties, making it easy to integrate into various applications and services.

Basic Information

  • Endpoint: /upload
  • Method: POST
  • Content Type: multipart/form-data
  • File Size Limit: Depends on storage channel

Request Parameters

Query Parameters

ParameterTypeRequiredDefaultDescription
authCodestringNo-Upload authentication code
serverCompressbooleanNotrueServer-side compression (only for Telegram channel image files)
uploadChannelstringNotelegramUpload channel: telegram, cfr2, s3
autoRetrybooleanNotrueAutomatically switch channels and retry on failure
uploadNameTypestringNodefaultFile naming method, options are [default, index, origin, short], representing default prefix_original naming, prefix only naming, original name only naming, and short link naming method, default is default
returnFormatstringNodefaultReturn link format, options are [default, full], representing default /file/id format and full link format
uploadFolderstringNo-Upload directory, use relative path, e.g., to upload to img/test directory, fill img/test

Body Parameters

ParameterTypeRequiredDescription
fileFileYesFile to upload

Response Format

data[0].src is the obtained image link (note that it does not include the domain name, you need to add it yourself)

Examples

Request Example

bash
 curl --location --request POST 'https://your.domain/upload?authCode=your_authCode' \\

 --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \\
 
 --form 'file=@"D:\\杂文件\\壁纸\\genshin109.jpg"'

Response Example

json
[
  {
    "src": "/file/abc123_image.jpg"
  }
]

Released under the MIT License