/v1/files endpoint you can upload JSON files that can be used as context in your API requests. This allows you to provide structured data to enhance your scrapes, answers, and other operations.
- Upload JSON files up to 200MB
- Files are automatically validated for proper JSON format
- Use files as context in scrapes, answers, and other endpoints
- Files expire after 30 days
- Secure pre-signed URL upload process
Quick reference for AI agents
Quick reference for AI agents
- Endpoint:
POST https://api.olostep.com/v1/files(auth:Authorization: Bearer <YOUR_API_KEY>) - Required:
filename - Common options:
purpose(contextdefault, orbatch) - Returns:
id,upload_url(pre-signed),expires_in - Flow:
PUTthe JSON file (up to 200MB) toupload_url, thenPOST /v1/files/{file_id}/completeto validate it; the file’sstatusbecomescompleted - Get results later:
GET /v1/files/{file_id}(metadata) ·GET /v1/files/{file_id}/content(download_url) ·GET /v1/files(list) ·DELETE /v1/files/{file_id}
Installation
Upload a file
The file upload process consists of two steps:- Create upload URL: Request a pre-signed URL for uploading your file
- Complete upload: Upload your file to the pre-signed URL, then call the complete endpoint to validate and finalize
Step 1: Create upload URL
First, create an upload URL by providing the filename and optional purpose. Thepurpose parameter supports only two values: "context" (default) or "batch".
upload_url that expires in 10 minutes:
Step 2: Upload file and complete
Upload your JSON file to the pre-signed URL, then call the complete endpoint to validate and finalize the upload.Retrieve file metadata by ID
Retrieve metadata for a file by its ID.Retrieve file object by ID
Get a pre-signed URL to download the JSON content of a completed file. Optionally specify the expiration time for the download URL using theexpires_in query parameter (defaults to 600 seconds / 10 minutes).
download_url that expires after the specified time:
List files
List all completed files for your team. Optionally filter by purpose (supported values:"context" or "batch").
Delete a file
Delete a file and its associated data from storage.Complete upload example (context purpose)
Here’s a complete example that uploads a JSON file withpurpose="context":
Upload batch file example
Here’s an example that uploads a JSON file withpurpose="batch" containing valid batch data that can be used with the /v1/batches endpoint:
/v1/batches endpoint format:
items: Array of objects withcustom_idandurlfieldsparser: Optional parser configurationcountry: Optional country code
File requirements
- File format: Only JSON files are supported (
.jsonextension required) - File size: Maximum 200MB per file
- Expiration: Files expire after 30 days
- Upload URL: Pre-signed URLs expire after 10 minutes
- Purpose parameter: Only supports
"context"or"batch"values (defaults to"context")