> For the complete documentation index, see [llms.txt](https://docs.theopenpresenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theopenpresenter.com/plugins/developing-a-plugin/plugin-api/media/frontend.md).

# Frontend

### Headers

To get upload working, we need a few information:

**csrf-token**

<pre class="language-typescript"><code class="lang-typescript"><strong>{ "csrf-token": pluginApi.env.getCSRFToken() }
</strong></code></pre>

**organization-id**

<pre class="language-typescript"><code class="lang-typescript"><strong>{ "organization-id": pluginApi.pluginContext.organizationId }
</strong></code></pre>

**file-extension (optional)**

If none is passed, we will read from the original file name. If none, then it'll be empty.&#x20;

For tus, the original file name is obtained from `metadata.filename`&#x20;

For form data, the original file name is obtained from the `filename` field.

**custom-media-id (optional)**

The resulting id of the media. If none is passed, we will generate one.
