> For the complete documentation index, see [llms.txt](https://developer.fotokite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.fotokite.com/~/changes/46/fotokite-api/media.md).

# Media

## Lists existing video recordings

> A recording is a collection of video files (color and thermal) and metadata files. One recording might contain multiple video files.

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"Recording":{"type":"object","description":"Represents a video recording, including video files and metadata.","required":["directory","is_being_recorded","videos"],"properties":{"directory":{"type":"string","description":"Directory of the recording, URL-encoded."},"is_being_recorded":{"type":"boolean","description":"Whether this recording is currently being recorded."},"videos":{"type":"array","items":{"$ref":"#/components/schemas/VideoFile"}}}},"VideoFile":{"description":"Represents a video file in a recording, including metadata.","type":"object","required":["type","directory","name","size","is_recording"],"properties":{"type":{"$ref":"#/components/schemas/VideoStreamType"},"directory":{"type":"string","description":"Directory of the video recording on the FS"},"name":{"type":"string"},"size":{"type":"integer","format":"int64"},"is_recording":{"type":"boolean"}}},"VideoStreamType":{"type":"string","description":"Video stream type. Possible values:\n* `Color` - regular color video stream.\n* `Thermal` - thermal video stream.\n"}}},"paths":{"/v0/media/recordings":{"get":{"summary":"Lists existing video recordings","description":"A recording is a collection of video files (color and thermal) and metadata files. One recording might contain multiple video files.","tags":["Media"],"responses":{"200":{"description":"List of video recordings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recording"}}}}}}}}}}
```

## Get video recording details

> Returns details of a specific video recording, including video files and metadata.

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"Recording":{"type":"object","description":"Represents a video recording, including video files and metadata.","required":["directory","is_being_recorded","videos"],"properties":{"directory":{"type":"string","description":"Directory of the recording, URL-encoded."},"is_being_recorded":{"type":"boolean","description":"Whether this recording is currently being recorded."},"videos":{"type":"array","items":{"$ref":"#/components/schemas/VideoFile"}}}},"VideoFile":{"description":"Represents a video file in a recording, including metadata.","type":"object","required":["type","directory","name","size","is_recording"],"properties":{"type":{"$ref":"#/components/schemas/VideoStreamType"},"directory":{"type":"string","description":"Directory of the video recording on the FS"},"name":{"type":"string"},"size":{"type":"integer","format":"int64"},"is_recording":{"type":"boolean"}}},"VideoStreamType":{"type":"string","description":"Video stream type. Possible values:\n* `Color` - regular color video stream.\n* `Thermal` - thermal video stream.\n"},"Error":{"type":"object","description":"A generic error object.","required":["code","message"],"properties":{"code":{"description":"Unique error code.","type":"string"},"message":{"description":"User readable message of the error","type":"string"}}}},"responses":{"NotFound":{"description":"File Not Found. Endpoint does not exist at all or the object referred to is not known.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v0/media/recordings/{recording}":{"get":{"summary":"Get video recording details","description":"Returns details of a specific video recording, including video files and metadata.","tags":["Media"],"responses":{"200":{"description":"Details of the video recording","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recording"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## Delete video recordings

> Deletes both IR and Color videos from the specified recording directory. Does not delete metadata files.

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"responses":{"BadRequest":{"description":"Bad request. This can be a completely malformed request (e.g. request body not JSON) or specific parameter values that are outside the acceptable limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"A generic error object.","required":["code","message"],"properties":{"code":{"description":"Unique error code.","type":"string"},"message":{"description":"User readable message of the error","type":"string"}}}}},"paths":{"/v0/media/recordings/{recording}":{"delete":{"summary":"Delete video recordings","description":"Deletes both IR and Color videos from the specified recording directory. Does not delete metadata files.","tags":["Media"],"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"}}}}}}
```

## GET /v0/media/recordings/{recording}/{file}

