# Get a one-time link to upload a file from your computer

> Eto API reference for `POST /api/v1/uploads/link`. Base URL `https://eto.tools/api/v1/`. Authenticate with the `X-Eto-API-Key` header.

Part of the [Eto API reference](https://eto.tools/dev/docs/). The full reference in one file is at [llms-full.txt](https://eto.tools/dev/docs/llms-full.txt); the machine-readable schema is at [openapi.json](https://eto.tools/dev/docs/openapi.json).

## POST /api/v1/uploads/link

Get a one-time link to upload a file from your computer

- Operation ID: `file_upload_url`
- Slug: `file-upload-url`
- Category: Listing Builder
- Authentication: API key only. Reads or writes data Eto holds for your own account.
- HTML: https://eto.tools/dev/docs/#ep-file-upload-url
- Markdown: https://eto.tools/dev/docs/listing-builder/file-upload-url.md

For a file on your own computer, when multipart is awkward (AI agents, the MCP, scripts). Returns a one-time upload_url and a ready curl command. PUT the raw file to upload_url (no API key needed: the link is the credential, it works once, for 15 minutes):

    curl -sS -T ./guide.pdf "<upload_url>"

The PUT answers with an eto-upload:// url. Pass it as digital_files[].url (with "name") to POST /api/v1/listings/create, or as "url" to POST /api/v1/shops/{shop_id}/listings/{listing_id}/files. Eto keeps digital files it uploads to Etsy, so copying the listing to another store includes them.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | body | `string` | yes | The file name with its extension, e.g. "guide.pdf". Buyers see this name. Constraints: max 200 chars. |
| `type` | body | `string` | no | What the file is for. Default: `digital`. One of: `digital`, `image`, `video`. |

### Request

```bash
curl -X POST -H "X-Eto-API-Key: eto_your_key" -H "Content-Type: application/json" \
  -d '{"name": "guide.pdf"}' "https://eto.tools/api/v1/uploads/link"

# then, from the folder with the file:
curl -sS -T ./guide.pdf "https://eto.tools/api/v1/uploads/put/<token>"
```

```python
import requests

url = "https://eto.tools/api/v1/uploads/link"
headers = {"X-Eto-API-Key": "eto_your_key"}
payload = {
    "name": "guide.pdf"
}

response = requests.post(url, headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())
```

```javascript
const url = "https://eto.tools/api/v1/uploads/link";
const payload = {
  "name": "guide.pdf"
};

const response = await fetch(url, {
  method: "POST",
  body: JSON.stringify(payload),
  headers: {
    "X-Eto-API-Key": "eto_your_key",
    "Content-Type": "application/json",
  },
});
if (!response.ok) throw new Error(`Eto API ${response.status}`);
const data = await response.json();
```

### Response

```json
{
  "upload_url": "https://eto.tools/api/v1/uploads/put/<token>",
  "method": "PUT",
  "name": "guide.pdf",
  "expires_in": 900,
  "max_bytes": 104857600,
  "curl": "curl -sS -T 'PATH_TO_FILE' 'https://eto.tools/api/v1/uploads/put/<token>'"
}

# The PUT answers:
{"url": "eto-upload://users/42/temp/9f2c...pdf", "filename": "guide.pdf", "size": 492991,
 "content_type": "application/pdf", "type": "digital"}
```

### Errors

Failures answer with the shared error body described in the Errors section: `{"error": {"code", "status", "message", "hint", "docs"}}`. Branch on `code`, not on the message.
