Skip to content

POST /jobs/templates/

Description

Create a new template to save and reuse certain preconfigured job settings.

Authentication

  • Required: Yes
  • Method: Bearer token

Headers

  • Authorization: Bearer [AUTH_TOKEN]
  • Content-Type: application/json

Parameters

Query Parameters

  • access_token: string (Required) OAuth 2.0 API access token.
  • format: string (Optional) Values: json, xml Overrides the Request Accept header.
  • human: boolean (Optional) Values: true, false If set to true, the response will be in a structured, more human-readable form. Useful when calling the API through curl or a browser.
  • show_null: boolean** (Optional) *Values*: true, false** If set to true, the response will contain also keys that are not set to a value.
  • expand_all: boolean** (Optional) *Values*: true, false** Recursively look up referenced objects (e.g. preset id) and embed the respective JSON as a nested object directly into the response.

Request Body

  • template:name: string (Required) Name of the new template.
  • template:description: `string** (Optional) A longer description about the purpose of the template.
  • template:job_settings: object** (Required) The actual job settings to be stored as a template. The schema matches that of the Jobs resource with the exception that the input.input_nameandunique_custom_key** keys are not valid and cannot be set for a template.

Example Request

bash
curl -X POST -H "Authorization: Bearer AUTH_TOKEN" -H "Content-Type: application/json" -d '{
    "template": {
        "name": "My Test Template",
        "job_settings": {
            "input": {"start_time": 0},
            "autograph": { "watermark_strength": "light" },
            "user_data" : "My Personal Marker",
            "output_prefix": "{job_id}/",
            "outputs": [
                {
                    "output_name": "{input_name}",
                    "thumbnails": [ { "thumbnail_names": "thumb_{resolution}", "thumbnail_preset": "thumbnails_small" } ],
                    "logos": [
                        {
                            "logo_image": "https://s3-us-east-1.amazonaws.com/my_logo_pngs/logo30.png",
                            "logo_preset": "logo_30_bottom_right"
                        }
                    ],
                    "settings": { "video": { "height": "100%", "width": "100%", "bitrate": "90%" } },
                    "preset": { "id": "5e2834a2c35f386a1327c958" }
                }
            ],
            "pipeline": { "id": "5eb43241e4b0463cfe034c1f" }
        }
    }
}' "https://api.xvid.com/v1/jobs/templates/?access_token=YOUR_ACCESS_TOKEN&human=true&show_null=true"