---
id: start-variant
title: "Start Variant"
description: "Start a variant of an app."
sidebar_label: "Start Variant"
hide_title: true
hide_table_of_contents: true
api: eJztVktzIjcQ/isqnaDKAceV05zCGletK5vYxcMXTFFipgGtZ6SJpCEm1Pz3dEsaGGDxVva8HGxp1P31+5P23Im15cmMvwgjhXKWz294BjY1snRSK57wsRPGMcG2QYLpFROKibLsvapXNTBrm7wqhr8osJAZ61hnugmbbIA9DknD4aoBcJpZwuwFNZGSIdaJHgz8NirHM9Qoway0KRjtWlgdj9SNUKC2CzyxrPPkvRf5bKjTNzAPaovwdn7DdDyIBlBDGq0KQCyPuczBkj2pvkLqfSVzAYWlWjkhFZgeG8JKVLnzsn9pBdED6/QbqIUFa31Q47C4bxQvHGgkr0APoQSV2c4WjFztGtxOt+uTPwJXGdXkfzp6DJjT0Zcm5z49kDX5ClpCIk5U+jyZPD+8p+C9SthjUMPqHj1iqVBKO7Y8wPX4DddYEUFKjxk2iT9YRCt4WgojCnBgqLn2XOEGpY4dgiKSmqsUboNrA39X0gAiOVPBDbfpBgrBkz13uxI8vpFqjZJOupw+xG5haL2u5wEBrPuksx2pnQNSMFhjOsLYcpl61/tfLbX4vmWvNBSYk2C9bBqG4Pr3c/9AVQXN03gyGE1wP548PdNMnfkduvyBhOv6pkHRS2q6k3zMGlvXMHhNRkPfe9fU7mnlk/4R6EGjBXsyKgh7QFBVnvN6/v8dpWosTlujrgnGgC21siGZd7e39O+Mdao0xWZfVTkbRWH+w2WsjPyol6Z4/L3gCKIVGc5aDOW3u7tL719ELjPvG3swRpsfdz0DHMKcVtJBYS8Fcp2enF7UP4bbqqdET9ZgqKSHoIUxYtfKyRcdHKT2Kuz6o/T9iXUSa+AHsOuiPhlsQqffSzjFFUxHuZMBaNIbsns9jGFI37eMNSLEgBeAobbIYBtN9FZWgdSQrBLej71s+/sjodV4bsFsG8arDBaNb5wrbdLvp7mush4mCSm1J2RflJKf37MDf8ruSZQTpVlIsevczuMNnh//gN1nEBkWLpnN2wJj6p3QDadih0KgPfyMJiMRDyoMzMh/Q4kjF2+CFgVOXTk6MurDuyjKHE6Zr1lFqjujodbap1KqlfYOxazHaD8J5BxF1wFlLuDd9n7t3V5LT1RgGGgcKvSDgJvIvBgenRbgkHqi6MJPFHcgit+PB+Rlqa0rhGrhhdfPy+FiO3Fqf5zqn8+kn8+kbz2T4gA6eHf9MkdBGhTfm/vIJ7PmWWRRPGk9kXDCN9iPJLHfL4WFqcnrmj7jYBqiBVw21fAkkUlLa2SslcgtfNCtnVGk2i675mRDHYp4Yyvyina4fEMiOXnK+Wtk0zDTPgrcB1u/eLI/AlzcfXQvBY1BSvn9UHbe4uTnKb2vlvHBV+iMVIz4h+4R/Ot9DV3kCcl/w+tSqHVFt1XCAyT9/gNdXX4v
sidebar_class_name: "put api-method"
info_path: reference/api/agenta-backend
custom_edit_url: null
---

import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Markdown from "@theme/Markdown";
import Heading from "@theme/Heading";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Start Variant"}
>
</Heading>

<MethodEndpoint
  method={"put"}
  path={"/variants/{variant_id}"}
>
  
</MethodEndpoint>



Start a variant of an app.

Args:
    variant_id (str): The ID of the variant to start.
    action (VariantAction): The action to perform on the variant (start).
    env_vars (Optional[DockerEnvVars], optional): The environment variables to inject to the Docker container. Defaults to None.
    stoken_session (SessionContainer, optional): The session container. Defaults to Depends(verify_session()).

Returns:
    URI: The URL of the started variant.

Raises:
    HTTPException: If the app container cannot be started.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<details
  style={{"marginBottom":"1rem"}}
  className={"openapi-markdown__details"}
  data-collapsed={false}
  open={true}
