---
title: "Upload a test-case attachment file"
method: POST
path: "/v1/apps/upload-test-file"
tags: ["apps"]
---

# Upload a test-case attachment file

`POST /v1/apps/upload-test-file`

Upload a supported test asset that can be attached to test cases via
    `file_attachments` or legacy `file_ids`.

    Supported formats: PDF, CSV, JSON, XML, TXT, PNG, JPG/JPEG, GIF, MP4, MP3.
    Uploaded rows are persisted in `test_files` with `file_kind = 'test'`.

## Headers

- `x-api-key` string

## Response `200`

Test file uploaded successfully

- UploadResponse — Response after successful file upload
  - `success` boolean, required — Whether upload succeeded
  - `file` FileMetadata, required — File metadata after upload
    - `id` string, nullable — Unique file record ID — pass as app_file_id on subsequent run submissions
    - `file_path` string, required — Storage path of uploaded file
    - `filename` string, required — Generated filename
    - `original_name` string, required — Original uploaded filename
    - `file_size` integer, required — File size in bytes
    - `file_type` string, nullable, required — MIME type
    - `app_name` string, nullable, required — Application name
    - `version` string, nullable, required — Application version
    - `os` string, nullable, required — Operating system
    - `package_name` string, nullable, required — Package name (Android) or bundle ID (iOS)
    - `user_id` string, required — User ID who uploaded the file
    - `organization_id` string, required — Organization ID

## Other responses

- `400` — Unsupported test file type
- `401` — Invalid or missing API key
- `422` — Validation Error
- `500` — Failed to upload to storage or persist metadata

---

[API](https://skmtc.dev/qualgent/apis/qualgent-api-service.md) · [All operations](https://skmtc.dev/qualgent/apis/qualgent-api-service/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qualgent/qualgent-api-service/revisions/2372ed4904a6/schema)
