---
title: "Run template"
method: POST
path: "/v1/templates/{templateId}/run"
tags: ["Templates"]
---

# Run template

`POST /v1/templates/{templateId}/run`

Run a default template or custom template by ID to generate an AI output. See our guide on Using Templates for tips on getting started.

## Path parameters

- `templateId` string, required

## Request body

- CompleteTemplateRequest
  - `inputs` CompleteTemplateInputs, required
    - `knowledgeIds` string[] — A list of knowledge items to use when generating content. Up to 3 knowledge items are allowed.
    - `toneId` string — Tone to use when running the template
    - `styleId` string — Style to use when running the template
    - `audienceId` string — The primary audience ID to use when running the template.
    - `additionalAudienceIds` string[] — Additional audience IDs to include alongside the primary `audienceId` when running the template.
    - `retrievalAddOn` 'webScraper' | 'webSearch' — The add-on to use to further enhance your generation with information that lives outside of Jasper. You can further customize the behavior of the add-on with the associated parameter in the options portion of your request body.
  - `options` RequestOptionsDto
    - `outputCount` number — Number of outputs to generate.
    - `outputLanguage` 'English' | 'French' | 'Spanish' | 'Italian' | 'Portuguese' | 'German' — The language in which outputs should be returned.
    - `inputLanguage` 'English' | 'French' | 'Spanish' | 'Italian' | 'Portuguese' | 'German' — The language in which inputs will be given.
    - `languageFormality` 'default' | 'more' | 'less' — The formality of the outputs, for the languages where formality applies.
    - `webScraper` WebScraperOptions
      - `urls` string[] — An optional list of URLs for Jasper to scrape during generation to use as context. Max of 3 per request. If nothing is provided, Jasper will automatically detect URLs in the request inputs to use as context for the generation.
    - `webSearch` WebSearchOptions
      - `siteBlockList` string[] — An optional list of domains for Jasper to omit from the search results. For example, providing mycompetor.com will filter out results returned with that domain and it’s subdomains, such as blog.mycompetitor.com. If nothing is provided, all search results will be used for the generation.
      - `searchQuery` string — A query to override the default behavior for how Jasper searches the web. If nothing is provided, Jasper will automatically define an appropriate query based on the inputs supplied.
      - `maxResults` 1 | 2 | 3 | 4 | 5 — The number of search results to use for additional context when generating a response

## Response `200`

Generate outputs for a specific template

- CompleteTemplateResponse
  - `requestId` string
  - `resource` string
  - `data` GeneratedText[]
    - `text` string
    - `id` string

## Other responses

- `400` — Bad Request. May need to check that the request body corresponds with the input schema for the template you are trying to complete.
- `404` — Not found. May be due to an incorrect URL path.
- `500` — Internal server error. Unable to generate outputs for specified template.

---

[API](https://skmtc.net/jasper/apis/jasper-api.md) · [All operations](https://skmtc.net/jasper/apis/jasper-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jasper/jasper-api/revisions/438914d9525e/schema)
