Uploads API
The Uploads API allows you to upload, retrieve, and manage files within the GridLogs platform. Files uploaded through this API can be referenced in other GridLogs resources, such as documents and analysis requests.
Upload Public File
POST /v1/files/upload/public
Uploads a file to public storage, making it accessible without authentication.
Request
This endpoint accepts multipart/form-data
with a file part named file
.
Response
Indicates if the upload was successful
The key of the uploaded file in storage
The public URL to access the file
The original name of the file
The MIME type of the file
The size of the file in bytes
Examples
curl -X POST https://api.gridlogs.co/v1/files/upload/public \
-H "X-API-Key: your_api_key_here" \
-F "file=@/path/to/your/file.pdf"
Example Response
{
"success": true,
"fileKey": "public/1234567890/file.pdf",
"url": "https://storage.gridlogs.co/public/1234567890/file.pdf",
"fileName": "file.pdf",
"contentType": "application/pdf",
"size": 1245678
}
Upload Private File
POST /v1/files/upload/private
Uploads a file to private storage, requiring authentication to access.
Request
This endpoint accepts multipart/form-data
with a file part named file
.
Response
Indicates if the upload was successful
The key of the uploaded file in storage
The original name of the file
The MIME type of the file
The size of the file in bytes
Examples
curl -X POST https://api.gridlogs.co/v1/files/upload/private \
-H "X-API-Key: your_api_key_here" \
-F "file=@/path/to/your/file.pdf"
Example Response
{
"success": true,
"fileKey": "private/1234567890/file.pdf",
"fileName": "file.pdf",
"contentType": "application/pdf",
"size": 1245678
}
Get Signed URL
Generates a time-limited signed URL to access a private file.
Query Parameters
The key of the private file in storage
Response
Indicates if the signed URL was successfully generated
The signed URL to access the file
When the signed URL expires
Examples
curl -X GET "https://api.gridlogs.co/v1/files/signed-url?key=private/1234567890/file.pdf" \
-H "X-API-Key: your_api_key_here"
Example Response
{
"success": true,
"url": "https://storage.gridlogs.co/private/1234567890/file.pdf?signature=abc123&expires=1679900000",
"expires": "2023-03-27T12:00:00Z"
}
Delete File
Deletes a file from storage.
Path Parameters
The key of the file to delete
Response
Indicates if the file was successfully deleted
A message confirming the deletion
Examples
curl -X DELETE https://api.gridlogs.co/v1/files/private/1234567890/file.pdf \
-H "X-API-Key: your_api_key_here"
Example Response
{
"success": true,
"message": "File deleted successfully"
}
Responses are generated using AI and may contain mistakes.