The Files API allows you to upload, list, retrieve, and delete files in your Get Pronto account. All file operations require authentication using your API key.
Upload a new file to your account. The API accepts multipart/form-data uploads.
POST /upload
Parameter | Type | Description |
---|---|---|
file | File | The file to upload |
customFilename | String | Optional. Custom filename for the uploaded file |
curl https://api.getpronto.io/v1/upload \
-H "ApiKey: YOUR_API_KEY" \
-F "file=@/path/to/image.jpg" \
-F "customFilename=custom-name.jpg"
{
"message": "File uploaded successfully",
"file": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "custom-name.jpg",
"mimetype": "image/jpeg",
"size": 1024000,
"createdAt": "2024-03-28T12:00:00Z",
"url": "https://api.getpronto.io/v1/file/custom-name.jpg"
}
}
Retrieve a paginated list of files in your account.
GET /files
Parameter | Type | Description |
---|---|---|
page | Integer | Page number (default: 1) |
pageSize | Integer | Items per page (default: 20, max: 100) |
curl https://api.getpronto.io/v1/files?page=1&pageSize=20 \
-H "ApiKey: YOUR_API_KEY"
{
"files": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "image.jpg",
"mimetype": "image/jpeg",
"size": 1024000,
"createdAt": "2024-03-28T12:00:00Z",
"url": "https://api.getpronto.io/v1/file/image.jpg"
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"totalCount": 135,
"totalPages": 7
}
}
Retrieve metadata for a specific file by its ID.
GET /files/:id
Parameter | Type | Description |
---|---|---|
id | String | The unique identifier of the file |
curl https://api.getpronto.io/v1/files/123e4567-e89b-12d3-a456-426614174000 \
-H "ApiKey: YOUR_API_KEY"
{
"file": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "image.jpg",
"mimetype": "image/jpeg",
"size": 1024000,
"createdAt": "2024-03-28T12:00:00Z",
"url": "https://api.getpronto.io/v1/file/image.jpg"
}
}
Permanently delete a file from your account.
DELETE /files/:id
Parameter | Type | Description |
---|---|---|
id | String | The unique identifier of the file to delete |
curl -X DELETE https://api.getpronto.io/v1/files/123e4567-e89b-12d3-a456-426614174000 \
-H "ApiKey: YOUR_API_KEY"
{
"message": "File deleted successfully"
}
The file object contains the following properties:
Parameter | Type | Description |
---|---|---|
id | String | Unique identifier for the file |
filename | String | Name of the file |
mimetype | String | MIME type of the file |
size | Number | Size of the file in bytes |
createdAt | String | ISO 8601 timestamp of when the file was created |
url | String | Direct URL to access the file |
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "image.jpg",
"mimetype": "image/jpeg",
"size": 1024000,
"createdAt": "2024-03-28T12:00:00Z",
"url": "https://api.getpronto.io/v1/file/image.jpg"
}
Continue exploring our documentation with these related topics: