Skip to main content
POST
/
api
/
upload
Upload Image
curl --request POST \
  --url https://api.example.com/api/upload \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

This endpoint requires authentication. Include a valid session cookie or authentication token.

Request

This endpoint accepts multipart/form-data with a file upload.
file
file
required
The image file to upload. Must be one of the following types:
  • image/jpeg
  • image/png
  • image/gif
  • image/webp
Maximum file size: 10MB

Response

url
string
required
The public URL of the uploaded image

Example Request

cURL
curl -X POST https://api.dyeink.com/api/upload \
  -H "Cookie: session=your-session-token" \
  -F "file=@/path/to/image.jpg"

Example Response

{
  "url": "https://storage.dyeink.com/uploads/abc123def456.jpg"
}

Error Responses

400 Bad Request
No file uploaded
{
  "error": "No file uploaded"
}
orInvalid file type (not an accepted image format)
{
  "error": "Invalid file type"
}
orFile exceeds 10MB size limit
{
  "error": "File too large (max 10MB)"
}
401 Unauthorized
User is not authenticated
{
  "error": "Not authenticated"
}
500 Internal Server Error
Failed to upload the image
{
  "error": "Failed to upload image"
}

Notes

  • Supported image formats: JPEG, PNG, GIF, WebP
  • Maximum file size is 10MB
  • The uploaded image is stored in a cloud storage service and a public URL is returned
  • For client-side uploads with presigned URLs, see POST /api/upload/presigned

Build docs developers (and LLMs) love