Documentation
Start sending a large file
POST
/v1/drops/uploadsDropsOne request carries at most 100 MB. Larger files, up to 5 GB on the plan that allows it, go up in parts: start an upload with the file's size, send each part of part_bytes (67.1 MB; the last one is the rest) in any order and as often as one needs retrying, then finish it. An upload counts as one of the day's files and its size against your storage until it is finished or cancelled, and one not finished within a day is cancelled. Send name and bytes; ending, title and expires_at work as in Share a file.
Request body
JSON, sent with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | required | |
bytes | integer | required | |
type | string | optional | The file's content type, a hint only. |
ending | string | optional | |
title | string | optional | |
expires_at | string | optional | When the link stops working (ISO 8601). |
Example request
curl -s -X POST "https://snip.link/v1/drops/uploads" \
-H "Authorization: Bearer $SNIP_KEY" \
-H "Content-Type: application/json" \
-d '{}'Example response
{
"size": "1.2 GB",
"status": "open"
}Response fields
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
type | string | |
bytes | integer | |
size | string | |
part_bytes | integer | Every part's size but the last. |
parts | integer | How many parts the file goes up in, numbered from 1. |
received | integer[] | Part numbers stored so far. |
status | open | finishing | done | |
expires_at | string | When an unfinished upload is cancelled. |
link_id | string, null | The file's link, once finished. |
Errors
| Status | Meaning |
|---|---|
| 400 | The body or query is invalid. details names each field. |
| 401 | The API key is missing, malformed or revoked. |
| 403 | The plan does not include this. details.upgrade names the plan that does. |
| 413 | The input is larger than the plan allows per run. details carries the size, the limit and the unit. |
| 429 | Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason). |