Upload a file (base64) and attach it to a test

media.upload_urlChanges dataCreates, updates or deletes something in your workspace.

What it does

Uploads a file you already have, such as a screenshot of a bug, a short screen recording or a spec document, and optionally attaches it to a test case, test run or feature. Despite the name it does not fetch a URL: send the file bytes as base64 text. Linking decides where the file shows up: testCaseId attaches it to that test case (for example a screenshot of the expected screen); testRunId marks it as evidence from that test run (pass testCaseId too so it is tied to the case that produced it, which is also what media.list returns by default); testSuiteId attaches it to a feature or user story (for example a design mock or a spec). Linked ids are not checked, so take them from the matching list tool. Size: keep it small, ideally a few MB. Base64 makes the payload about a third bigger than the file, the HTTP connection rejects requests over 100 MB, and uploads count toward the workspace storage allowance (refused on the Basic plan; 1 GB total on Gold, 5 GB on Platinum), failing with "Plan exhausted" when over. Returns {success, message, data: {id, path (public URL), type, size, testCaseId, testRunId, testSuiteId, ...}, uri}.

Ask your agent

You don’t call media.upload_url yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:

  • “Attach this screenshot of the broken checkout page to the checkout test”
  • “Save the screen recording as evidence for the last test run”
  • “Upload the PRD for the search feature to Test Maze”

Inputs

NameTypeDescription
base64
required
stringThe file contents as plain base64 text, with no "data:image/png;base64," prefix (a prefix corrupts the file). Example start of a PNG: "iVBORw0KGgoAAAANSUhEUg...".
mimetype
required
stringMIME type of the file; also sets its file extension. Examples: "image/png", "image/jpeg", "image/gif", "video/webm", "application/pdf", "text/markdown", "application/json".
testCaseId
optional
stringAttach to this test case: its internal id from case.list (not the human caseId like TC-0001).
testRunId
optional
stringMark as evidence from this test run: the id from testrun.list. Pair with testCaseId for per-case evidence.
testSuiteId
optional
stringAttach to this feature, user story or suite: the id from feature.list.

The MCP call

What the agent’s MCP client sends (placeholders in angle brackets):

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "media.upload_url",
    "arguments": {
      "base64": "<base64>",
      "mimetype": "<mimetype>"
    }
  }
}

Connect your agent

npx -y @testmaze/mcp init tmt_xxx
claude mcp add tm --scope project -- npx -y @testmaze/mcp

Create the token in your Test Maze workspace under Settings → MCP. Setup for Cursor, Cline, Gemini CLI and Codex CLI is shown there too.