View as Markdown
ImageKit.io icon

ImageKit.io ACTION

Upload Image

Upload a new image to ImageKit.io. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's ImageKit.io account once, then configure and run Upload Image from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "imagekit_io-upload-image",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    imagekit_io: { authProvisionId: "apn_xxxxxxx" },
    file: "File Path or URL",
    fileName: "File Name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Upload Image inputs
Property Type Description
file File Path or URL string
The file to upload. Provide a file URL or a path to a file in the /tmp directory. This can be a binary file or a base64-encoded string.
Required
fileName File Name string
The name with which the file has to be uploaded. The file name can contain: - Alphanumeric Characters: a-z , A-Z , 0-9 (including unicode letters, marks, and numerals in other languages) - Special Characters: . and - Any other character including space will be replaced by _
Required
useUniqueFileName Use Unique Filename boolean
Whether to use a unique filename for this file or not. If set true, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. If set false, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. Default Value is True
Optional
tags Tags string[]
Set the tags while uploading the file. % is not allowed. If this field is not specified and the file is overwritten then the tags will be removed.
Optional
folder Folder string
The folder path (e.g. /images/folder/) in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. The nesting of folders can be at most 50 levels deep. The folder name can contain: - Alphanumeric Characters: a-z , A-Z , 0-9 (including unicode letters, marks, and numerals in other languages). - Special Characters: /, _ and -. - Using multiple / creates a nested folder.
Optional
isPrivateFile Is Private File boolean
Whether to mark the file as private or not. This is only relevant for image type files.
Optional
isPublished Is Published boolean
Whether to upload file as published or not. If set false, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. - The option to upload in draft state is only available in custom enterprise pricing plans.
Optional
customCoordinates Custom Coordinates string
Define an important area in the image. This is only relevant for image type files. The the format x,y,width,height. For example - 10,10,100,100.
Optional
responseFields Response Fields string[]
A list of the fields that you want the API to return in the response. For example, set the value of this field to tags, customCoordinates, isPrivateFile to get the value of tags, customCoordinates, isPublished and isPrivateFile in the response. Accepts combination of tags, customCoordinates, isPrivateFile, embeddedMetadata, customMetadata, and metadata.
Optional
extensions Extensions string[]
An array of stringified object extensions to be applied to the image. For reference about extensions read here.
Optional
webhookUrl Webhook URL string
The final status of pending extensions will be sent to this URL. To learn more about how ImageKit uses webhooks, refer here.
Optional
overwriteFile Overwrite File boolean
Default is true. If overwriteFile is set to false and useUniqueFileName is also false, and a file already exists at the exact location, upload API will return an error immediately.
Optional
overwriteAITags Overwrite AI Tags boolean
Default is true. If the request does not have tags, overwriteTags is set to true and a file already exists at the exact location, exiting tags will be removed. In case the request body has tags, setting overwriteTags to false has no effect and request's tags are set on the asset.
Optional
overwriteCustomMetadata Overwrite Custom Metadata boolean
Default is true. If the request does not have customMetadata, overwriteCustomMetadata is set to true and a file already exists at the exact location, exiting customMetadata will be removed. In case the request body has customMetadata, setting overwriteCustomMetadata to false has no effect and request's customMetadata is set on the asset.
Optional
customMetadata customMetadata object
A JSON key-value data to be associated with the asset. Checkout overwriteCustomMetadata parameter to understand default behaviour. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API.
Optional
syncDir SyncDir dir
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
imagekit_io-upload-image
Version
1.0.4
App
ImageKit.io
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes