files
Upload files
Upload one or more files to a specified bucket. Supports batch uploading with optional custom metadata for each file. If uploading multiple files, either provide metadata for all files or none.
post/files
Request
- Base URLhttps://{subdomain}.storage.{region}.nhost.run/v1
- URLhttps://{subdomain}.storage.{region}.nhost.run/v1/files
- AuthHTTP bearer
Request body multipart/form-data
Example request
{
"bucket-id": "user-uploads",
"metadata[]": [
{
"id": "custom-id-123",
"name": "custom-filename.png",
"metadata": {
"alt": "Custom image",
"category": "document"
}
}
]
}Response
Files successfully uploaded
Example response
{
"processedFiles": [
{
"id": "d5e76ceb-77a2-4153-b7da-1f7c115b2ff2",
"name": "profile-picture.jpg",
"size": 245678,
"bucketId": "users-bucket",
"etag": "\"a1b2c3d4e5f6\"",
"createdAt": "2023-01-15T12:34:56Z",
"updatedAt": "2023-01-16T09:45:32Z",
"isUploaded": true,
"mimeType": "image/jpeg",
"uploadedByUserId": "abc123def456",
"metadata": {
"alt": "Profile picture",
"category": "avatar"
}
}
]
}Changes
No recorded changes to this operation across all 7 revisions of this API.