Skip to content

GET /jobs/templates/[ID]

Description

Get information about templates. Supports fetching all templates or a specific template by ID.

Authentication

  • Required: Yes
  • Method: Bearer token

Request Headers

  • Authorization: Bearer [AUTH_TOKEN]
  • Accept:
    • application/json (for JSON responses)
    • application/xml (for XML responses)

Query Parameters

Common Parameters (for both GET /jobs/templates/ and GET /jobs/templates/ID)

  • format: string (Optional)
    Values: json, xml
    Overrides the Accept header if provided.
  • human: boolean (Optional)
    Values: true, false
    Causes the response to be in a structured, more human-readable form.
  • show_null: boolean (Optional)
    Values: true, false
    If set to "true", the response will contain keys that are not set to a value.
  • expand_all: boolean (Optional)
    Values: true, false
    Recursively look up referenced objects and embed the respective JSON as nested objects directly into the response.
  • expand: string (Optional)
    Comma separated referenced objects (e.g. codec, user). Looks up objects referenced by ids and embed the respective JSON as nested objects directly into the response.

Parameters for Fetching Multiple Jobs (GET /jobs/templates/)

  • start: int (Optional)
    Offset for paging. Default value: 0.
  • limit: int (Optional)
    Number of preset items per page. Default value: 1000 (max: 5000).
  • sort: string (Optional)
    Values: Any valid key name
    Sorts the output along the given key name. For example, use created_at to sort the results by the creation date.
  • direction: string (Optional)
    Values: 1, -1
    Sort records in ascending ("1") or descending ("-1") order. Default value: "1".

Example Request for Listing Multiple Templates

bash
curl -H "Authorization: Bearer AUTH_TOKEN" "https://api.xvid.com/v1/jobs/templates/?human=true&show_null=true&sort=created_at&limit=2"

Example Response for Listing Multiple Templates

Success (200 OK)

json
{
  "templates": [
    {
      "name": "Test_Template",
      "description": null,
      "job_settings": {
        "pipeline": {
          "id": "547f3eede4b025bcbff38657",
          "href": "https://api.xvid.com/v1/pipelines/547f3eede4b025bcbff38657"
        },
        "user_data": null,
        "input": null,
        "autograph": null,
        "output_prefix": "{job_id}/",
        "playlists": null,
        "outputs": [
          {
            "preset": {
              "id": "55415999d4556242e65b9712",
              "href": "https://api.xvid.com/v1/presets/55415999d4556242e65b9712"
            },
            "output_name": "1/{input_name}",
            "percentage_completed": null,
            "thumbnails": null,
            "logos": null,
            "settings": {
              "max_duration": null,
              "http_streaming": null,
              "video": {
                "rotate": null,
                "height": null,
                "width": "1080",
                "framerate": null,
                "bitrate": "50%",
                "aspect_ratio": null
              },
              "audio": null
            }
          },
          {
            "preset": {
              "id": "55415999d4556242e65b9712",
              "href": "https://api.xvid.com/v1/presets/55415999d4556242e65b9712"
            },
            "output_name": "2/{input_name}",
            "percentage_completed": null,
            "thumbnails": null,
            "logos": null,
            "settings": {
              "max_duration": null,
              "http_streaming": null,
              "video": {
                "rotate": null,
                "height": null,
                "width": "1080",
                "framerate": null,
                "bitrate": "50%",
                "aspect_ratio": null
              },
              "audio": null
            }
          }
        ],
        "error_code": null,
        "version": null,
        "user": null,
        "created_at": null,
        "updated_at": null,
      },
      "version": 1,
      "user": {
        "id": "547f3eede4b025bcbff38655",
        "href": "https://api.xvid.com/v1/users/547f3eede4b025bcbff38655"
      },
      "created_at": 1685456220714,
      "updated_at": 1686057940659,
      "id": "6476055c7761b534f5b20581",
      "href": "https://api.xvid.com/v1/jobs/templates/6476055c7761b534f5b20581"
    },
    {
      "name": "test_template2",
      "description": null,
      "job_settings": {
        "pipeline": {
          "id": "5729b681e4b0f7dbdc2ca6ec",
          "href": "https://api.xvid.com/v1/pipelines/5729b681e4b0f7dbdc2ca6ec"
        },
        "user_data": null,
        "input": null,
        "autograph": null,
        "output_prefix": "{job_id/}",
        "playlists": null,
        "outputs": [
          {
            "preset": {
              "id": "52a6bbdfa2ca79055aaa787f",
              "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
            },
            "output_name": "{input_name}",
            "percentage_completed": null,
            "thumbnails": [
              {
                "thumbnail_names": "thumb",
                "thumbnail_preset": "thumbnails_big"
              }
            ],
            "logos": null,
            "settings": {
              "max_duration": null,
              "http_streaming": null,
              "video": {
                "rotate": null,
                "height": "10%",
                "width": "30%",
                "framerate": null,
                "bitrate": null,
                "aspect_ratio": null
              },
              "audio": null
            }
          },
          {
            "preset": {
              "id": "52a6bbdfa2ca79055aaa787f",
              "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
            },
            "output_name": "out",
            "percentage_completed": null,
            "thumbnails": null,
            "logos": null,
            "settings": {
              "max_duration": null,
              "http_streaming": null,
              "video": {
                "rotate": null,
                "height": "70%",
                "width": "70%",
                "framerate": null,
                "bitrate": null,
                "aspect_ratio": null
              },
              "audio": null
            }
          }
        ],
        "error_code": null,
        "version": null,
        "user": null,
        "created_at": null,
        "updated_at": null,
      },
      "version": 1,
      "user": {
        "id": "547f3eede4b025bcbff38655",
        "href": "https://api.xvid.com/v1/users/547f3eede4b025bcbff38655"
      },
      "created_at": 1685619174848,
      "updated_at": 1685619481071,
      "id": "647881e64713be300a761715",
      "href": "https://api.xvid.com/v1/jobs/templates/647881e64713be300a761715"
    }
  ],
  "total": 3,
  "start": 0,
  "limit": 2,
  "first": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=0&limit=2&human=true&show_null=true&sort=created_at"
  },
  "last": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=2&limit=2&human=true&show_null=true&sort=created_at"
  },
  "next": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=2&limit=2&human=true&show_null=true&sort=created_at"
  },
  "prev": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=0&limit=2&human=true&show_null=true&sort=created_at"
  }
}

