Retrieve task

August 8, 2024

Table of contents

  1. Request Headers
  2. Path parameter
  3. Responses
  4. Model
  5. Examples
  6. Try It

Use this endpoint to retrieve status and results of

https://api.useapi.net/v1/runwayml/tasks/taskId

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Path parameter
  • taskId is required. Specify the taskId you want to retrieve.
Responses
  • 200 OK

    {
        "taskId": "user:user_id-runwayml:account_email-task:task_uuid"
        "id": "<task uuid>",
        "name": "Gen-3 Alpha 123456, Slow motion zoom in, cat chasing dog in the kitchen",
        "image": null,
        "createdAt": "2024-08-01T01:02:03.456Z",
        "updatedAt": "2024-08-01T01:02:03.456Z",
        "taskType": "gen3a",
        "options": {
          "name": "Gen-3 Alpha 123456789, Slow motion zoom in, cat chasing dog in the kitchen",
          "seconds": 5,
          "text_prompt": "Slow motion zoom in",
          "seed": 123456789,
          "exploreMode": true,
          "watermark": false,
          "enhance_prompt": false,
          "init_image": "<asset image url>",
          "resolution": "720p",
          "assetGroupName": "Generative Video",
          "recordingEnabled": true
        },
        "status": "SUCCEEDED",
        "error": null,
        "progressText": null,
        "progressRatio": "1",
        "estimatedTimeToStartSeconds": null,
        "artifacts": [
          {
            "assetId": "user:user_id-runwayml:account_email-asset:asset_uuid",
            "id": "<asset uuid>",
            "createdAt": "2024-08-01T01:02:03.456Z",
            "updatedAt": "2024-08-01T01:02:03.456Z",
            "userId": 1234567,
            "createdBy": 1234567,
            "taskId": "user:user_id-runwayml:account_email-task:task_uuid",
            "parentAssetGroupId": "<group uuid>",
            "filename": "Gen-3 Alpha 123456789, Slow motion zoom in, cat chasing dog in the kitchen",
            "url": "<asset url>",
            "fileSize": "12345678",
            "isDirectory": false,
            "previewUrls": ["<asset preview url>"],
            "private": true,
            "privateInTeam": true,
            "deleted": false,
            "reported": false,
            "metadata": {
              "frameRate": 24,
              "duration": 5.209,
              "dimensions": [
                1280,
                768
              ],
              "size": {
                "width": 1280,
                "height": 768
              }
            },
            "favorite": false        
          }
        ],
        "sharedAsset": null    
    }
    
  • 400 Bad Request

    {
        "error": "<Error message>",
        "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

    {
        "error": "Not found.",
        "code": 404
    }
    
Model
{ // TypeScript, all fields are optional
  taskId: string,
  id: string,
  name: string,
  image: string,
  createdAt: string,
  updatedAt: string,
  taskType: string,
  options: {
    name: string,
    seconds: number,
    gen2Options: {
      mode: string,
      text_prompt: string,
      seed: number,
      interpolate: boolean,
      upscale: boolean,
      watermark: boolean,
      motion_score: number,
      use_motion_score: boolean,
      use_motion_vectors: boolean,
      style: string,
      width: number,
      height: number,
      motion_vector: {
        x: number,
        y: number,
        r: number,
        z: number,
        bg_x_pan: number,
        bg_y_pan: number
      },
      init_video: string,
      image_prompt: string,
      init_image: string,
      keyframes: { image: string, timestamp: number }[],
      extended_from_task_id: string
    },
    gen_audio_options: {
      name: string,
      text: string,
      voice_id: string,
      model_id: string
    },
    paid_user_watermark_override: boolean,
    recordingEnabled: boolean,
    exploreMode: boolean,
    assetGroupName: string,
    image: string,
    video: string,
    image_asset_id: string,
    video_asset_id: string,
    audio: string,
    audio_asset_id: string,
    watermark: boolean,
    text_prompt: string,
    seed: number,
    image_as_end_frame: boolean,
    init_video: string,
    extended_from_task_id: string,
    video_prompt: string,
    flip: boolean,
    width: number,
    height: number,    
    structure_transformation: number
  },
  status: string,
  error: {
    errorMessage: string,
    reason: string,
    message: string,
    moderation_category: string,
    tally_asimov: boolean
  },
  progressText: string,
  progressRatio: string,
  estimatedTimeToStartSeconds: number,
  assetId: string,
  sharedAsset: any,
  artifacts: {
    taskId: string,
    id: string,
    createdAt: string,
    updatedAt: string,
    userId: number,
    createdBy: number,
    parentAssetGroupId: string,
    filename: string,
    url: string,
    fileSize: string,
    isDirectory: boolean,
    previewUrls: string[],
    private: boolean,
    privateInTeam: boolean,
    deleted: boolean,
    reported: boolean,
    metadata: {
      frameRate: number,
      duration: number,
      dimensions: [number, number],
      size: {
        width: number,
        height: number
      }
    },
    favorite: boolean,
  }
}
Examples
  • curl "https://api.useapi.net/v1/runwayml/tasks/taskId" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const taskId = "taskId to retrieve"; 
    const apiUrl = `https://api.useapi.net/v1/runwayml/tasks/${taskId}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    taskId = "taskId to retrieve"
    apiUrl = f"https://api.useapi.net/v1/runwayml/tasks/{taskId}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It