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

# Tag Replacement

> Use our API to replace text, images, tables, and charts.

View the [Video Explanation](https://drive.google.com/file/d/1TB7rnsslgqeZ2SUh4WOrTNByVvnC-dfR/view?usp=sharing)

There are 2 simple steps:

<Steps>
  <Step title="Configure your document with placeholders" />

  <Step title="Use the API to generate your document" />
</Steps>

# Configure Your FlashDocs Document

Tag replacement works best with *template* documents because, before you make the deck generation request, you will already have knowledge of which placeholders will be in the deck. You can then specify the values for the placeholders via the `text_placeholder_manual_insertions` parameter.

If you want to make dynamically sized decks, you can use a *library* source document, and specify the slide ids in the *outline* parameter. If you store the text placeholders and the index of the slide for each slide id, you can similarly specify the values for the placeholders via the `text_placeholder_manual_insertions` parameter.

This page describes how to configure a document:

<Card title="Configure FlashDocs Document" icon="gear" href="https://docs.flashdocs.com/configure-dashboard">
  Use FlashDocs's dashboard to configure your template/library.
</Card>

# Generate Your Deck via the API

You have 3 options when generating a deck.
A. Manually specify the values for all placeholders.
B. Manually specify the values for some placeholders and have FlashDocs generate the values for the rest.
C. Have FlashDocs generate the values for the placeholders based on the prompt.

## Manually specify values for placeholders

In the generate deck request ([Generate Slides Synchronous](https://docs.flashdocs.com/api-reference/generate/generate-slides) or [Generate Slides Asynchronous](https://docs.flashdocs.com/api-reference/generate/generate-slides-via-task-async)), you can use the `text_placeholder_manual_insertions` parameter to map a text placeholder to its value.

This parameter supports markdown! This means that you can insert bullet points, section headers, etc. for a placeholder and we render it natively in Google Slides & PowerPoint.

### Identifying Placeholders

To find all of the text placeholders in your deck:
Use this endpoint with `include_slides=true`: [Get Document Full Data](https://docs.flashdocs.com/api-reference/flashadocs-documents/get-document-full-data). For each slide in `document.slides`, you can find a list of the text placeholders: `document.slides[i].text_placeholders`. For each placeholder, you will find the `placeholder` attribute: `document.slides[i].text_placeholders[j].placeholder` which is the placeholder of text on the slide.

<Tip>
  Configuring and specifying values for placeholders can get a bit complicated. Contact [adam@flashdocs.ai](mailto:adam@flashdocs.ai) if you have any questions.
</Tip>

### Structuring the `text_placeholder_manual_insertions` parameter

The parameter is a list of commands specifying the text placeholder and the value you would like for it to have.&#x20;

Example:

```json
[
  {
    "placeholder": "[title main]",
    "value": "ARR Growth Plans"
  },
  {
    "placeholder": "[paragraph]",
    "value": "Annual recurring revenue (ARR) increase, or ARR growth rate, is the percentage change in a company\'s ARR over a specific period. It\'s a key metric that helps businesses understand how their revenue is growing and how to scale."
  },
  {
    "placeholder": "[title b]",
    "value": "ARR Growth Strategy"
  },
  {
    "placeholder": "[paragraph]",
    "value": "## **Why It Matters**\\n\\n- **Predictable Revenue:**  \\n  Secure a steady stream of recurring income for better planning.\\n- **Market Opportunities:**  \\n  Stay agile to capture evolving trends and demands.\\n- **Customer Experience:**  \\n  Build long-term relationships that foster both trust and retention.\\n\\nFor further insights and a deep dive into our approach, check out our [ARR Strategy Guide](https://example.com).\\n\\n*Let\'s drive our success by focusing on strategies that boost both revenue and market presence!*",
     "index": "1"
   }
]
```

Note that each instruction must contain the `placeholder` and `value` keys. Some placeholders may exist in multiple places throughout the deck. If you want the placeholder to only be set on a single slide (instead of the whole deck) for a particular value, use the `index` key.

<Tip>
  The value for an item in `text_placeholder_manual_insertions` can support rich text formatting via MarkDown. (See the last item in the example).
</Tip>

## Have FlashDocs generate values for the placeholders

By default, if any text/image/chart placeholder is not manually specified via the `text_placeholder_manual_insertions` parameter, FlashDocs generates the values.

For each text placeholder:

* FlashDocs uses the `prompt` parameter in the API request, values for any other placeholders, and the following data from the slide and text placeholder object:

  * Slide description

  * Text placeholder instruction

  * Text placeholder minimim characters

  * Text placeholder maximum characters

<Tip>
  You can create, view, and edit your organization's FlashDocs templates & libraries at: [https://dash.flashdocs.ai](https://dash.flashdocs.ai)
</Tip>