Example Request for Fetching a Specific Template

bash
curl -H "Authorization: Bearer AUTH_TOKEN" "https://api.xvid.com/v1/jobs/templates/5d2f7c35e4b004f9cd197877?human=true&show_null=true"

Example Response for Fetching a Specific Template

Success (200 OK)

json
{
  "template": {
    "name": "test_template2",
    "description": null,
    "job_settings": {
      "pipeline": {
        "id": "5729b681e4b0f7dbdc2ca6ec",
        "href": "https://api.xvid.com/v1/pipelines/5729b681e4b0f7dbdc2ca6ec"
      },
      "user_data": null,
      "input": null,
      "autograph": null,
      "output_prefix": "{job_id/}",
      "playlists": null,
      "outputs": [
        {
          "preset": {
            "id": "52a6bbdfa2ca79055aaa787f",
            "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
          },
          "output_name": "{input_name}",
          "percentage_completed": null,
          "thumbnails": [
            {
              "thumbnail_names": "thumb",
              "thumbnail_preset": "thumbnails_big"
            }
          ],
          "logos": null,
          "settings": {
            "max_duration": null,
            "http_streaming": null,
            "video": {
              "rotate": null,
              "height": "10%",
              "width": "30%",
              "framerate": null,
              "bitrate": null,
              "aspect_ratio": null
            },
            "audio": null
          }
        },
        {
          "preset": {
            "id": "52a6bbdfa2ca79055aaa787f",
            "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
          },
          "output_name": "out",
          "percentage_completed": null,
          "thumbnails": null,
          "logos": null,
          "settings": {
            "max_duration": null,
            "http_streaming": null,
            "video": {
              "rotate": null,
              "height": "70%",
              "width": "70%",
              "framerate": null,
              "bitrate": null,
              "aspect_ratio": null
            },
            "audio": null
          }
        }
      ],
      "error_code": null,
      "version": null,
      "user": null,
      "created_at": null,
      "updated_at": null,
    },
    "version": 1,
    "user": {
      "id": "547f3eede4b025bcbff38655",
      "href": "https://api.xvid.com/v1/users/547f3eede4b025bcbff38655"
    },
    "created_at": 1685619174848,
    "updated_at": 1685619481071,
    "id": "647881e64713be300a761715",
    "href": "https://api.xvid.com/v1/jobs/templates/647881e64713be300a761715"
  }
}

Error Responses

400 Bad Request

json
{
  "error": {
    "error_code": "0050001",
    "error_message": "Invalid Input"
  }
}

403 Forbidden

json
{
  "error": {
    "error_code": "0x0000003",
    "error_message": "Invalid access token"
  }
}

404 Not Found

json
{
  "error": {
    "error_code": "0x0400001",
    "error_message": "Template does not exist"
  }
}

500 Internal Server Error

json
{
  "error": {
    "error_code": "0x0000001",
    "error_message": "Internal Error"
  }
}