Documentation

Get Job

Retrieve a VideoShorts job with the Swiftia API

VideoShorts - Get Job

This endpoint retrieves the status and results of a VideoShorts job. The response format depends on the authentication method used.

Endpoint

GET /api/jobs/{jobId}

Path Parameters

  • jobId (string, required): The unique identifier of the job, obtained from the id field in the Create Job response.

Authentication

This endpoint supports two authentication methods:

  • Bearer Token: Include your JWT token in the Authorization header. Returns a detailed response format with full job information.

Response Format (API Key Authentication)

When using API key authentication, the response is simplified and optimized for API consumption.

Response (In Progress)

{
  "id": "YOUR_JOB_ID",
  "title": "My Video Analysis Job",
  "cost": null,
  "costBreakDown": null,
  "status": "PROCESSING",
  "source": "API",
  "progress": 30
}

Response (Completed)

{
  "id": "YOUR_JOB_ID",
  "title": "My Video Analysis Job",
  "cost": 0.93,
  "costBreakDown": {
    "shortGen": 0.205,
    "youtubeProcessing": 0.72
  },
  "status": "COMPLETED",
  "source": "API",
  "progress": 100,
  "data": {
    "shorts": [
      {
        "id": "short_id_1",
        "content": "Auto-generated Short 1",
        "text": "Transcription of the short segment",
        "startTime": 10.5,
        "endTime": 70.3
      },
      {
        "id": "short_id_2",
        "content": "Auto-generated Short 2",
        "text": "Transcription of the short segment",
        "startTime": 120.0,
        "endTime": 180.5
      }
    ]
  }
}

API Key Response Fields

FieldTypeDescription
idstringUnique job identifier
titlestring | nullJob title or name
costnumber | nullCost of the job in credits (only present when status is COMPLETED)
costBreakDownobject | nullDetailed breakdown of costs by service
statusstring | nullCurrent job status (PROCESSING, COMPLETED, FAILED, etc.)
sourcestring | nullSource of the job (API or WEB_APP)
progressnumberProgress percentage (0-100) indicating the current processing stage. Progress values: 5% (initiating services), 15% (downloading video), 30% (transcribing), 60% (generating shorts), 80% (getting active speaker detection), 100% (completed)
dataobject | undefinedObject containing shorts array (only present when status is COMPLETED)
data.shortsarrayArray of shorts

Short Object Fields (in data.shorts array)

FieldTypeDescription
idstringUnique identifier for the short
contentstringTitle or content text of the short
textstringTranscribed text of the short segment
startTimenumberStart time of the short in seconds
endTimenumberEnd time of the short in seconds

Response Format (Session-Based Authentication)

When using bearer token authentication, the response includes detailed job information.

Response (In Progress)

{
  "jobId": "YOUR_JOB_ID",
  "status": "PROCESSING",
  "createdAt": "2024-12-06T12:34:56Z"
}

Response (Completed - AI-Generated Shorts)

{
  "jobId": "YOUR_JOB_ID",
  "status": "COMPLETED",
  "createdAt": "2024-12-06T12:34:56Z",
  "cost": 0.41,
  "data": {
    "transcription": { /* ... transcription data */ },
    "shorts": [
      {
        "id": 1,
        "title": "Auto-generated short title",
        "reason": "Reason for selecting this segment",
        "startId": 6,
        "endId": 13,
        "startTime": 28.66,
        "endTime": 58.86,
        "text": "Transcription of the short segment",
        "cropFileUrl": "URL to the cropped video file"
      }
    ]
  }
}

Response (Completed - User-Defined Shorts)

{
  "jobId": "YOUR_JOB_ID",
  "status": "COMPLETED",
  "createdAt": "2024-12-06T12:34:56Z",
  "cost": 0.41,
  "data": {
    "transcription": { /* ... transcription data */ },
    "shorts": [
      {
        "id": 1,
        "title": "User-defined short title",
        "startId": null,
        "endId": null,
        "startTime": 5.0,
        "endTime": 30.0,
        "text": "Transcription of the short segment",
        "cropFileUrl": "URL to the cropped video file"
      }
    ]
  }
}

Session-Based Response Parameters

  • jobId (string): The unique job identifier.
  • status (string): PROCESSING, COMPLETED, or FAILED.
  • createdAt (string): Job creation timestamp.
  • cost (number): The cost of the job (only present when status is COMPLETED).
  • data (object): Contains the results of the job (only present when status is COMPLETED).
    • transcription (object): The transcription data for the video.
    • shorts (array): An array of generated shorts. Each short object has the following properties:
      • id (number): An identifier for the short.
      • title (string): The title of the short.
      • reason (string, only for AI-generated shorts): The reason why the AI selected this segment.
      • startId (number, only for AI-generated shorts): Start index in the transcription.
      • endId (number, only for AI-generated shorts): End index in the transcription.
      • startTime (number): Start time of the short in seconds.
      • endTime (number): End time of the short in seconds.
      • text (string): The transcribed text of the short segment.
      • cropFileUrl (string): The URL of the cropped video file.