Valstorm LogoDev

files Endpoints

All endpoints for the files API group. Great for feeding into an LLM context.

POST

/v1/files/token

Generate File Access Token

Generates a short-lived (5 min) access token. Used by the frontend to construct authorized video stream URLs.


Responses
200
Successful Response
application/json
{}
404
Not found
API Runner

GET

/v1/files/stream/{file_id}

Stream File By Id Query Auth

Streams a file by ID using a query token for authentication. Supports Range requests.


Parameters
file_id*
in: path
type: string
token*
in: query
type: string
range
in: header
type: string
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

GET

/v1/files/stream

Stream File By Location

Streams a file by location (deprecated/compatibility). SECURED: Now verifies the location exists in the user's organization.


Parameters
location*
in: query
type: string
token*
in: query
type: string
range
in: header
type: string
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

POST

/v1/files/location

Get File By Location

Streams a file directly from S3 given its full location key. SECURED: Now verifies the location exists in the user's organization.


Request Body
{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/GetFile"
      }
    }
  },
  "required": true
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

GET

/v1/files/{file_id}

Get File Route

Finds a file by its ID in the database and streams it from S3. SECURED: Added explicit ownership and admin checks.


Parameters
file_id*
in: path
type: string
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

DELETE

/v1/files/{file_id}

Delete File Route

Deletes a file from DB and S3 via the service layer.


Parameters
file_id*
in: path
type: string
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

POST

/v1/files

Upload Files Route

Handles multiple file uploads. Delegates complex video processing and S3 logic to the service layer.


Request Body
{
  "content": {
    "multipart/form-data": {
      "schema": {
        "$ref": "#/components/schemas/Body_upload_files_route_v1_files_post"
      }
    }
  },
  "required": true
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner