---
title: "Prepare Upload (using Project Key)"
method: POST
path: "/api/v0/upload"
tags: ["Upload"]
---

# Prepare Upload (using Project Key)

`POST /api/v0/upload`

## Request

- Base URL: `https://files.memfault.com`
- URL: `https://files.memfault.com/api/v0/upload`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

Prepare a file upload to `files.memfault.com`. This is **step 1** of a two-step upload flow.

Returns a signed `upload_url` and an opaque `token`. Use the `upload_url` to PUT the file
directly, then use the `token` in the corresponding Commit endpoint.

---

#### Request Body

| Field | Type | Description |
|:------|:-----|:------------|
| `kind` | String | **Required.** One of: `COREDUMP`, `ANDROID_BUG_REPORT`, `MAR` |
| `device` | Object | **Required.** DeviceTraits object (see below) |
| `size` | Integer | **Required.** File size in bytes |

**DeviceTraits:**

| Field | Type | Description |
|:------|:-----|:------------|
| `device_serial` | String | **Required.** Device serial number |
| `hardware_version` | String | **Required.** Hardware version |
| `software_version` | String | **Required.** Software version |
| `software_type` | String | Software type |

---

#### Return Value

Returns `{ "data": { "upload_url": "...", "token": "..." } }`

## Headers

- `Memfault-Project-Key` string, required
- `Content-Type` string, required

## Response `200`

- object

---

[API](https://skmtc.dev/memfault/apis/memfault-api-documentation.md) - [All operations](https://skmtc.dev/memfault/apis/memfault-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/memfault/apis/memfault-api-documentation/revisions/8037a30996a2?raw)