> Download video

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"responses":{"BadRequest":{"description":"Bad request. This can be a completely malformed request (e.g. request body not JSON) or specific parameter values that are outside the acceptable limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"File Not Found. Endpoint does not exist at all or the object referred to is not known.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RangeNotSatisfiable":{"description":"Requested Range Not Satisfiable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"A generic error object.","required":["code","message"],"properties":{"code":{"description":"Unique error code.","type":"string"},"message":{"description":"User readable message of the error","type":"string"}}}}},"paths":{"/v0/media/recordings/{recording}/{file}":{"get":{"summary":"Download video","tags":["Media"],"responses":{"200":{"description":"Full file content","content":{"video/mp4":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"Partial file content","headers":{"Accept-Ranges":{"description":"The range unit supported by the server.","schema":{"type":"string"}},"Content-Length":{"description":"Length of the response body in bytes.","schema":{"type":"integer","format":"int64"}},"Content-Range":{"description":"Content byte range in the response.","schema":{"type":"string","pattern":"^bytes \\d+-\\d+/\\d+$"}}},"content":{"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/RangeNotSatisfiable"}}}}}}
```

## Recorder status

> Returns the current status of the video recorder.

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"RecorderStatus":{"type":"object","description":"Current status of the video recorder.","required":["directory","started_recording_timestamp"],"properties":{"directory":{"type":"string","description":"Directory path of the recording on the filesystem (URL-encoded)."},"started_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was started since boot, or zero otherwise."},"stopped_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was stopped, or current time if recording."},"is_recording":{"type":"boolean","description":"Whether the recorder is currently running."},"recording_seconds":{"type":"integer","format":"int32","description":"Number of seconds the current recording has been running."}}}}},"paths":{"/v0/media/recorder/status":{"get":{"summary":"Recorder status","description":"Returns the current status of the video recorder.","tags":["Media"],"responses":{"200":{"description":"Current recorder status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecorderStatus"}}}}}}}}}
```

## GET /v0/media/diskstats

> SSD disk stats

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["media"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"DiskStats":{"type":"object","description":"Disk usage statistics in bytes.","required":["used","total"],"properties":{"used":{"type":"integer","format":"int64","minimum":0},"total":{"type":"integer","format":"int64","minimum":0}}}}},"paths":{"/v0/media/diskstats":{"get":{"summary":"SSD disk stats","tags":["Media"],"responses":{"200":{"description":"SSD disk usage statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiskStats"}}}}}}}}}
```

## POST /v0/commands/recorder/start

> Start recording

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["command"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"RecorderStatus":{"type":"object","description":"Current status of the video recorder.","required":["directory","started_recording_timestamp"],"properties":{"directory":{"type":"string","description":"Directory path of the recording on the filesystem (URL-encoded)."},"started_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was started since boot, or zero otherwise."},"stopped_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was stopped, or current time if recording."},"is_recording":{"type":"boolean","description":"Whether the recorder is currently running."},"recording_seconds":{"type":"integer","format":"int32","description":"Number of seconds the current recording has been running."}}},"Error":{"type":"object","description":"A generic error object.","required":["code","message"],"properties":{"code":{"description":"Unique error code.","type":"string"},"message":{"description":"User readable message of the error","type":"string"}}}},"responses":{"ControlCommandBlocked":{"description":"Control is not allowed because somebody else is controlling the System.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InsufficientStorage":{"description":"Insufficient Storage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v0/commands/recorder/start":{"post":{"summary":"Start recording","tags":["Media"],"responses":{"200":{"description":"Recorder status after starting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecorderStatus"}}}},"400":{"description":"Bad request"},"403":{"$ref":"#/components/responses/ControlCommandBlocked"},"507":{"$ref":"#/components/responses/InsufficientStorage"}}}}}}
```

## POST /v0/commands/recorder/stop

> Stop recording

```json
{"openapi":"3.0.4","info":{"title":"Fotokite API","version":"0.2.0"},"servers":[{"url":"http://192.168.2.100:3128/api","description":"API service running on the system"},{"url":"http://{hostname}:3128/api","description":"API service visible through NAT","variables":{"hostname":{"default":"sigma.local"}}}],"security":[{"TokenAuth":["command"]}],"components":{"securitySchemes":{"TokenAuth":{"description":"Plugin authentication using Bearer token. For more details, see [Fotokite API Documentation](https://developer.fotokite.com/~/changes/46/getting-started#authentication).\n","type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"http://192.168.2.100:3128/api/v0/authentication/tokens/request","scopes":{"info":"Read static information about the system.","telemetry":"Read dynamic information about the system.","command":"Send commands to the system.","media":"Interaction with the media library.","internal":"Fotokite-internal APIs."}}}}},"schemas":{"RecorderStatus":{"type":"object","description":"Current status of the video recorder.","required":["directory","started_recording_timestamp"],"properties":{"directory":{"type":"string","description":"Directory path of the recording on the filesystem (URL-encoded)."},"started_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was started since boot, or zero otherwise."},"stopped_recording_timestamp":{"type":"string","format":"date-time","description":"Last time a recording was stopped, or current time if recording."},"is_recording":{"type":"boolean","description":"Whether the recorder is currently running."},"recording_seconds":{"type":"integer","format":"int32","description":"Number of seconds the current recording has been running."}}},"Error":{"type":"object","description":"A generic error object.","required":["code","message"],"properties":{"code":{"description":"Unique error code.","type":"string"},"message":{"description":"User readable message of the error","type":"string"}}}},"responses":{"ControlCommandBlocked":{"description":"Control is not allowed because somebody else is controlling the System.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InsufficientStorage":{"description":"Insufficient Storage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v0/commands/recorder/stop":{"post":{"summary":"Stop recording","tags":["Media"],"responses":{"200":{"description":"Recorder status after stopping","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecorderStatus"}}}},"400":{"description":"Bad request"},"403":{"$ref":"#/components/responses/ControlCommandBlocked"},"507":{"$ref":"#/components/responses/InsufficientStorage"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.fotokite.com/~/changes/46/fotokite-api/media.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
