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

# Pre-Fill Chat Data via URL

You can now pre-fill chat data on [TypingMind](https://www.typingmind.com/) using URL parameters. Follow the guide below to configure your chat sessions.

## 1. Pre-Fill Initial System Message

To set an initial system message for all chats upon opening the app, put the message itself in the `initialContextURL` query parameter as a text data URL:

```text theme={null}
https://typingmind.com?initialContextURL=data:text/plain,<your-system-message>
```

For example:

```text theme={null}
https://typingmind.com?initialContextURL=data:text/plain,You%20are%20a%20helpful%20travel%20assistant.
```

The system will initialize a new chat using that message. Additionally, you can set a custom chat title by appending the `chatTitle` parameter:

```text theme={null}
https://typingmind.com?initialContextURL=data:text/plain,You%20are%20a%20helpful%20travel%20assistant.&chatTitle=Hello%20World
```

To build the link in code, encode the message, then encode the whole data URL:

```javascript theme={null}
const systemMessage = 'You are a helpful travel assistant.\nAnswer in short bullet points.';
const dataURL = 'data:text/plain;charset=utf-8,' + encodeURIComponent(systemMessage);
const link = 'https://typingmind.com?initialContextURL=' + encodeURIComponent(dataURL);
```

**Important Notes:**

* `initialContextURL` only accepts `data:` URLs with a text media type, such as `data:text/plain,...` or `data:text/markdown;base64,...`. Web addresses (`http://` or `https://`) are not loaded, and the app shows an "Unable to Load Context" message instead.
* The message is read from the link itself. TypingMind doesn't make any network request for it.
* Subsequent chats in the same session will retain this context as the system message.
* The system message can be updated later via the chat model settings.

## 2. Pre-Fill Initial Agent

You can also set the initial agent for a new chat via the URL. To do so:

1. Obtain the agent ID.

   ![image.png](https://mintcdn.com/typingmind/pm53BB_D69NXvWmb/integrations/pre-fill-chat-data-via-url/image.webp?fit=max\&auto=format\&n=pm53BB_D69NXvWmb\&q=85\&s=17c8cac4ff84dfe2ead7fb930c77c41b)
2. Open the app with the following URL format:

```text theme={null}
https://typingmind.com?agent=<agent-id>
```

## 3. Pre-Fill Initial Message

To set an initial message for a chat, use the `message` parameter in the URL as shown below:

```text theme={null}
https://typingmind.com?message=<your-message>
```

## 4. Limitations

Please note that the pre-fill initial message feature currently cannot be used in combination with both the system message and agent settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.