> For the complete documentation index, see [llms.txt](https://docs.medialooks.com/direct-take-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medialooks.com/direct-take-docs/master.md).

# Getting started with REST API

### Enable REST API Control

To enable REST API based control of Direct Take, you should run it with the administrator privileges, and go to Preferences:

![](/files/-MiRVDl9i0Ml4eAghTzZ)

Once the prefix is set, Direct Take is available for remote control.

### General Notes

The type of request content is JSON: `application/json`

When you create or update resources, you don't need to put all the fields in JSON. All the unspecified fields keep the existing values for `PUT`, or set with the default values for `POST`.

All valid responses have the code `200 (OK)`. If something is wrong, the API returns the code `400 (Bad Request)`.

### Authorization

You should use the REST API Token with all the requests as the "Authorization" header. The token is provided with a license for Direct Take. You can copy the token from the Preferences menu.&#x20;

Example: "*Bearer perm:2cc39f38-d120-46fa-9d90-359375b4eb26*"

### REST API URL in Direct Take

Direct Take's REST API is available by the following URL:

```
http://{server_address}:{port_number}/api/
```

&#x20;`/api/` is the context path for the REST API of the service.

### Typical method

<mark style="color:blue;">`GET`</mark> `http://localhost:9000/api/sources/{index}`

Returns you a configuration of a source with the specified index. If the index is not set, returns you all the sources in a single response.

#### Query Parameters

| Name    | Type   | Description                            |
| ------- | ------ | -------------------------------------- |
| {index} | number | Specifies an index of a source to get. |

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | API Token   |

{% tabs %}
{% tab title="200 Successfully returned JSON" %}

```
{
  "VideoDevice": {
    "Type": 0,
    "Name": "Logitech BRIO"
  },
  "Name": "Source 1",
  "AudioMeters": [
    0.0,
    0.0
  ],
  "VideoLines": [],
  "VideoLine": null,
  "VideoFormats": [
    "YUY2 640x480@30.00p 4:3",
    "YUY2 800x600@30.00p 4:3",
    "YUY2 1280x720@30.00p 16:9",
    "HD1080-30p YUY2 1920x1080@30.00p 16:9"
  ],
  "VideoFormat": null,
  "AudioDevice": null,
  "AudioFormats": [],
  "AudioFormat": null,
  "StreamBuffer": 5,
  "StreamURL": null,
  "LTCTimecode": null,
  "AudioGain": 0.0
}
```

{% endtab %}
{% endtabs %}

### Direct Take Web Tools

Here is a web-based dashboard and a local JavaScript client for the Medialooks Direct Take REST API:

<https://github.com/Medialooks-LLC/dt-rest-dashboard>
