Skip to main content
POST
/
buckets
/
{id}
/
objects
Upload to bucket
curl --request POST \
  --url https://nulldrop.xyz/api/v2/buckets/{id}/objects \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form 'key=<string>'
{
  "object": {
    "id": "<string>",
    "filename": "<string>",
    "originalName": "<string>",
    "size": 123,
    "mimeType": "<string>",
    "downloadUrl": "<string>",
    "shareUrl": "<string>",
    "isPublic": true,
    "downloadCount": 123,
    "uploadedAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z"
  }
}
The Upload operation adds a new object to a bucket. You can optionally specify a key to define the exact destination path.

CMD / cURL Usage

When uploading from the command line, ensure you use the correct syntax for the file parameter.
You must use the @ prefix for the file path in curl to send the file content instead of its name.Correct: -F "file=@demo.zip"
Incorrect: -F "file=demo.zip"

Request Body

ParameterRequireDescription
fileYesBinary file to upload.
keyNoDestination path (including file name). If omitted, the local filename is used.

Success Response

Upon successful upload, the API returns the created object’s metadata, including its unique ID, filename, size, and MIME type.

Authorizations

Authorization
string
header
required

API key authentication (format: nd_xxxxx)

Path Parameters

id
string
required

Bucket ID

Body

multipart/form-data
file
file
required

File to upload

key
string

Optional custom key (path)

Response

201 - application/json

Uploaded

object
object