> ## Documentation Index
> Fetch the complete documentation index at: https://docs.berri.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Template

> You can use this to spin up apps for your users with the same configuration

### Query

<ParamField body="app_config" type="string">
  Create a configuration for your app. This is a JSON dictionary.
</ParamField>

### Response

<ResponseField name="template_id" type="string">
  The app configuration you sent is now stored as a template. This is it's
  unique id. Use it to automatically spin up chatGPT apps with that exact
  configuration.
</ResponseField>

<ResponseField name="app_config" type="dictionary">
  We return back the app config you sent. This is to confirm the parameters that
  were sent. We also add a score for the prompt (the lower the better), if one
  was submitted.
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl -X POST \
    https://api.berri.ai/create_template \
    -H 'Content-Type: multipart/form-data' \
    -F 'app_config={"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}'
  ```

  ```javascript javascript theme={null}
  let endpoint = `https://api.berri.ai/create_template`;
  app_config = {
    advanced: { intent: "qa_doc", search: "default" },
    prompt: "Be legal and ethical",
    output_length: "256",
  };
  var formdata = new FormData();
  formdata.append("app_config", app_config);
  var requestOptions = {
    method: "POST",
    body: formdata,
    redirect: "follow",
  };
  fetch(endpoint, requestOptions).then((response) => response.json());
  ```

  ```python python theme={null}
  import requests
  import json
  url = "https://api.berri.ai/create_template"

  data = {"advanced": {"intent": "qa_doc", "search": "default"}, "prompt": "Be legal and ethical", "output_length": "256"}

  response = requests.post(url, data={"app_config": json.dumps(data)})

  print(response.text)
  ```
</RequestExample>
