Uploadcare

Learn how to use Uploadcare with Composio

Overview

SLUG: UPLOADCARE

Description

Uploadcare is a comprehensive file handling service that offers uploading, storage, processing, and delivery solutions for web and mobile applications.

Authentication Details

generic_api_key
stringRequired
generic_secret
stringRequired

Connecting to Uploadcare

Create an auth config

Use the dashboard to create an auth config for the Uploadcare toolkit. This allows you to connect multiple Uploadcare accounts to Composio for agents to use.

1

Select App

Navigate to Uploadcare.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Uploadcare Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4uploadcare_auth_config_id = "ac_YOUR_UPLOADCARE_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Uploadcare for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, uploadcare_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Uploadcare toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["UPLOADCARE"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create Uploadcare webhook

Description

Tool to create a new webhook. use when you need to subscribe to file events and receive notifications at your service. ensure you have an existing project uuid before using this tool.

Action Parameters

event
stringRequired
inactive
boolean
project
Required
signing_secret
string
target_url
Required

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete File Metadata Key

Description

Tool to delete a specific metadata key from an uploadcare file. use when you need to remove obsolete metadata after file processing.

Action Parameters

key
stringRequired
uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Webhook

Description

Tool to delete a specific webhook. use when you need to remove a webhook by its id after confirming its details.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Uploadcare File Download URL

Description

Tool to retrieve a temporary download url for a file. use when you need a direct download link after uploading a file.

Action Parameters

file_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Uploadcare File Info

Description

Tool to get information about a specific file. use after uploading a file to retrieve detailed metadata and usage information.

Action Parameters

uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Uploadcare Project Info

Description

Tool to get information about the current uploadcare project. use when you need to retrieve project configuration details.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Uploadcare Files

Description

Tool to list files in a project. use when you need to retrieve uploaded files with optional filters, pagination, or include total count.

Action Parameters

from_date
string
include
string
limit
integer
offset
integer
ordering
string
removed
string
stored
string
to_date
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Uploadcare Groups

Description

Tool to list groups in the project. use when you need to retrieve paginated groups of files.

Action Parameters

limit
integerDefaults to 20
offset
integer
ordering
stringDefaults to datetime_created

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Uploadcare Webhooks

Description

Tool to list webhook subscriptions. use when you need a paginated list of webhooks for your project after configuring authentication.

Action Parameters

limit
integer
offset
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Rotate Image

Description

Tool to rotate an image by specified degrees clockwise. use when you need to rotate an uploaded image by 90, 180, or 270 degrees. use after confirming the file uuid.

Action Parameters

degrees
integerRequired
uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Store Uploadcare File

Description

Tool to mark an uploadcare file as permanently stored. use after uploading a file when you need to store it permanently.

Action Parameters

uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Mirror Uploadcare Image

Description

Tool to mirror an image horizontally via uploadcare cdn. use when you need the url of a horizontally flipped image.

Action Parameters

uuid
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired