# Storage Node

## Preamble

This document is not yet complete and is primarily informed by the following more comprehensive documentation

{% embed url="<https://github.com/Joystream/joystream/tree/giza_staging/storage-node-v2>" %}

## Introduction

WIP.

## API

### files/{id}

#### GET

Returns a media file.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/files/{id}" method="get" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

#### HEAD

Returns media file headers.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="undefined" method="undefined" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### files

Upload data.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/files" method="post" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### authToken

Get auth token.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/authToken" method="post" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### state/data-objects

Returns all local data objects.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/state/data-objects" method="get" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### state/bags/{bagId}/data-objects

Returns local data objects for a bag.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/state/bags/{bagId}/data-objects" method="get" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### version

Returns server version.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/version" method="get" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

### state/data

Returns local uploading directory stats.

{% openapi src="<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>" path="/state/data" method="get" %}
<https://raw.githubusercontent.com/Joystream/joystream/giza_staging/storage-node-v2/src/api-spec/openapi.yaml>
{% endopenapi %}

## Scenarios

WIP.


---

# 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://handbook.joystream.org/system/storage/storage-node.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.
