components: schemas: CreateDeviceRequest: additionalProperties: false properties: ip_address: type: string name: type: string required: - name - ip_address type: object DeviceResponse: additionalProperties: false properties: created_at: format: date-time type: string id: type: integer ip_address: type: string name: type: string updated_at: format: date-time type: string user_id: type: integer required: - id - user_id - name - ip_address - created_at - updated_at type: object DeviceResponseResponse: additionalProperties: false properties: data: $ref: '#/components/schemas/DeviceResponse' total: type: integer required: - data - total type: object ErrorResponse: additionalProperties: false properties: error: type: string required: - error type: object PostStreamUploadResponse: additionalProperties: false properties: upload_hash: type: string required: - upload_hash type: object StreamPinRequest: additionalProperties: false properties: sd_hash: type: string required: - sd_hash type: object StreamResponse: additionalProperties: false properties: created_at: format: date-time type: string id: type: integer sd_hash: type: string size: type: integer stream_hash: type: string stream_name: type: string stream_type: type: string suggested_file_name: type: string updated_at: format: date-time type: string required: - id - stream_hash - sd_hash - stream_name - stream_type - suggested_file_name - created_at - updated_at - size type: object StreamResponseResponse: additionalProperties: false properties: data: $ref: '#/components/schemas/StreamResponse' total: type: integer required: - data - total type: object UpdateDeviceRequest: additionalProperties: false properties: name: type: string required: - name type: object info: description: LBRY Stream API for uploading and managing streams on the LBRY network. Supports stream uploads with metadata management and LBRY network operations. title: LBRY Stream API version: develop openapi: 3.0.0 paths: /api/devices: get: description: List all devices in the whitelist with pagination, filtering, and sorting support. responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeviceResponseResponse' description: Devices retrieved successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: List devices post: description: Create a new device in the whitelist. This endpoint requires authentication. requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateDeviceRequest' description: Device creation request required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "201": content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' description: Device created successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Create a device /api/devices/{id}: delete: description: Delete a device from the whitelist. This endpoint requires authentication and is idempotent. parameters: - description: The ID of the device to delete in: path name: id required: true schema: type: string responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "204": description: Device deleted successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Delete a device get: description: Get a specific device from the whitelist by ID. parameters: - description: The ID of the device to get in: path name: id required: true schema: type: string responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' description: Device retrieved successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Get a device put: description: Update an existing device in the whitelist. This endpoint requires authentication and is idempotent. parameters: - description: The ID of the device to update in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateDeviceRequest' description: Device update request required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeviceResponse' description: Device updated successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Update a device /api/streams: get: description: List all streams for the authenticated user with pagination, filtering, and sorting support. responses: "200": content: application/json: schema: $ref: '#/components/schemas/StreamResponseResponse' description: Streams retrieved successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: List streams /api/streams/{sd_hash}: delete: description: Delete a stream and all associated data. Only streams owned by the authenticated user can be deleted. parameters: - description: The SD hash of the stream to delete in: path name: sd_hash required: true schema: type: string responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "204": description: Stream deleted successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Delete a stream /api/streams/pin: post: description: Pin a stream to keep it available on the LBRY network. This endpoint requires authentication. requestBody: content: application/json: schema: $ref: '#/components/schemas/StreamPinRequest' description: Pin request required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "201": description: Stream pin request accepted "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Pin a stream /api/streams/upload: post: description: Upload a stream to the LBRY network. This endpoint requires authentication and supports file uploads up to the configured limit. requestBody: content: multipart/form-data: schema: additionalProperties: false properties: file: format: binary type: string required: - file type: object description: File to upload required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "201": content: application/json: schema: $ref: '#/components/schemas/PostStreamUploadResponse' description: File uploaded successfully "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Bad request "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error summary: Upload a stream /api/streams/upload/tus: options: description: Retrieves information about the TUS server's supported versions, extensions, and limits. responses: "200": description: Success headers: Tus-Checksum-Algorithm: description: Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server. schema: type: string Tus-Extension: description: The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted. schema: type: string Tus-Max-Size: description: The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit. schema: type: string Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "204": description: Success headers: Tus-Checksum-Algorithm: description: Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server. schema: type: string Tus-Extension: description: The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted. schema: type: string Tus-Max-Size: description: The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit. schema: type: string Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden summary: Get TUS Server Capabilities tags: - TUS post: description: TUS protocol POST handler for /api/streams/upload/tus parameters: - description: Must be 0 for creation extension. May be a positive number for Creation With Upload extension. in: header name: Content-Length schema: type: integer - in: header name: Tus-Resumable required: true schema: type: object - description: Added by the Creation With Upload Extension in combination with the checksum extension. Checksum of the included data. in: header name: Upload-Checksum schema: type: object - description: Added by the Concatenation extension. Indicates whether the upload is either a partial or final upload. in: header name: Upload-Concat schema: type: string - description: Added by the Creation Defer Length extension. Indicates that the size of the upload is not known currently. in: header name: Upload-Defer-Length schema: type: integer - in: header name: Upload-Length required: true schema: type: object - description: Added by the Creation extension. The Upload-Metadata request and response header MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique. The value MAY be empty. In these cases, the space, which would normally separate the key and the value, MAY be left out. Since metadata can contain arbitrary binary values, Servers SHOULD carefully validate metadata values or sanitize them before using them as header values to avoid header smuggling. in: header name: Upload-Metadata schema: type: string - description: Added by the Creation With Upload Extension. Indicates the offset of the included data. in: header name: Upload-Offset schema: type: object requestBody: content: application/offset+octet-stream: schema: type: object description: Remaining (possibly partial) content of the file. Required if Content-Length > 0. responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "201": description: Created headers: Location: description: Url of the created resource. schema: type: string Tus-Resumable: description: Protocol version schema: type: string Upload-Expires: description: Added by the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete uploads after a given period of time to prevent abandoned uploads from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired uploads. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format. schema: type: string Upload-Offset: description: The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer. schema: type: string "400": description: Bad Request headers: Tus-Resumable: description: Protocol version schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden "412": description: Precondition Failed headers: Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "413": description: Request Entity Too Large headers: Tus-Resumable: description: Protocol version schema: type: string "415": description: Unsupported Media Type headers: Tus-Resumable: description: Protocol version schema: type: string "460": description: Checksums mismatch headers: Tus-Resumable: description: Protocol version schema: type: string summary: TUS POST /api/streams/upload/tus tags: - TUS /api/streams/upload/tus/{id}: delete: description: TUS protocol DELETE handler for /api/streams/upload/tus/:id parameters: - description: The ID of the upload resource. in: path name: id required: true schema: type: string - in: header name: Tus-Resumable required: true schema: type: object responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "204": description: Upload was terminated headers: Tus-Resumable: description: Protocol version schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden "412": description: Precondition Failed headers: Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string summary: TUS DELETE /api/streams/upload/tus/:id tags: - TUS head: description: TUS protocol HEAD handler for /api/streams/upload/tus/:id parameters: - description: The ID of the upload resource. in: path name: id required: true schema: type: string - in: header name: Tus-Resumable required: true schema: type: object responses: "200": description: Returns offset headers: Cache-Control: schema: type: string Tus-Resumable: description: Protocol version schema: type: string Upload-Length: description: The Upload-Length request and response header indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. In the concatenation extension, the Client MUST NOT include the Upload-Length header in the final upload creation schema: type: string Upload-Offset: description: The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer. schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden "404": description: Not Found headers: Tus-Resumable: description: Protocol version schema: type: string "410": description: Gone headers: Tus-Resumable: description: Protocol version schema: type: string "412": description: Precondition Failed headers: Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string summary: TUS HEAD /api/streams/upload/tus/:id tags: - TUS options: description: TUS protocol OPTIONS handler for /api/streams/upload/tus/:id parameters: - description: The ID of the upload resource. in: path name: id required: true schema: type: string responses: "200": description: Success headers: Tus-Checksum-Algorithm: description: Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server. schema: type: string Tus-Extension: description: The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted. schema: type: string Tus-Max-Size: description: The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit. schema: type: string Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "204": description: Success headers: Tus-Checksum-Algorithm: description: Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server. schema: type: string Tus-Extension: description: The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted. schema: type: string Tus-Max-Size: description: The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit. schema: type: string Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden summary: TUS OPTIONS /api/streams/upload/tus/:id tags: - TUS patch: description: TUS protocol PATCH handler for /api/streams/upload/tus/:id parameters: - description: The ID of the upload resource. in: path name: id required: true schema: type: string - description: Length of the body of this request in: header name: Content-Length required: true schema: type: integer - in: header name: Tus-Resumable required: true schema: type: object - description: Added by the checksum extension. Checksum of the current body payload. in: header name: Upload-Checksum schema: type: object - description: The offset at which the upload should be continued. in: header name: Upload-Offset required: true schema: type: object requestBody: content: application/offset+octet-stream: schema: type: object description: Remaining (possibly partial) content of the file. Required if Content-Length > 0. responses: "200": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Success "204": description: Upload offset was updated headers: Tus-Resumable: description: Protocol version schema: type: string Upload-Expires: description: Added by the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete uploads after a given period of time to prevent abandoned uploads from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired uploads. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format. schema: type: string Upload-Offset: description: The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer. schema: type: string "400": description: Bad Request headers: Tus-Resumable: description: Protocol version schema: type: string "401": content: application/json: schema: type: string description: Unauthorized "403": content: application/json: schema: type: string description: Forbidden "404": description: Not Found headers: Tus-Resumable: description: Protocol version schema: type: string "409": description: Conflict headers: Tus-Resumable: description: Protocol version schema: type: string "410": description: Gone headers: Tus-Resumable: description: Protocol version schema: type: string "412": description: Precondition Failed headers: Tus-Resumable: description: Protocol version schema: type: string Tus-Version: description: The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one. schema: type: string "415": description: Unsupported Media Type headers: Tus-Resumable: description: Protocol version schema: type: string "460": description: Checksums mismatch headers: Tus-Resumable: description: Protocol version schema: type: string summary: TUS PATCH /api/streams/upload/tus/:id tags: - TUS servers: - url: /api