POST /api/transfers
Receives an incoming server transfer from another node. This endpoint accepts a multipart form upload containing the server archive and checksum.This endpoint uses JWT authentication instead of the standard API token. The JWT is issued by the Panel and passed from the source node.
Authentication
This endpoint requires a JWT bearer token in the Authorization header:- Subject: The server UUID being transferred
Request Body
The request must be sent asmultipart/form-data with two parts:
A tar.gz compressed archive containing all server files. This part must be sent before the checksum.
SHA-256 checksum of the archive in hexadecimal format. Used to verify data integrity after transfer.
Response
Returns200 OK when the transfer is successfully received and processed.
Error Responses
Invalid or missing JWT token
Invalid request format or checksum mismatchExamples:
"invalid content type""archive must be sent before the checksum""missing archive or checksum""checksums don't match"
Failed to extract archive or configure server environment
Transfer Reception Process
When receiving a transfer, Wings performs the following steps:Checksum Verification
Compares the calculated checksum with the provided checksum to ensure data integrity
Transfer States
The transfer goes through several states:- pending: Transfer instance created, waiting for archive
- processing: Receiving and extracting archive data
- success: Transfer completed successfully
- failure: Transfer failed (files are cleaned up)
Example Request
cURL
JavaScript
Python
Example Response
Implementation Details
Checksum Calculation
The checksum is calculated using SHA-256 as the archive is being uploaded:Data Streaming
The archive is streamed directly to the filesystem without storing the entire file in memory. This allows transferring large servers efficiently:This endpoint is typically called by another Wings instance, not directly by users or the Panel. The Panel orchestrates transfers by providing the necessary JWT tokens to both nodes.
Server Events
During the transfer, the server publishes events that can be monitored via WebSocket:- transfer.status: Status changes (success/failure)
- transfer.logs: Progress messages from the source node
Related Endpoints
Initiate Transfer
Start an outgoing server transfer
Cancel Transfer
Cancel an incoming server transfer
