---
title: "Upload media for agent"
method: POST
path: "/api/media/{agentId}/upload-media"
tags: ["media"]
---

# Upload media for agent

`POST /api/media/{agentId}/upload-media`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/media/{agentId}/upload-media`
- Auth: none declared

Upload image or video media for an agent

## Path parameters

- `agentId` string, uuid, required

## Request body `multipart/form-data`

- object
  - `file` string, binary: Media file to upload

## Response `200`

Media uploaded successfully

- object
  - `id` string, uuid
  - `url` string: URL of the uploaded media
  - `type` 'image' | 'video'
  - `mimeType` string
  - `size` integer

## Other responses

- `400`: Invalid request or file type
- `404`: Agent not found
- `413`: File too large
- `415`: Unsupported media type
- `500`: Error uploading media

---

[API](https://skmtc.dev/elizaos/apis/eliza-os-api.md) - [All operations](https://skmtc.dev/elizaos/apis/eliza-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elizaos/apis/eliza-os-api/revisions/d606a12682bb?raw)
