# How to control VDO.Ninja with Touch Portal

## How to

1\. Create a new room as a director, with a custom API key, so that it looks like this: [`https://vdo.ninja/?api=APIKEY&director=TouchPortalExample`](https://vdo.ninja/?api=APIKEY\&director=TouchPortalExample)\
Replacing the APIKEY with a string of your choosing.

2\. Then, in Touch Portal, add a new button with the `HTTP GET` action. In the `HTTP GET` Action `GET URL` field, input your desired action. This particular GET action will send Guest 1 to Scene 1 with a push of the button:\
`https://api.vdo.ninja/APIKEY/addScene/1/1`

<div align="left"><img src="/files/Yrl8ZmPzljtemoUmqqPo" alt=""></div>

Thanks to <mark style="color:red;">djlefave</mark> on [Discord](https://discord.vdo.ninja/) for this guide.

## Switching the layout of a scene in OBS

`https://api.vdo.ninja/APIKEY/layout/[{"x":0,"y":0,"w":50,"h":100,"c":true,"slot":0},{"x":50,"y":0,"w":50,"h":100,"c":false,"slot":1}]`

![](/files/UBgPkPiKf9kRbCwX4YjJ)

You can also use Touch Portal to switch the layout of [`&scene=0`](/advanced-settings/mixer-scene-parameters/scene.md) without using the [Mixer App](/steves-helper-apps/mixer-app.md).

<https://docs.google.com/spreadsheets/d/1cHBTfni-Os3SAITsXrrNJ3qVCMVjunuW3xugvw1dykw/edit#gid=151839312>

You can download this google sheet and use it to create your own layouts.

## Examples and resources

For more API examples, check out these resources:\
<https://github.com/steveseguin/Companion-Ninja>\
<https://companion.vdo.ninja/?api=k8eYrfvJUC>

## Related

{% content-ref url="/pages/-Mj8bfVV-0wZjmDO9Y11" %}
[\&api](/advanced-settings/api-and-midi-parameters/api.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vdo.ninja/guides/how-to-control-vdo.ninja-with-touch-portal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