>
  <summary
    style={{}}
  >
    <h3
      className={"openapi-markdown__details-summary-header-params"}
    >
      Path Parameters
    </h3>
  </summary><div>
    <ul>
      <ParamsItem
        className={"paramsItem"}
        param={{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","title":"Variant Id"}}}
      >
        
      </ParamsItem>
    </ul>
  </div>
</details><MimeTabs
  className={"openapi-tabs__mime"}
>
  <TabItem
    label={"application/json"}
    value={"application/json-schema"}
  >
    <details
      style={{}}
      className={"openapi-markdown__details mime"}
      data-collapsed={false}
      open={true}
    >
      <summary
        style={{}}
        className={"openapi-markdown__details-summary-mime"}
      >
        <h3
          className={"openapi-markdown__details-summary-header-body"}
        >
          Body
        </h3><strong
          className={"openapi-schema__required"}
        >
          required
        </strong>
      </summary><div
        style={{"textAlign":"left","marginLeft":"1rem"}}
      >
        
      </div><ul
        style={{"marginLeft":"1rem"}}
      >
        <SchemaItem
          collapsible={true}
          className={"schemaItem"}
        >
          <details
            style={{}}
            className={"openapi-markdown__details"}
          >
            <summary
              style={{}}
            >
              <span
                className={"openapi-schema__container"}
              >
                <strong
                  className={"openapi-schema__property"}
                >
                  action
                </strong><span
                  className={"openapi-schema__name"}
                >
                   object
                </span><span
                  className={"openapi-schema__divider"}
                >
                  
                </span><span
                  className={"openapi-schema__required"}
                >
                  required
                </span>
              </span>
            </summary><div
              style={{"marginLeft":"1rem"}}
            >
              <SchemaItem
                collapsible={false}
                name={"action"}
                required={true}
                schemaName={"VariantActionEnum (string)"}
                qualifierMessage={"**Possible values:** [`START`, `STOP`]"}
                schema={{"type":"string","enum":["START","STOP"],"title":"VariantActionEnum"}}
              >
                
              </SchemaItem>
            </div>
          </details>
        </SchemaItem><SchemaItem
          collapsible={true}
          className={"schemaItem"}
        >
          <details
            style={{}}
            className={"openapi-markdown__details"}
          >
            <summary
              style={{}}
            >
              <strong>
                env_vars
              </strong><span
                style={{"opacity":"0.6"}}
              >
                 object
              </span>
            </summary><div
              style={{"marginLeft":"1rem"}}
            >
              
            </div><div>
              <span
                className={"badge badge--info"}
              >
                anyOf
              </span><SchemaTabs>
                <TabItem
                  label={"DockerEnvVars"}
                  value={"0-item-properties"}
                >
                  <SchemaItem
                    collapsible={true}
                    className={"schemaItem"}
                  >
                    <details
                      style={{}}
                      className={"openapi-markdown__details"}
                    >
                      <summary
                        style={{}}
                      >
                        <span
                          className={"openapi-schema__container"}
                        >
                          <strong
                            className={"openapi-schema__property"}
                          >
                            env_vars
                          </strong><span
                            className={"openapi-schema__name"}
                          >
                             object
                          </span><span
                            className={"openapi-schema__divider"}
                          >
                            
                          </span><span
                            className={"openapi-schema__required"}
                          >
                            required
                          </span>
                        </span>
                      </summary><div
                        style={{"marginLeft":"1rem"}}
                      >
                        <SchemaItem
                          name={"property name*"}
                          required={false}
                          schemaName={"string"}
                          qualifierMessage={undefined}
                          schema={{"type":"string"}}
                          collapsible={false}
                          discriminator={false}
                        >
                          
                        </SchemaItem>
                      </div>
                    </details>
                  </SchemaItem>
                </TabItem>
              </SchemaTabs>
            </div>
          </details>
        </SchemaItem>
      </ul>
    </details>
  </TabItem>
</MimeTabs><div>
  <div>
    <ApiTabs
      label={undefined}
      id={undefined}
    >
      <TabItem
        label={"200"}
        value={"200"}
      >
        <div>
          
          
          Successful Response
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={false}
                        name={"uri"}
                        required={true}
                        schemaName={"Uri (string)"}
                        qualifierMessage={undefined}
                        schema={{"type":"string","title":"Uri"}}
                      >
                        
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"uri\": \"string\"\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem><TabItem
        label={"422"}
        value={"422"}
      >
        <div>
          
          
          Validation Error
          
          
        </div><div>
          <MimeTabs
            className={"openapi-tabs__mime"}
            schemaType={"response"}
          >
            <TabItem
              label={"application/json"}
              value={"application/json"}
            >
              <SchemaTabs
                className={"openapi-tabs__schema"}
              >
                <TabItem
                  label={"Schema"}
                  value={"Schema"}
                >
                  <details
                    style={{}}
                    className={"openapi-markdown__details response"}
                    data-collapsed={false}
                    open={true}
                  >
                    <summary
                      style={{}}
                      className={"openapi-markdown__details-summary-response"}
                    >
                      <strong>
                        Schema
                      </strong>
                    </summary><div
                      style={{"textAlign":"left","marginLeft":"1rem"}}
                    >
                      
                    </div><ul
                      style={{"marginLeft":"1rem"}}
                    >
                      <SchemaItem
                        collapsible={true}
                        className={"schemaItem"}
                      >
                        <details
                          style={{}}
                          className={"openapi-markdown__details"}
                        >
                          <summary
                            style={{}}
                          >
                            <span
                              className={"openapi-schema__container"}
                            >
                              <strong
                                className={"openapi-schema__property"}
                              >
                                detail
                              </strong><span
                                className={"openapi-schema__name"}
                              >
                                 object[]
                              </span>
                            </span>
                          </summary><div
                            style={{"marginLeft":"1rem"}}
                          >
                            <li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                              >
                                Array [
                              </div>
                            </li><SchemaItem
                              collapsible={true}
                              className={"schemaItem"}
                            >
                              <details
                                style={{}}
                                className={"openapi-markdown__details"}
                              >
                                <summary
                                  style={{}}
                                >
                                  <span
                                    className={"openapi-schema__container"}
                                  >
                                    <strong
                                      className={"openapi-schema__property"}
                                    >
                                      loc
                                    </strong><span
                                      className={"openapi-schema__name"}
                                    >
                                       object[]
                                    </span><span
                                      className={"openapi-schema__divider"}
                                    >
                                      
                                    </span><span
                                      className={"openapi-schema__required"}
                                    >
                                      required
                                    </span>
                                  </span>
                                </summary><div
                                  style={{"marginLeft":"1rem"}}
                                >
                                  <li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}
                                    >
                                      Array [
                                    </div>
                                  </li><div>
                                    <span
                                      className={"badge badge--info"}
                                    >
                                      anyOf
                                    </span><SchemaTabs>
                                      <TabItem
                                        label={"MOD1"}
                                        value={"0-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          string
                                          
                                          
                                        </div>
                                      </TabItem><TabItem
                                        label={"MOD2"}
                                        value={"1-item-properties"}
                                      >
                                        <div
                                          style={{"marginTop":".5rem","marginBottom":".5rem"}}
                                        >
                                          
                                          
                                          integer
                                          
                                          
                                        </div>
                                      </TabItem>
                                    </SchemaTabs>
                                  </div><li>
                                    <div
                                      style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                                    >
                                      ]
                                    </div>
                                  </li>
                                </div>
                              </details>
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"msg"}
                              required={true}
                              schemaName={"Message (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Message"}}
                            >
                              
                            </SchemaItem><SchemaItem
                              collapsible={false}
                              name={"type"}
                              required={true}
                              schemaName={"Error Type (string)"}
                              qualifierMessage={undefined}
                              schema={{"type":"string","title":"Error Type"}}
                            >
                              
                            </SchemaItem><li>
                              <div
                                style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}
                              >
                                ]
                              </div>
                            </li>
                          </div>
                        </details>
                      </SchemaItem>
                    </ul>
                  </details>
                </TabItem><TabItem
                  label={"Example (from schema)"}
                  value={"Example (from schema)"}
                >
                  <ResponseSamples
                    responseExample={"{\n  \"detail\": [\n    {\n      \"loc\": [\n        \"string\",\n        0\n      ],\n      \"msg\": \"string\",\n      \"type\": \"string\"\n    }\n  ]\n}"}
                    language={"json"}
                  >
                    
                  </ResponseSamples>
                </TabItem>
              </SchemaTabs>
            </TabItem>
          </MimeTabs>
        </div>
      </TabItem>
    </ApiTabs>
  </div>
</div>
      