{ "error": { "code": "INVALID_REQUEST", "message": "The request was malformed" }}
{ "error": { "code": "INTERNAL_ERROR", "message": "An unexpected error occurred while processing the request" }}
Overview
Retrieve a paginated list of all jobs associated with your API client. This endpoint returns jobs in descending order by creation date (newest first), allowing you to monitor all asynchronous processing tasks such as video transcriptions, summaries, renders, and template creations.
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
GET https://api.pictory.ai/pictoryapis/v1/jobs
Request Parameters
Headers
string
required
API key for authentication (starts with pictai_)
Authorization: YOUR_API_KEY
Query Parameters
string
Base64-encoded pagination token returned from a previous request. Use this to retrieve the next page of results. If not provided, the first page of results will be returned.Example:"eyJsYXN0RXZhbHVhdGVkS2V5Ijp7fX0="
Response
Returns a paginated list of job objects in the items array. Each job includes its unique job_id, current status, and job-specific data including transcripts, highlights, render results, or error information. If more results are available, a nextPageKey is included for pagination.
array of objects
required
Array of job objects, ordered by creation date in descending order (newest first)
Show job object
boolean
required
Indicates whether the job completed successfully. True if the job is in-progress or completed successfully, false if it failed or encountered an error.
object
required
Contains the job-specific data including status, progress, results, or error information. The exact structure depends on the job type and current state.
array of objects
Array of transcript segments with speaker identification and word-level timing (for transcription jobs)
array of objects
Array of highlight segments extracted from the transcript (for summary/highlight jobs)
string
Current status of the job (e.g., “processing”, “completed”, “failed”)
string
The unique identifier (UUID) of the job
object
Error information if the job failed
string
Error message describing what went wrong
string
Error code for programmatic handling
string | null
required
Base64-encoded pagination token to retrieve the next page of results. If null, there are no more pages available. Pass this value as the nextPageKey query parameter in the next request to fetch additional results.
<?php// Replace 'YOUR_API_KEY' with your actual API keyfunction getJobs($apiKey, $nextPageKey = null) { $url = 'https://api.pictory.ai/pictoryapis/v1/jobs'; if ($nextPageKey) { $url .= '?nextPageKey=' . urlencode($nextPageKey); } $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: ' . $apiKey, 'accept: application/json' ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode !== 200) { throw new Exception('Request failed with status ' . $httpCode); } return json_decode($response, true);}// Usagetry { $data = getJobs('YOUR_API_KEY'); echo "Total jobs on this page: " . count($data['items']) . "\n\n"; // Display job information foreach ($data['items'] as $job) { echo "Job Status: " . ($job['success'] ? 'Success' : 'Failed') . "\n"; if (isset($job['data']['jobId'])) { echo " Job ID: " . $job['data']['jobId'] . "\n"; } if (isset($job['data']['status'])) { echo " Status: " . $job['data']['status'] . "\n"; } echo "---\n"; } // Check for more pages if ($data['nextPageKey']) { echo "More results available. Fetching next page...\n"; $nextPage = getJobs('YOUR_API_KEY', $data['nextPageKey']); echo "Next page has " . count($nextPage['items']) . " jobs.\n"; }} catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n";}?>
// Replace "YOUR_API_KEY" with your actual API keypackage mainimport ( "encoding/json" "fmt" "io" "net/http" "net/url")type JobData struct { JobID string `json:"jobId,omitempty"` Status string `json:"status,omitempty"` Transcript []map[string]interface{} `json:"transcript,omitempty"` Highlight []map[string]interface{} `json:"highlight,omitempty"` Error *ErrorInfo `json:"error,omitempty"`}type ErrorInfo struct { Message string `json:"message"` Code string `json:"code"`}type Job struct { Success bool `json:"success"` Data JobData `json:"data"`}type JobsResponse struct { Items []Job `json:"items"` NextPageKey *string `json:"nextPageKey"`}func getJobs(apiKey string, nextPageKey *string) (*JobsResponse, error) { baseURL := "https://api.pictory.ai/pictoryapis/v1/jobs" if nextPageKey != nil && *nextPageKey != "" { params := url.Values{} params.Add("nextPageKey", *nextPageKey) baseURL += "?" + params.Encode() } req, err := http.NewRequest("GET", baseURL, nil) if err != nil { return nil, err } req.Header.Set("Authorization", apiKey) req.Header.Set("accept", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("request failed (status %d): %s", resp.StatusCode, string(body)) } var result JobsResponse if err := json.Unmarshal(body, &result); err != nil { return nil, err } return &result, nil}// Usagefunc main() { data, err := getJobs("YOUR_API_KEY", nil) if err != nil { panic(err) } fmt.Printf("Total jobs on this page: %d\n\n", len(data.Items)) // Display job information for _, job := range data.Items { status := "Success" if !job.Success { status = "Failed" } fmt.Printf("Job Status: %s\n", status) if job.Data.JobID != "" { fmt.Printf(" Job ID: %s\n", job.Data.JobID) } if job.Data.Status != "" { fmt.Printf(" Status: %s\n", job.Data.Status) } fmt.Println("---") } // Check for more pages if data.NextPageKey != nil && *data.NextPageKey != "" { fmt.Printf("More results available. Next page key: %s\n", *data.NextPageKey) }}
Usage Notes
Jobs are returned in reverse chronological order by creation date, with the most recently created jobs appearing first.
Pagination: When you have many jobs, use the nextPageKey value from the response to retrieve subsequent pages. Pass the nextPageKey as a query parameter in your next request.
Job Types: Jobs can represent various async operations including video transcriptions, summaries/highlights, project renders, and template creations. The data structure varies based on the job type.
Rate Limiting: Be mindful of API rate limits when polling for job status. Consider implementing exponential backoff or using webhooks for job completion notifications.
Common Use Cases
1. List All Recent Jobs
Retrieve and display all recent jobs:
import requestsurl = "https://api.pictory.ai/pictoryapis/v1/jobs"headers = { "Authorization": "YOUR_API_KEY", "accept": "application/json"}response = requests.get(url, headers=headers)data = response.json()print(f"Total jobs: {len(data['items'])}\n")for job in data['items']: print(f"Job Status: {'Success' if job['success'] else 'Failed'}") if 'jobId' in job.get('data', {}): print(f" Job ID: {job['data']['jobId']}") if 'status' in job.get('data', {}): print(f" Status: {job['data']['status']}") # Check for errors if not job['success'] and 'error' in job.get('data', {}): print(f" Error: {job['data']['error'].get('message', 'Unknown error')}") print("---")
2. Paginate Through All Jobs
Fetch all jobs across multiple pages:
import requestsdef fetch_all_jobs(api_key): url = "https://api.pictory.ai/pictoryapis/v1/jobs" headers = { "Authorization": api_key, "accept": "application/json" } all_jobs = [] next_page_key = None while True: # Add pagination parameter if we have a next page key params = {"nextPageKey": next_page_key} if next_page_key else {} response = requests.get(url, headers=headers, params=params) data = response.json() # Add jobs from this page all_jobs.extend(data.get('items', [])) # Check if there are more pages next_page_key = data.get('nextPageKey') if not next_page_key: break return all_jobs# Usageall_jobs = fetch_all_jobs("YOUR_API_KEY")print(f"Total jobs across all pages: {len(all_jobs)}")# Count by statuscompleted = sum(1 for job in all_jobs if job['success'])failed = len(all_jobs) - completedprint(f"Completed: {completed}, Failed: {failed}")
3. Monitor Job Status
Check the status of specific job types:
import requestsurl = "https://api.pictory.ai/pictoryapis/v1/jobs"headers = { "Authorization": "YOUR_API_KEY", "accept": "application/json"}response = requests.get(url, headers=headers)data = response.json()# Filter transcription jobstranscription_jobs = [ job for job in data['items'] if 'transcript' in job.get('data', {})]print(f"Transcription jobs found: {len(transcription_jobs)}")for job in transcription_jobs: job_id = job.get('data', {}).get('jobId', 'Unknown') status = job.get('data', {}).get('status', 'Unknown') success = job.get('success', False) print(f"Job ID: {job_id}") print(f" Status: {status}") print(f" Success: {success}") if 'transcript' in job.get('data', {}): transcript_segments = len(job['data']['transcript']) print(f" Transcript Segments: {transcript_segments}") print("---")