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)

Parameters ​

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 Templates (GET /jobs/templates/) ​

  • start: int (Optional)
    Offset for paging. Default value: 0.
  • limit: int (Optional)
    Number of template 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".
  • pipeline.id: string (Optional)
    Filters results to only templates matching the provided pipeline id.

Example Request for Listing Multiple Templates ​

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

Example Response for Listing Multiple Templates ​

Success (200 OK) ​

json
{
  "templates": [
    {
      "name": "Test_Template",
      "job_settings": {
        "pipeline": {
          "id": "547f3eede4b025bcbff38657",
          "href": "https://api.xvid.com/v1/pipelines/547f3eede4b025bcbff38657"
        },
        "output_prefix": "{job_id}/",
        "outputs": [
          {
            "preset": {
              "id": "55415999d4556242e65b9712",
              "href": "https://api.xvid.com/v1/presets/55415999d4556242e65b9712"
            },
            "output_name": "1/{input_name}",
            "settings": {
              "video": {
                "width": "1080",
                "bitrate": "50%"
              }
            }
          },
          {
            "preset": {
              "id": "55415999d4556242e65b9712",
              "href": "https://api.xvid.com/v1/presets/55415999d4556242e65b9712"
            },
            "output_name": "2/{input_name}",
            "settings": {
              "video": {
                "width": "1080",
                "bitrate": "50%"
              }
            }
          }
        ]
      },
      "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": "Some description",
      "job_settings": {
        "pipeline": {
          "id": "5729b681e4b0f7dbdc2ca6ec",
          "href": "https://api.xvid.com/v1/pipelines/5729b681e4b0f7dbdc2ca6ec"
        },
        "output_prefix": "{job_id/}",
        "outputs": [
          {
            "preset": {
              "id": "52a6bbdfa2ca79055aaa787f",
              "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
            },
            "output_name": "{input_name}",
            "thumbnails": [
              {
                "thumbnail_names": "thumb",
                "thumbnail_preset": "thumbnails_big"
              }
            ],
            "settings": {
              "video": {
                "height": "10%",
                "width": "30%"
              }
            }
          },
          {
            "preset": {
              "id": "52a6bbdfa2ca79055aaa787f",
              "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
            },
            "output_name": "out",
            "settings": {
              "video": {
                "height": "70%",
                "width": "70%"
              }
            }
          }
        ]
      },
      "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&sort=created_at"
  },
  "last": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=2&limit=2&human=true&sort=created_at"
  },
  "next": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=2&limit=2&human=true&sort=created_at"
  },
  "prev": {
    "href": "https://api.xvid.com/v1/jobs/templates/?start=0&limit=2&human=true&sort=created_at"
  }
}

Example Request for Fetching a Specific Template ​

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

Example Response for Fetching a Specific Template ​

Success (200 OK) ​

json
{
  "template": {
    "name": "test_template2",
    "description": "Some description",
    "job_settings": {
      "pipeline": {
        "id": "5729b681e4b0f7dbdc2ca6ec",
        "href": "https://api.xvid.com/v1/pipelines/5729b681e4b0f7dbdc2ca6ec"
      },
      "output_prefix": "{job_id}/",
      "outputs": [
        {
          "preset": {
            "id": "52a6bbdfa2ca79055aaa787f",
            "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
          },
          "output_name": "{input_name}",
          "thumbnails": [
            {
              "thumbnail_names": "thumb",
              "thumbnail_preset": "thumbnails_big"
            }
          ],
          "settings": {
            "video": {
              "height": "10%",
              "width": "30%"
            }
          }
        },
        {
          "preset": {
            "id": "52a6bbdfa2ca79055aaa787f",
            "href": "https://api.xvid.com/v1/presets/52a6bbdfa2ca79055aaa787f"
          },
          "output_name": "out",
          "settings": {
            "video": {
              "height": "70%",
              "width": "70%"
            }
          }
        }
      ]
    },
    "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": "0x0050001",
    "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"
  }
}