---
title: "Apply an automation template"
method: POST
path: "/api/v3/analysis/{analysis_id}:apply-template"
tags: ["Analysis"]
---

# Apply an automation template

`POST /api/v3/analysis/{analysis_id}:apply-template`

## Request

- Base URL: `https://{tenant_name}.benchling.com`
- URL: `https://{tenant_name}.benchling.com/api/v3/analysis/{analysis_id}:apply-template`
- Auth: HTTP bearer

Apply a published automation template to an Analysis. Populates the Analysis with the template's pipeline steps, substituting the provided data frame and config variable bindings. The Analysis then runs asynchronously. The template must be published before it can be applied. Returns an async task link that can be polled for completion.

## Path parameters

- `analysis_id` string, required

## Headers

- `EARLY-ACCESS` string

## Request body

- ApplyAutomationTemplateInput
  - `dataFrameVariableBindings` AutomationTemplateDataFrameVariableBindingInput[], required: Bindings that map the template's data frame variables (see AutomationTemplateDataFrameVariable) to actual data frames. Each binding specifies which data frame to substitute for a template variable.
    - `columnMapping` object: Optional mapping of template column names to actual DataFrame column names. Keys are template column system names; values are the corresponding column system names in the provided DataFrame.
    - `dataFrameId` string, required: ID of the DataFrame to substitute for this variable.
    - `sourceStepDataId` string, required: ID of an existing output AutomationStepData in the target Analysis whose raw data contains the DataFrame identified by dataFrameId.
    - `variableId` string, required: ID of the AutomationTemplateDataFrameVariable to bind.
  - `templateId` string, required: ID of the published automation template to apply.
  - `templateVariableBindings` AutomationTemplateVariableBindingInput[]: Bindings that provide values for the template's config variables (see AutomationTemplateVariable). Every config variable on the template must have a value specified; use a null variableValue to leave a variable empty.
    - `variableId` string, required: ID of the AutomationTemplateVariable to bind.
    - `variableValue` unknown, required

## Response `202`

Task started

- AsyncTaskLink
  - `pollingUri` string, uri
  - `taskId` string

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/benchling/apis/benchling-api.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api/revisions/c9f087b98b8b?raw)
