Clean Job
Pictory Jobs
Clean Job
Remove job data and associated resources for a completed job
DELETE
Clean Job
Overview
Remove all job data and associated resources for a specific completed job. This operation permanently deletes all files generated by the job including video outputs, audio files, thumbnails, subtitle files (SRT, VTT, TXT), share URLs, preview URLs, and any uploaded input files. Use this endpoint to free up storage space and remove sensitive data after you have downloaded or processed the job results. This operation is only available for jobs that have completed (successfully or failed) and is irreversible.You need a valid API key to use this endpoint. Get your API key from the API Access page in your Pictory dashboard.
API Endpoint
Request Parameters
Path Parameters
The unique identifier (UUID) of the job to clean up. This is returned when the job was initially created.Example:
"17684c46-9d14-44ed-8830-ff839713ef8b"Headers
API key for authentication (starts with
pictai_)Response
Returns a simple success indicator confirming the job and all associated resources have been cleaned.Indicates whether the cleanup operation was successful. True if the job was successfully cleaned up, false otherwise.
Response Examples
Code Examples
Usage Notes
Job State Requirement: Jobs can only be cleaned after they have completed (either successfully or failed). You cannot clean jobs that are still processing.
Idempotent Operation: Calling this endpoint multiple times with the same job ID is safe. Subsequent calls will return success even if the job was already cleaned.
Common Use Cases
1. Clean Job After Downloading Results
Download results and then clean up:2. Batch Clean Multiple Completed Jobs
Clean multiple jobs at once:3. Clean Old Completed Jobs
Automatically clean jobs older than a certain age:4. Clean with Confirmation
Require user confirmation before cleaning:5. Conditional Cleanup Based on Job Type
Clean jobs based on type and retention policy:What Gets Deleted
When you clean a job, the following data and resources are permanently removed:| Resource Type | Description |
|---|---|
| Video Outputs | All rendered video files in various formats and resolutions |
| Audio Files | Generated audio tracks, voiceovers, and audio exports |
| Thumbnails | Preview images and video thumbnails |
| Subtitle Files | SRT, VTT, and TXT subtitle/caption files |
| Transcript Data | Word-level transcript with timing information |
| Highlight Data | AI-generated highlight segments and summaries |
| Share URLs | Public sharing links and preview URLs |
| Preview URLs | Temporary preview and playback URLs |
| Input Files | Uploaded source files (videos, audio, images) |
| Project Data | Intermediate processing files and temporary data |
Best Practices
- Download Before Cleaning: Always download and backup any needed outputs before cleaning a job.
- Verify Job Completion: Ensure the job has completed (successfully or failed) before attempting to clean. Processing jobs cannot be cleaned.
- Archive Important Results: For jobs with important results, save the full job data (transcript, highlights, outputs) to your own storage before cleaning.
- Automate Cleanup: Implement automated cleanup policies to regularly clean old jobs and manage storage costs.
- Handle Errors Gracefully: Jobs may already be cleaned or deleted. Handle 404 errors appropriately.
- Use Batch Operations: When cleaning multiple jobs, use parallel requests with reasonable rate limiting.
- Implement Retention Policies: Define clear policies for how long different types of jobs should be retained.
- Log Cleanup Operations: Maintain logs of cleaned jobs for audit and recovery purposes.
- Confirm Critical Operations: For interactive applications, require user confirmation before cleaning jobs.
- Check Storage Limits: Monitor your account’s storage usage and clean jobs proactively to avoid reaching limits.
Error Handling
Common errors and how to handle them:| Error | Cause | Solution |
|---|---|---|
INVALID_STATE | Job is still processing | Wait for job to complete before cleaning |
NOT_FOUND | Job does not exist or already cleaned | This is safe to ignore in cleanup scripts |
UNAUTHORIZED | Invalid or expired API key | Verify your API key is valid |
INTERNAL_ERROR | Server-side error | Retry with exponential backoff |
