---
title: "Create upload URL"
method: POST
path: "/api/v1/tools/create_upload_url"
---

# Create upload URL

`POST /api/v1/tools/create_upload_url`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/v1/tools/create_upload_url`
- Auth: HTTP bearer

A one-time link to upload a local file into the media library, for a client that can run a command (Claude Code, Codex, Cursor): PUT the file to uploadUrl with the returned Content-Type (the result includes the curl command), then call import_media with url set to the returned mediaUrl. The link expires in 15 minutes and signs one content type. If you cannot run a command, do not call this: ask the person to drop the file into their Treza library in the web app and find it with list_assets. Needs the pipelines:write scope. Spends no credits.

## Request body

- object
  - `contentType` 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'video/mp4' | 'video/quicktime' | 'video/webm' | 'audio/mpeg' | 'audio/mp4' | 'audio/wav' | 'audio/ogg', required: The type of the file you will upload, e.g. "image/png" for a PNG logo. The PUT must send exactly this Content-Type.

## Response `200`

The tool's result.

- object

## Other responses

- `400`: The arguments were refused. `error` says why.
- `401`: No API key, or one that is not valid.
- `402`: The credit balance does not cover this run.
- `403`: The API key lacks a permission this tool needs.
- `404`: No such tool, or the pipeline, run or asset is not on this account.
- `429`: Too many runs started or in progress. Wait, then try again.

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
