Upload required documents
This page explains how to upload documents for a capital deposit case using the API.
Refer to the Dashboard guide for the whole operational process.
Step 1: Generate upload URL
Use the generateCapitalDepositDocumentUploadUrl mutation to generate an upload URL.
- Call the
generateCapitalDepositDocumentUploadUrlmutation. - Enter all required information:
documentId,capitalDepositCaseId, andfilename. - Add the
GenerateSupportingDocumentUploadUrlSuccessPayloadwith theuploadUrl. - Add other optional messages to the payload, either for validation or in case of rejection.
Before generating an upload URL, retrieve the pre-assigned document ID from the capital deposit case or shareholder record. Use that ID when uploading the document.
Open in API Explorermutation generateUploadUrl {
generateCapitalDepositDocumentUploadUrl(
input: {
documentId: "$YOUR_DOCUMENT_ID"
capitalDepositCaseId: "$YOUR_CAPITALDEPOSITCASE_ID"
filename: "$FILE_NAME"
}
) {
... on GenerateCapitalDepositDocumentUploadUrlSuccessPayload {
uploadUrl
}
}
}
Step 2: Retrieve generated URL from payload
Retrieve the generated uploadUrl in the payload.
The uploadUrl is only valid for seven days. If the URL expires, generate a new one before uploading the document.
{
"data": {
"generateCapitalDepositDocumentUploadUrl": {
"uploadUrl": "$YOUR_UPLOAD_URL"
}
}
}
Step 3: Send HTTP PUT request
Send an HTTP PUT request to the uploadUrl with a Content-Type: multipart/form-data header.
Supported formats: .pdf, .png, .jpg
curl --upload-file $YOUR_FILE https://$UPLOAD_URL
Step 4: Repeat
Repeat steps 1-3 to upload additional documents, as needed.
You can also change the documents you already uploaded as long as the document status remains Uploaded.
Replace a refused document
If Swan refuses a document, review the refusal reason in the Dashboard or through the API. Correct the document and upload a replacement using the same process.
After the replacement is uploaded, the document status returns to Uploaded while Swan reviews it again.
You can replace a document while its status is Uploaded. Don't replace documents that have already reached Validated.